diff options
| author | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-11-23 19:12:20 +0000 |
|---|---|---|
| committer | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-11-23 19:12:20 +0000 |
| commit | 8431ac369b2f12ac376798fb01748f52d327164a (patch) | |
| tree | 383144a0a102038cf5fd1aaf780f9594ffb376f1 /src/protocol | |
| parent | 5950b11a0f4903cd07c0068a428f499dd64bdd2b (diff) | |
Converted many C-style casts to C++-style casts.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1788 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/protocol')
| -rw-r--r-- | src/protocol/bahamut.c | 6 | ||||
| -rw-r--r-- | src/protocol/inspircd11.c | 4 | ||||
| -rw-r--r-- | src/protocol/inspircd12.cpp | 8 | ||||
| -rw-r--r-- | src/protocol/ratbox.c | 8 | ||||
| -rw-r--r-- | src/protocol/unreal32.c | 4 |
5 files changed, 15 insertions, 15 deletions
diff --git a/src/protocol/bahamut.c b/src/protocol/bahamut.c index 9854adeaf..9f92dffa4 100644 --- a/src/protocol/bahamut.c +++ b/src/protocol/bahamut.c @@ -441,7 +441,7 @@ void bahamut_cmd_burst() */ void bahamut_cmd_svinfo() { - send_cmd(NULL, "SVINFO 3 1 0 :%ld", (long int) time(NULL)); + send_cmd(NULL, "SVINFO 3 1 0 :%ld", static_cast<long>(time(NULL))); } /* PASS */ @@ -524,7 +524,7 @@ class BahamutIRCdProto : public IRCDProto /* SVSHOLD - set */ void SendSVSHold(const char *nick) { - send_cmd(ServerName, "SVSHOLD %s %u :%s", nick, (unsigned int)NSReleaseTimeout, "Being held for registered user"); + send_cmd(ServerName, "SVSHOLD %s %u :%s", nick, static_cast<unsigned>(NSReleaseTimeout), "Being held for registered user"); } /* SVSHOLD - release */ @@ -631,7 +631,7 @@ class BahamutIRCdProto : public IRCDProto // Calculate the time left before this would expire, capping it at 2 days time_t timeleft = expires - time(NULL); if (timeleft > 172800) timeleft = 172800; - send_cmd(NULL, "AKILL %s %s %d %s %ld :%s", host, user, (unsigned int)timeleft, who, static_cast<long>(time(NULL)), reason); + send_cmd(NULL, "AKILL %s %s %d %s %ld :%s", host, user, static_cast<int>(timeleft), who, static_cast<long>(time(NULL)), reason); } /* SVSKILL */ diff --git a/src/protocol/inspircd11.c b/src/protocol/inspircd11.c index ebc694745..6ea1c2b2c 100644 --- a/src/protocol/inspircd11.c +++ b/src/protocol/inspircd11.c @@ -428,7 +428,7 @@ void inspircd_cmd_chghost(const char *nick, const char *vhost) int anope_event_idle(const char *source, int ac, const char **av) { if (ac == 1) { - send_cmd(av[0], "IDLE %s %ld 0", source, (long int) time(NULL)); + send_cmd(av[0], "IDLE %s %ld 0", source, static_cast<long>(time(NULL))); } return MOD_CONT; } @@ -1071,7 +1071,7 @@ int anope_event_nick(const char *source, int ac, const char **av) { User *user; struct in_addr addy; - uint32 *ad = (uint32 *) & addy; + uint32 *ad = reinterpret_cast<uint32 *>(&addy); if (ac != 1) { if (ac == 8) { diff --git a/src/protocol/inspircd12.cpp b/src/protocol/inspircd12.cpp index 205e91897..dc46f95e2 100644 --- a/src/protocol/inspircd12.cpp +++ b/src/protocol/inspircd12.cpp @@ -427,7 +427,7 @@ int anope_event_idle(const char *source, int ac, const char **av) if (!bi) return MOD_CONT; - send_cmd(bi->uid, "IDLE %s %ld 0", source, (long int) time(NULL)); + send_cmd(bi->uid, "IDLE %s %ld 0", source, static_cast<long>(time(NULL))); return MOD_CONT; } @@ -629,7 +629,7 @@ class InspIRCdProto : public IRCDProto void SendSVSHold(const char *nick) { BotInfo *bi = findbot(s_OperServ); - send_cmd(bi->uid, "SVSHOLD %s %ud :%s", nick, (unsigned int)NSReleaseTimeout, "Being held for registered user"); + send_cmd(bi->uid, "SVSHOLD %s %u :%s", nick, static_cast<unsigned>(NSReleaseTimeout), "Being held for registered user"); } /* SVSHOLD - release */ @@ -701,7 +701,7 @@ class InspIRCdProto : public IRCDProto send_cmd(ircd->ts6 ? bi->uid : bi->nick, "SNONOTICE A :%s", buf); } } - + int IsNickValid(const char *nick) { /* InspIRCd, like TS6, uses UIDs on collision, so... */ @@ -1104,7 +1104,7 @@ int anope_event_uid(const char *source, int ac, const char **av) User *user; struct in_addr addy; Server *s = findserver_uid(servlist, source); - uint32 *ad = (uint32 *) &addy; + uint32 *ad = reinterpret_cast<uint32 *>(&addy); int svid = 0; int ts = strtoul(av[1], NULL, 10); diff --git a/src/protocol/ratbox.c b/src/protocol/ratbox.c index a91d676a6..efe61bd27 100644 --- a/src/protocol/ratbox.c +++ b/src/protocol/ratbox.c @@ -420,7 +420,7 @@ CUMode myCumodes[128] = { */ void ratbox_cmd_svinfo() { - send_cmd(NULL, "SVINFO 6 3 0 :%ld", (long int) time(NULL)); + send_cmd(NULL, "SVINFO 6 3 0 :%ld", static_cast<long>(time(NULL))); } void ratbox_cmd_svsinfo() @@ -1029,12 +1029,12 @@ int anope_event_capab(const char *source, int ac, const char **av) return MOD_CONT; /* We get the params as one arg, we should split it for capab_parse */ - argv = (const char **)scalloc(argvsize, sizeof(const char *)); + argv = static_cast<const char **>(scalloc(argvsize, sizeof(const char *))); argc = 0; while ((str = myStrGetToken(av[0], ' ', argc))) { if (argc == argvsize) { argvsize += 8; - argv = (const char **)srealloc(argv, argvsize * sizeof(const char *)); + argv = static_cast<const char **>(srealloc(argv, argvsize * sizeof(const char *))); } argv[argc] = str; argc++; @@ -1046,7 +1046,7 @@ int anope_event_capab(const char *source, int ac, const char **av) for (argvsize = 0; argvsize < argc; argvsize++) { delete [] argv[argvsize]; } - free((char **)argv); + free(const_cast<char **>(argv)); return MOD_CONT; } diff --git a/src/protocol/unreal32.c b/src/protocol/unreal32.c index 74bafd0f9..b6986861e 100644 --- a/src/protocol/unreal32.c +++ b/src/protocol/unreal32.c @@ -475,7 +475,7 @@ void unreal_cmd_svswatch(const char *sender, const char *nick, const char *parm) void unreal_cmd_netinfo(int ac, const char **av) { - send_cmd(NULL, "AO %ld %ld %d %s 0 0 0 :%s", (long int) maxusercnt, (long int) time(NULL), atoi(av[2]), av[3], av[7]); + send_cmd(NULL, "AO %ld %ld %d %s 0 0 0 :%s", static_cast<long>(maxusercnt), static_cast<long>(time(NULL)), atoi(av[2]), av[3], av[7]); } /* PROTOCTL */ /* @@ -1335,7 +1335,7 @@ int anope_event_sdesc(const char *source, int ac, const char **av) s = findserver(servlist, source); if (s) { - s->desc = (char *)av[0]; // XXX Unsafe cast -- CyberBotX + s->desc = const_cast<char *>(av[0]); // XXX Unsafe cast -- CyberBotX } return MOD_CONT; |
