summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-10-24 16:37:29 -0400
committerAdam <Adam@anope.org>2011-10-24 16:37:29 -0400
commit7c62de1f27ee21e41b7655e9d82a227f6e2cf2b5 (patch)
tree9393c1c5b18c3d34da786556f960fe5cc010ee98
parentccf29c013465ba4b9709c04ba4452f4454b1ebdc (diff)
parent377a7a968b6a906f262a45abea9a563ffc471938 (diff)
Merge branch '1.9' of anope.git.sf.net:/gitroot/anope/anope into 1.9
-rw-r--r--CMakeLists.txt15
-rw-r--r--include/account.h2
-rw-r--r--include/bots.h2
-rw-r--r--include/channels.h8
-rw-r--r--include/extern.h12
-rw-r--r--include/modules.h2
-rw-r--r--include/regchannel.h20
-rw-r--r--include/services.h2
-rw-r--r--include/sysconf.h.cmake84
-rw-r--r--modules/commands/bs_kick.cpp44
-rw-r--r--modules/commands/cs_access.cpp10
-rw-r--r--modules/commands/cs_set_bantype.cpp2
-rw-r--r--modules/commands/ms_set.cpp6
-rw-r--r--modules/database/db_old.cpp98
-rw-r--r--modules/database/db_plain.cpp44
-rw-r--r--modules/database/db_sql_live_read.cpp2
-rw-r--r--modules/database/db_sql_live_write.cpp10
-rw-r--r--modules/encryption/enc_sha1.cpp36
-rw-r--r--modules/encryption/enc_sha256.cpp42
-rw-r--r--modules/extra/m_sqlite.cpp8
-rw-r--r--src/misc.cpp22
-rw-r--r--src/regchannel.cpp30
-rw-r--r--src/sockets.cpp8
-rw-r--r--src/users.cpp8
24 files changed, 220 insertions, 297 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0e863bf06..774f8c2e7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -248,7 +248,7 @@ else(MSVC)
if(UNIX)
set(CXXFLAGS "${CXXFLAGS} -ansi -pedantic")
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- set(CXXFLAGS "${CXXFLAGS} -fno-leading-underscore")
+ set(CXXFLAGS "${CXXFLAGS} -Wno-long-long -fno-leading-underscore")
endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# If we aren't on a *nix system, we are using MinGW
else(UNIX)
@@ -329,7 +329,8 @@ if(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINF
endif(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")
# Check for the existance of the following include files
-check_include_file(sys/types.h HAVE_SYS_TYPES_H)
+check_include_file(cstdint HAVE_CSTDINT)
+check_include_file(stdint.h HAVE_STDINT_H)
check_include_file(strings.h HAVE_STRINGS_H)
# Check for the existance of the following functions
@@ -341,16 +342,6 @@ check_function_exists(epoll_wait HAVE_EPOLL)
check_function_exists(poll HAVE_POLL)
check_function_exists(kqueue HAVE_KQUEUE)
-# Check for the existance of the following types
-check_type_size(uint8_t UINT8_T)
-check_type_size(u_int8_t U_INT8_T)
-check_type_size(int16_t INT16_T)
-check_type_size(uint16_t UINT16_T)
-check_type_size(u_int16_t U_INT16_T)
-check_type_size(int32_t INT32_T)
-check_type_size(uint32_t UINT32_T)
-check_type_size(u_int32_t U_INT32_T)
-
# Check if eventfd works
try_run(EVENTFD_TEST_RUN_RESULT EVENTFD_TEST_COMPILE_RESULT ${CMAKE_CURRENT_BINARY_DIR} ${Anope_SOURCE_DIR}/cmake/eventfd_test.cpp)
set(HAVE_EVENTFD FALSE)
diff --git a/include/account.h b/include/account.h
index 3cfb803f8..395d883dc 100644
--- a/include/account.h
+++ b/include/account.h
@@ -158,7 +158,7 @@ class CoreExport NickCore : public Extensible, public Flags<NickCoreFlag, NI_END
Oper *o;
/* Unsaved data */
- uint16 channelcount; /* Number of channels currently registered */
+ uint16_t channelcount; /* Number of channels currently registered */
time_t lastmail; /* Last time this nick record got a mail */
std::list<NickAlias *> aliases; /* List of aliases */
diff --git a/include/bots.h b/include/bots.h
index c23a354fc..64d185840 100644
--- a/include/bots.h
+++ b/include/bots.h
@@ -35,7 +35,7 @@ static const Anope::string BotFlagString[] = { "BEGIN", "CORE", "PRIVATE", "CONF
class CoreExport BotInfo : public User, public Flags<BotFlag, BI_END>, public Serializable<BotInfo>
{
public:
- uint32 chancount;
+ uint32_t chancount;
time_t created; /* Birth date ;) */
time_t lastmsg; /* Last time we said something */
typedef Anope::insensitive_map<CommandInfo> command_map;
diff --git a/include/channels.h b/include/channels.h
index 81096cbe3..a4e27469c 100644
--- a/include/channels.h
+++ b/include/channels.h
@@ -43,7 +43,7 @@ class CoreExport Channel : public Extensible, public Flags<ChannelFlag, 3>
/** A map of channel modes with their parameters set on this channel
*/
ModeList modes;
-
+
public:
/** Default constructor
* @param name The channel name
@@ -68,9 +68,9 @@ class CoreExport Channel : public Extensible, public Flags<ChannelFlag, 3>
time_t server_modetime; /* Time of last server MODE */
time_t chanserv_modetime; /* Time of last check_modes() */
- int16 server_modecount; /* Number of server MODEs this second */
- int16 chanserv_modecount; /* Number of check_mode()'s this sec */
- int16 bouncy_modes; /* Did we fail to set modes here? */
+ int16_t server_modecount; /* Number of server MODEs this second */
+ int16_t chanserv_modecount; /* Number of check_mode()'s this sec */
+ int16_t bouncy_modes; /* Did we fail to set modes here? */
/** Call if we need to unset all modes and clear all user status (internally).
* Only useful if we get a SJOIN with a TS older than what we have here
diff --git a/include/extern.h b/include/extern.h
index 83907224f..9a1583ec6 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -171,8 +171,8 @@ E bool nickIsServices(const Anope::string &nick, bool bot);
E void add_entropy_userkeys();
E void rand_init();
E unsigned char getrandom8();
-E uint16 getrandom16();
-E uint32 getrandom32();
+E uint16_t getrandom16();
+E uint32_t getrandom32();
E std::list<Anope::string> BuildStringList(const Anope::string &, char = ' ');
E std::vector<Anope::string> BuildStringVector(const Anope::string &, char = ' ');
@@ -208,14 +208,14 @@ E void notice_server(const Anope::string &source, const Server *s, const char *f
/**** sockets.cpp ****/
-E int32 TotalRead;
-E int32 TotalWritten;
+E int32_t TotalRead;
+E int32_t TotalWritten;
E SocketIO normalSocketIO;
/**** users.c ****/
-E int32 opcnt;
-E uint32 maxusercnt, usercnt;
+E int32_t opcnt;
+E uint32_t maxusercnt, usercnt;
E time_t maxusertime;
E User *finduser(const Anope::string &nick);
diff --git a/include/modules.h b/include/modules.h
index 376224097..695917dbf 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -594,7 +594,7 @@ class CoreExport Module : public Extensible
* @param priv The privilege changed
* @param what The new level
*/
- virtual void OnLevelChange(User *u, ChannelInfo *ci, const Anope::string &priv, int16 what) { }
+ virtual void OnLevelChange(User *u, ChannelInfo *ci, const Anope::string &priv, int16_t what) { }
/** Called when a channel is dropped
* @param chname The channel name
diff --git a/include/regchannel.h b/include/regchannel.h
index 680be5b44..62d3eeccc 100644
--- a/include/regchannel.h
+++ b/include/regchannel.h
@@ -152,7 +152,7 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag,
std::vector<ChanAccess *> access; /* List of authorized users */
std::vector<AutoKick *> akick; /* List of users to kickban */
std::vector<BadWord *> badwords; /* List of badwords */
- std::map<Anope::string, int16> levels;
+ std::map<Anope::string, int16_t> levels;
public:
typedef std::multimap<ChannelModeName, ModeLock> ModeList;
@@ -184,7 +184,7 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag,
Anope::string last_topic_setter; /* Setter */
time_t last_topic_time; /* Time */
- int16 bantype;
+ int16_t bantype;
MemoInfo memos;
@@ -193,11 +193,11 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag,
/* For BotServ */
BotInfo *bi; /* Bot used on this channel */
Flags<BotServFlag> botflags;
- int16 ttb[TTB_SIZE]; /* Times to ban for each kicker */
+ int16_t ttb[TTB_SIZE]; /* Times to ban for each kicker */
- int16 capsmin, capspercent; /* For CAPS kicker */
- int16 floodlines, floodsecs; /* For FLOOD kicker */
- int16 repeattimes; /* For REPEAT kicker */
+ int16_t capsmin, capspercent; /* For CAPS kicker */
+ int16_t floodlines, floodsecs; /* For FLOOD kicker */
+ int16_t repeattimes; /* For REPEAT kicker */
serialized_data serialize();
static void unserialize(serialized_data &);
@@ -377,7 +377,7 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag,
ModeLock *GetMLock(ChannelModeName mname, const Anope::string &param = "");
/** Get the current mode locks as a string
- * @param complete True to show mlock parameters aswell
+ * @param complete True to show mlock parameters aswell
* @return A string of mode locks, eg: +nrt
*/
Anope::string GetMLockAsString(bool complete) const;
@@ -393,7 +393,7 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag,
* the new topic in the ChannelInfo
*/
void CheckTopic();
-
+
/** Restore the channel topic, used on channel creation when not syncing with the uplink
* and after uplink sync
*/
@@ -404,13 +404,13 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag,
* @return the level
* @throws CoreException if priv is not a valid privilege
*/
- int16 GetLevel(const Anope::string &priv);
+ int16_t GetLevel(const Anope::string &priv);
/** Set the level for a privilege
* @param priv The privilege priv
* @param level The new level
*/
- void SetLevel(const Anope::string &priv, int16 level);
+ void SetLevel(const Anope::string &priv, int16_t level);
/** Remove a privilege from the channel
* @param priv The privilege
diff --git a/include/services.h b/include/services.h
index d34d858f1..6004532d1 100644
--- a/include/services.h
+++ b/include/services.h
@@ -551,7 +551,7 @@ class CoreExport Memo : public Flags<MemoFlag>, public Serializable<Memo>
struct CoreExport MemoInfo
{
- int16 memomax;
+ int16_t memomax;
std::vector<Memo *> memos;
std::vector<Anope::string> ignores;
diff --git a/include/sysconf.h.cmake b/include/sysconf.h.cmake
index ff391a7b1..8470f81c4 100644
--- a/include/sysconf.h.cmake
+++ b/include/sysconf.h.cmake
@@ -4,7 +4,7 @@
#cmakedefine DEBUG_BUILD
#cmakedefine DEFUMASK @DEFUMASK@
-#cmakedefine HAVE_SYS_TYPES_H 1
+#cmakedefine HAVE_CSTDINT 1
#cmakedefine HAVE_STDINT_H 1
#cmakedefine HAVE_STDDEF_H 1
#cmakedefine HAVE_SETGRENT 1
@@ -18,85 +18,17 @@
#cmakedefine GETTEXT_FOUND 1
#cmakedefine RUNGROUP "@RUNGROUP@"
-#cmakedefine HAVE_UINT8_T 1
-#cmakedefine HAVE_U_INT8_T 1
-#cmakedefine HAVE_INT16_T 1
-#cmakedefine HAVE_UINT16_T 1
-#cmakedefine HAVE_U_INT16_T 1
-#cmakedefine HAVE_INT32_T 1
-#cmakedefine HAVE_UINT32_T 1
-#cmakedefine HAVE_U_INT32_T 1
-
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#ifdef HAVE_STDDEF_H
-# include <stddef.h>
-#endif
-
-#ifdef HAVE_UINT8_T
-typedef uint8_t uint8;
-#else
-# ifdef HAVE_U_INT8_T
-typedef u_int8_t uint8;
-# else
-# ifdef _WIN32
-typedef unsigned __int8 uint8;
-# else
-typedef unsigned short uint8;
-# endif
-# endif
-#endif
-
-#ifdef HAVE_INT16_T
-typedef int16_t int16;
-#else
-# ifdef _WIN32
-typedef signed __int16 int16;
-# else
-typedef int int16;
-# endif
-#endif
-
-#ifdef HAVE_UINT16_T
-typedef uint16_t uint16;
-#else
-# ifdef HAVE_U_INT16_T
-typedef u_int16_t uint16;
-# else
-# ifdef _WIN32
-typedef unsigned __int16 uint16;
-# else
-typedef unsigned int uint16;
-# endif
-# endif
-#endif
-
-#ifdef HAVE_INT32_T
-typedef int32_t int32;
+#ifdef HAVE_CSTDINT
+# include <cstdint>
#else
-# ifdef _WIN32
-typedef signed __int32 int32;
+# ifdef HAVE_STDINT_H
+# include <stdint.h>
# else
-typedef long int32;
+# include "pstdint.h"
# endif
#endif
-
-#ifdef HAVE_UINT32_T
-typedef uint32_t uint32;
-#else
-# ifdef HAVE_U_INT32_T
-typedef u_int32_t uint32;
-# else
-# ifdef _WIN32
-typedef unsigned __int32 uint32;
-# else
-typedef unsigned long uint32;
-# endif
-# endif
+#ifdef HAVE_STDDEF_H
+# include <stddef.h>
#endif
#ifdef _WIN32
diff --git a/modules/commands/bs_kick.cpp b/modules/commands/bs_kick.cpp
index 2c41b4b90..b53510c10 100644
--- a/modules/commands/bs_kick.cpp
+++ b/modules/commands/bs_kick.cpp
@@ -58,7 +58,7 @@ class CommandBSKick : public Command
{
try
{
- ci->ttb[TTB_BADWORDS] = convertTo<int16>(ttb);
+ ci->ttb[TTB_BADWORDS] = convertTo<int16_t>(ttb);
if (ci->ttb[TTB_BADWORDS] < 0)
throw ConvertException();
}
@@ -96,7 +96,7 @@ class CommandBSKick : public Command
{
try
{
- ci->ttb[TTB_BOLDS] = convertTo<int16>(ttb);
+ ci->ttb[TTB_BOLDS] = convertTo<int16_t>(ttb);
if (ci->ttb[TTB_BOLDS] < 0)
throw ConvertException();
}
@@ -132,7 +132,7 @@ class CommandBSKick : public Command
{
try
{
- ci->ttb[TTB_CAPS] = convertTo<int16>(ttb);
+ ci->ttb[TTB_CAPS] = convertTo<int16_t>(ttb);
if (ci->ttb[TTB_CAPS] < 0)
throw ConvertException();
}
@@ -149,7 +149,7 @@ class CommandBSKick : public Command
ci->capsmin = 10;
try
{
- ci->capsmin = convertTo<int16>(min);
+ ci->capsmin = convertTo<int16_t>(min);
}
catch (const ConvertException &) { }
if (ci->capsmin < 1)
@@ -158,7 +158,7 @@ class CommandBSKick : public Command
ci->capspercent = 25;
try
{
- ci->capspercent = convertTo<int16>(percent);
+ ci->capspercent = convertTo<int16_t>(percent);
}
catch (const ConvertException &) { }
if (ci->capspercent < 1 || ci->capspercent > 100)
@@ -187,7 +187,7 @@ class CommandBSKick : public Command
{
try
{
- ci->ttb[TTB_COLORS] = convertTo<int16>(ttb);
+ ci->ttb[TTB_COLORS] = convertTo<int16_t>(ttb);
if (ci->ttb[TTB_COLORS] < 1)
throw ConvertException();
}
@@ -224,7 +224,7 @@ class CommandBSKick : public Command
{
try
{
- ci->ttb[TTB_FLOOD] = convertTo<int16>(ttb);
+ ci->ttb[TTB_FLOOD] = convertTo<int16_t>(ttb);
if (ci->ttb[TTB_FLOOD] < 1)
throw ConvertException();
}
@@ -241,7 +241,7 @@ class CommandBSKick : public Command
ci->floodlines = 6;
try
{
- ci->floodlines = convertTo<int16>(lines);
+ ci->floodlines = convertTo<int16_t>(lines);
}
catch (const ConvertException &) { }
if (ci->floodlines < 2)
@@ -250,7 +250,7 @@ class CommandBSKick : public Command
ci->floodsecs = 10;
try
{
- ci->floodsecs = convertTo<int16>(secs);
+ ci->floodsecs = convertTo<int16_t>(secs);
}
catch (const ConvertException &) { }
if (ci->floodsecs < 1)
@@ -280,7 +280,7 @@ class CommandBSKick : public Command
{
try
{
- ci->ttb[TTB_REPEAT] = convertTo<int16>(ttb);
+ ci->ttb[TTB_REPEAT] = convertTo<int16_t>(ttb);
if (ci->ttb[TTB_REPEAT] < 0)
throw ConvertException();
}
@@ -297,7 +297,7 @@ class CommandBSKick : public Command
ci->repeattimes = 3;
try
{
- ci->repeattimes = convertTo<int16>(times);
+ ci->repeattimes = convertTo<int16_t>(times);
}
catch (const ConvertException &) { }
if (ci->repeattimes < 2)
@@ -326,7 +326,7 @@ class CommandBSKick : public Command
{
try
{
- ci->ttb[TTB_REVERSES] = convertTo<int16>(ttb);
+ ci->ttb[TTB_REVERSES] = convertTo<int16_t>(ttb);
if (ci->ttb[TTB_REVERSES] < 0)
throw ConvertException();
}
@@ -359,7 +359,7 @@ class CommandBSKick : public Command
{
try
{
- ci->ttb[TTB_UNDERLINES] = convertTo<int16>(ttb);
+ ci->ttb[TTB_UNDERLINES] = convertTo<int16_t>(ttb);
if (ci->ttb[TTB_REVERSES] < 0)
throw ConvertException();
}
@@ -393,7 +393,7 @@ class CommandBSKick : public Command
{
try
{
- ci->ttb[TTB_ITALICS] = convertTo<int16>(ttb);
+ ci->ttb[TTB_ITALICS] = convertTo<int16_t>(ttb);
if (ci->ttb[TTB_ITALICS] < 0)
throw ConvertException();
}
@@ -427,7 +427,7 @@ class CommandBSKick : public Command
{
try
{
- ci->ttb[TTB_AMSGS] = convertTo<int16>(ttb);
+ ci->ttb[TTB_AMSGS] = convertTo<int16_t>(ttb);
if (ci->ttb[TTB_AMSGS] < 0)
throw ConvertException();
}
@@ -583,7 +583,7 @@ struct BanData : public ExtensibleItem
{
Anope::string mask;
time_t last_use;
- int16 ttb[TTB_SIZE];
+ int16_t ttb[TTB_SIZE];
Data()
{
@@ -648,13 +648,13 @@ struct UserData : public ExtensibleItem
time_t last_use;
/* for flood kicker */
- int16 lines;
+ int16_t lines;
time_t last_start;
/* for repeat kicker */
Anope::string lastline;
Anope::string lasttarget;
- int16 times;
+ int16_t times;
void OnDelete()
{
@@ -675,7 +675,7 @@ class BanDataPurger : public CallBack
for (channel_map::iterator it = ChannelList.begin(), it_end = ChannelList.end(); it != it_end; ++it)
{
Channel *c = it->second;
-
+
BanData *bd = c->GetExt<BanData *>("bs_main_bandata");
if (bd != NULL)
{
@@ -863,7 +863,7 @@ class BSKick : public Module
if (ci->botflags.HasFlag(BS_KICK_CAPS) && realbuf.length() >= ci->capsmin)
{
int i = 0, l = 0;
-
+
for (unsigned j = 0, end = realbuf.length(); j < end; ++j)
{
if (isupper(realbuf[j]))
@@ -884,7 +884,7 @@ class BSKick : public Module
return;
}
}
-
+
/* Bad words kicker */
if (ci->botflags.HasFlag(BS_KICK_BADWORDS))
{
@@ -962,7 +962,7 @@ class BSKick : public Module
}
UserData *ud = NULL;
-
+
/* Flood kicker */
if (ci->botflags.HasFlag(BS_KICK_FLOOD))
{
diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp
index 3e737b709..7cfbb303d 100644
--- a/modules/commands/cs_access.cpp
+++ b/modules/commands/cs_access.cpp
@@ -19,12 +19,12 @@ enum
ACCESS_FOUNDER = 10001
};
-static std::map<Anope::string, int16, std::less<ci::string> > defaultLevels;
+static std::map<Anope::string, int16_t, std::less<ci::string> > defaultLevels;
static void reset_levels(ChannelInfo *ci)
{
ci->ClearLevels();
- for (std::map<Anope::string, int16, std::less<ci::string> >::iterator it = defaultLevels.begin(), it_end = defaultLevels.end(); it != it_end; ++it)
+ for (std::map<Anope::string, int16_t, std::less<ci::string> >::iterator it = defaultLevels.begin(), it_end = defaultLevels.end(); it != it_end; ++it)
ci->SetLevel(it->first, it->second);
}
@@ -286,7 +286,7 @@ class CommandCSAccess : public Command
Anope::string mask = params[2];
int level = ACCESS_INVALID;
-
+
try
{
level = convertTo<int>(params[3]);
@@ -736,7 +736,7 @@ class CommandCSLevels : public Command
for (unsigned i = 0; i < privs.size(); ++i)
{
const Privilege &p = privs[i];
- int16 j = ci->GetLevel(p.name);
+ int16_t j = ci->GetLevel(p.name);
if (j == ACCESS_INVALID)
source.Reply(_(" %-*s (disabled)"), levelinfo_maxwidth, p.name.c_str());
@@ -918,7 +918,7 @@ class CSAccess : public Module
if (group->ci == NULL)
return EVENT_CONTINUE;
/* Special case. Allows a level of < 0 to match anyone, and a level of 0 to match anyone identified. */
- int16 level = group->ci->GetLevel(priv);
+ int16_t level = group->ci->GetLevel(priv);
if (level < 0)
return EVENT_ALLOW;
else if (level == 0 && group->nc)
diff --git a/modules/commands/cs_set_bantype.cpp b/modules/commands/cs_set_bantype.cpp
index afc15963b..90c94b5a4 100644
--- a/modules/commands/cs_set_bantype.cpp
+++ b/modules/commands/cs_set_bantype.cpp
@@ -40,7 +40,7 @@ class CommandCSSetBanType : public Command
try
{
- int16 new_type = convertTo<int16>(params[1]);
+ int16_t new_type = convertTo<int16_t>(params[1]);
if (new_type < 0 || new_type > 3)
throw ConvertException("Invalid range");
ci->bantype = new_type;
diff --git a/modules/commands/ms_set.cpp b/modules/commands/ms_set.cpp
index ef3480fd5..7ce1960ed 100644
--- a/modules/commands/ms_set.cpp
+++ b/modules/commands/ms_set.cpp
@@ -75,7 +75,7 @@ class CommandMSSet : public Command
Anope::string p2 = params.size() > 2 ? params[2] : "";
Anope::string p3 = params.size() > 3 ? params[3] : "";
Anope::string user, chan;
- int16 limit;
+ int16_t limit;
NickCore *nc = u->Account();
ChannelInfo *ci = NULL;
bool is_servadmin = u->HasPriv("memoserv/set-limit");
@@ -136,7 +136,7 @@ class CommandMSSet : public Command
limit = -1;
try
{
- limit = convertTo<int16>(p1);
+ limit = convertTo<int16_t>(p1);
}
catch (const ConvertException &) { }
}
@@ -160,7 +160,7 @@ class CommandMSSet : public Command
limit = -1;
try
{
- limit = convertTo<int16>(p1);
+ limit = convertTo<int16_t>(p1);
}
catch (const ConvertException &) { }
/* The first character is a digit, but we could still go negative
diff --git a/modules/database/db_old.cpp b/modules/database/db_old.cpp
index 440713a6e..92a108673 100644
--- a/modules/database/db_old.cpp
+++ b/modules/database/db_old.cpp
@@ -295,7 +295,7 @@ void close_db(dbFILE *f)
delete f;
}
-static int read_int16(int16 *ret, dbFILE *f)
+static int read_int16(int16_t *ret, dbFILE *f)
{
int c1, c2;
@@ -309,7 +309,7 @@ static int read_int16(int16 *ret, dbFILE *f)
return 0;
}
-static int read_uint16(uint16 *ret, dbFILE *f)
+static int read_uint16(uint16_t *ret, dbFILE *f)
{
int c1, c2;
@@ -326,7 +326,7 @@ static int read_uint16(uint16 *ret, dbFILE *f)
static int read_string(Anope::string &str, dbFILE *f)
{
str.clear();
- uint16 len;
+ uint16_t len;
if (read_uint16(&len, f) < 0)
return -1;
@@ -343,7 +343,7 @@ static int read_string(Anope::string &str, dbFILE *f)
return 0;
}
-static int read_uint32(uint32 *ret, dbFILE *f)
+static int read_uint32(uint32_t *ret, dbFILE *f)
{
int c1, c2, c3, c4;
@@ -359,7 +359,7 @@ static int read_uint32(uint32 *ret, dbFILE *f)
return 0;
}
-int read_int32(int32 *ret, dbFILE *f)
+int read_int32(int32_t *ret, dbFILE *f)
{
int c1, c2, c3, c4;
@@ -402,7 +402,7 @@ static void LoadNicks()
READ(read_string(buffer, f));
nc->greet = buffer;
- uint32 uint;
+ uint32_t uint;
READ(read_uint32(&uint, f));
//nc->icq = uint;
@@ -445,7 +445,7 @@ static void LoadNicks()
if (uint & OLD_NI_NOEXPIRE)
nc->Extend("noexpire", NULL);
- uint16 u16;
+ uint16_t u16;
READ(read_uint16(&u16, f));
switch (u16)
{
@@ -494,22 +494,22 @@ static void LoadNicks()
}
READ(read_uint16(&u16, f));
- for (uint16 j = 0; j < u16; ++j)
+ for (uint16_t j = 0; j < u16; ++j)
{
READ(read_string(buffer, f));
nc->access.push_back(buffer);
}
- int16 i16;
+ int16_t i16;
READ(read_int16(&i16, f));
READ(read_int16(&nc->memos.memomax, f));
- for (int16 j = 0; j < i16; ++j)
+ for (int16_t j = 0; j < i16; ++j)
{
Memo *m = new Memo;
READ(read_uint32(&uint, f));
- uint16 flags;
+ uint16_t flags;
READ(read_uint16(&flags, f));
- int32 tmp32;
+ int32_t tmp32;
READ(read_int32(&tmp32, f));
m->time = tmp32;
char sbuf[32];
@@ -523,7 +523,7 @@ static void LoadNicks()
Log(LOG_DEBUG) << "Loaded NickCore " << nc->display;
}
-
+
for (int i = 0; i < 1024; ++i)
for (int c; (c = getc_db(f)) == 1;)
{
@@ -535,13 +535,13 @@ static void LoadNicks()
READ(read_string(last_realname, f));
READ(read_string(last_quit, f));
- int32 tmp32;
+ int32_t tmp32;
READ(read_int32(&tmp32, f));
time_registered = tmp32;
READ(read_int32(&tmp32, f));
last_seen = tmp32;
- uint16 tmpu16;
+ uint16_t tmpu16;
READ(read_uint16(&tmpu16, f));
Anope::string core;
READ(read_string(core, f));
@@ -563,7 +563,7 @@ static void LoadNicks()
Log(LOG_DEBUG) << "Loaded NickAlias " << na->nick;
}
-
+
close_db(f); /* End of section Ia */
}
@@ -576,7 +576,7 @@ static void LoadVHosts()
for (int c; (c = getc_db(f)) == 1;)
{
Anope::string nick, ident, host, creator;
- int32 vtime;
+ int32_t vtime;
READ(read_string(nick, f));
READ(read_string(ident, f));
@@ -595,7 +595,7 @@ static void LoadVHosts()
Log() << "Loaded vhost for " << na->nick;
}
-
+
close_db(f);
}
@@ -608,8 +608,8 @@ static void LoadBots()
for (int c; (c = getc_db(f)) == 1;)
{
Anope::string nick, user, host, real;
- int16 flags, chancount;
- int32 created;
+ int16_t flags, chancount;
+ int32_t created;
READ(read_string(nick, f));
READ(read_string(user, f));
@@ -659,7 +659,7 @@ static void LoadChannels()
READ(read_string(buffer, f));
READ(read_string(buffer, f));
- int32 tmp32;
+ int32_t tmp32;
READ(read_int32(&tmp32, f));
ci->time_registered = tmp32;
@@ -674,7 +674,7 @@ static void LoadChannels()
READ(read_int32(&tmp32, f));
ci->last_topic_time = tmp32;
- uint32 tmpu32;
+ uint32_t tmpu32;
READ(read_uint32(&tmpu32, f));
// Temporary flags cleanup
tmpu32 &= ~0x80000000;
@@ -708,26 +708,26 @@ static void LoadChannels()
READ(read_string(buffer, f));
READ(read_string(buffer, f));
- int16 tmp16;
+ int16_t tmp16;
READ(read_int16(&tmp16, f));
ci->bantype = tmp16;
READ(read_int16(&tmp16, f));
if (tmp16 > 36)
tmp16 = 36;
- for (int16 j = 0; j < tmp16; ++j)
+ for (int16_t j = 0; j < tmp16; ++j)
{
- int16 level;
+ int16_t level;
READ(read_int16(&level, f));
ci->SetLevel(GetLevelName(j), level);
}
- uint16 tmpu16;
+ uint16_t tmpu16;
READ(read_uint16(&tmpu16, f));
- for (uint16 j = 0; j < tmpu16; ++j)
+ for (uint16_t j = 0; j < tmpu16; ++j)
{
- uint16 in_use;
+ uint16_t in_use;
READ(read_uint16(&in_use, f));
if (in_use)
{
@@ -738,7 +738,7 @@ static void LoadChannels()
ChanAccess *access = provider->Create();
access->ci = ci;
- int16 level;
+ int16_t level;
READ(read_int16(&level, f));
access->Unserialize(stringify(level));
@@ -756,9 +756,9 @@ static void LoadChannels()
}
READ(read_uint16(&tmpu16, f));
- for (uint16 j = 0; j < tmpu16; ++j)
+ for (uint16_t j = 0; j < tmpu16; ++j)
{
- uint16 flags;
+ uint16_t flags;
READ(read_uint16(&flags, f));
if (flags & 0x0001)
{
@@ -781,7 +781,7 @@ static void LoadChannels()
READ(read_int16(&tmp16, f));
READ(read_int16(&ci->memos.memomax, f));
- for (int16 j = 0; j < tmp16; ++j)
+ for (int16_t j = 0; j < tmp16; ++j)
{
READ(read_uint32(&tmpu32, f));
READ(read_uint16(&tmpu16, f));
@@ -829,9 +829,9 @@ static void LoadChannels()
ci->botflags.SetFlag(BS_KICK_REPEAT);
READ(read_int16(&tmp16, f));
- for (int16 j = 0; j < tmp16; ++j)
+ for (int16_t j = 0; j < tmp16; ++j)
{
- int16 ttb;
+ int16_t ttb;
READ(read_int16(&ttb, f));
if (j < TTB_SIZE)
ci->ttb[j] = ttb;
@@ -849,14 +849,14 @@ static void LoadChannels()
ci->repeattimes = tmp16;
READ(read_uint16(&tmpu16, f));
- for (uint16 j = 0; j < tmpu16; ++j)
+ for (uint16_t j = 0; j < tmpu16; ++j)
{
- uint16 in_use;
+ uint16_t in_use;
READ(read_uint16(&in_use, f));
if (in_use)
{
READ(read_string(buffer, f));
- uint16 type;
+ uint16_t type;
READ(read_uint16(&type, f));
BadWordType bwtype = BW_ANY;
@@ -873,7 +873,7 @@ static void LoadChannels()
Log(LOG_DEBUG) << "Loaded channel " << ci->name;
}
-
+
close_db(f);
}
@@ -882,7 +882,7 @@ static void LoadOper()
dbFILE *f = open_db_read("OperServ",