Committer : entrope
CVSROOT : /cvsroot/undernet-ircu
Module : ircu2.10
Commit time: 2007-12-06 05:07:42 UTC
Modified files:
ChangeLog include/dbuf.h include/ircd_crypt.h
include/ircd_features.h include/res.h ircd/channel.c ircd/class.c
ircd/dbuf.c ircd/engine_poll.c ircd/gline.c ircd/ircd_events.c
ircd/ircd_features.c ircd/ircd_parser.y ircd/ircd_snprintf.c
ircd/m_cap.c ircd/m_join.c ircd/m_nick.c ircd/m_server.c
ircd/msgq.c ircd/numnicks.c ircd/s_bsd.c ircd/s_debug.c
ircd/s_misc.c ircd/s_user.c ircd/uping.c ircd/whowas.c
Log message:
Quash gcc's warnings with -Wall -Wextra -Wno-unused
-Wno-missing-field-initializers.
Practically all of these were signedness mismatches, and all look harmless
except possibly for the ircd_in_addr_valid() one.
---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.845 ircu2.10/ChangeLog:1.846
--- ircu2.10/ChangeLog:1.845 Tue Dec 4 20:13:59 2007
+++ ircu2.10/ChangeLog Wed Dec 5 21:07:31 2007
@@ -1,3 +1,106 @@
+2007-12-05 Michael Poole <[EMAIL PROTECTED]>
+
+ * include/dbuf.h (DBufAllocCount): Make unsigned.
+ (DBufUsedCount): Likewise.
+
+ * include/ircd_crypt.h (crypt_token_size): Make unsigned.
+
+ * include/ircd_features.h (feature_uint): Declare new function.
+
+ * include/res.h (irc_in_addr_valid): Since in6_16[0] is unsigned
+ short, bitwise not could happen after extension to signed int,
+ which would give us undesired results. Compare to 65535 instead.
+
+ * ircd/channel.c (add_invite): Make max and count unsigned.
+ (modebuf_extract): Make i and len unsigned.
+ (joinbuf_flush): Make i unsigned.
+
+ * ircd/class.c (init_class): Use feature_uint() to retrieve
+ the value of FEAT_DEFAULTMAXSENDQLENGTH.
+ (add_class): Likewise.
+ (get_sendq): Likewise.
+
+ * ircd/dbuf.c (DBufAllocCount): Make unsigned.
+ (DBufUsedCount): Make unsigned.
+ (dbuf_alloc): Use feature_uint() for FEAT_BUFFERPOOL.
+
+ * ircd/engine_poll.c (engine_add): Make i unsigned.
+ (engine_loop): Likewise.
+
+ * ircd/gline.c (count_realnames): Cast minlen to unsigned for
+ comparison. Should be safe since it comes from matchcomp().
+ (gline_add): Cast the result of ircd_snprintf() to unsigned.
+ Should be safe since negative numbers will exceed sizeof(uhmask).
+
+ * ircd/ircd_events.c (gen_flags): Give loc type size_t.
+ (sock_flags): Likewise.
+
+ * ircd/ircd_features.c (set_isupport_maxchannels): Use
+ feature_uint() for FEAT_MAXCHANNELSPERUSER.
+ (set_isupport_nicklen): Likewise for FEAT_NICKLEN.
+ (set_isupport_channellen): Likewise for FEAT_CHANNELLEN.
+ (FEAT_UINT): New value.
+ (F_U): New helper macro.
+ (features): Use F_U instead of F_I for FEAT_BUFFERPOOL,
+ FEAT_CLIENT_FLOOD, FEAT_NICKNAMEHISTORYLENGTH, FEAT_NICKLEN,
+ FEAT_MAXCHANNELSPERUSER, FEAT_DEFAULTMAXSENDQLENGTH and
+ FEAT_CHANNELLEN.
+ (feature_set): Handle FEAT_UINT case.
+ (feature_reset): Likewise.
+ (feature_get): Likewise.
+ (feature_mark): Likewise.
+ (feature_init): Likewise.
+ (feature_report): Likewise.
+ (feature_uint): New function.
+
+ * ircd/ircd_parser.y (generalnumeric): Typecast the number as
+ unsigned int.
+ (featureitem): Make ii signed.
+ (includeblock): Make the ~0 unsigned long to match cb_allowed.
+
+ * ircd/ircd_snprintf.c (PAD_LENGTH): Make signed.
+
+ * ircd/m_cap.c (send_caplist): Make i and loc unsigned.
+
+ * ircd/m_join.c (m_join): Use feature_uint() to retrieve the value
+ of FEAT_MAXCHANNELSPERUSER.
+
+ * ircd/m_nick.c (m_nick): Likewise for FEAT_NICKLEN.
+
+ * ircd/m_server.c (check_loop_and_lh): Make hop unsigned.
+ (mr_server): Likewise.
+
+ * ircd/msgq.c (bufsize): Make result unsigned.
+ (msgq_alloc): Make power unsigned. Use feature_uint() to retrieve
+ the value of FEAT_BUFFERPOOL.
+
+ * ircd/numnicks.c (markMatchexServer): Make i unsigned.
+ (find_match_server): Likewise.
+
+ * ircd/s_bsd.c (read_packet): Use feature_uint() to retrieve the
+ value of FEAT_CLIENT_FLOOD.
+
+ * ircd/s_debug.c (debug_serveropts): Make bp unsigned. Use
+ feature_uint() to retrieve the value of FEAT_BUFFERPOOL.
+ (send_usage): Fix format string for dbufs.
+ (count_memory): Use feature_uint() to retrieve the value of
+ FEAT_NICKNAMEHISTORYLENGTH. Fix format string for whowas array
+ dimension and dbuf counts.
+
+ * ircd/s_misc.c (exit_downlinks): Make i unsigned.
+
+ * ircd/s_user.c (set_user_mode): Make i unsigned.
+ (umode_str): Likewise.
+ (send_umode): Likewise.
+ (build_isupport_lines): Use feature_uint() to retrieve the value
+ of FEAT_NICKLEN.
+
+ * ircd/uping.c (uping_read): Make pingtime type time_t.
+ Typecast it before passing it to sprintf().
+
+ * ircd/whowas.c (whowas_alloc): Use feature_uint() to retrieve the
+ value of FEAT_NICKNAMEHISTORYLENGTH. Fix format string to match.
+
2007-12-03 Michael Poole <[EMAIL PROTECTED]>
* doc/Makefile.in (DATAROOTDIR): Define.
Index: ircu2.10/include/dbuf.h
diff -u ircu2.10/include/dbuf.h:1.8 ircu2.10/include/dbuf.h:1.9
--- ircu2.10/include/dbuf.h:1.8 Fri Jan 6 03:22:29 2006
+++ ircu2.10/include/dbuf.h Wed Dec 5 21:07:31 2007
@@ -18,7 +18,7 @@
*/
/** @file
* @brief Interfaces and declarations for dealing with data buffers.
- * @version $Id: dbuf.h,v 1.8 2006/01/06 11:22:29 isomer Exp $
+ * @version $Id: dbuf.h,v 1.9 2007/12/06 05:07:31 entrope Exp $
*/
#ifndef INCLUDED_dbuf_h
#define INCLUDED_dbuf_h
@@ -30,8 +30,8 @@
/*
* These two globals should be considered read only
*/
-extern int DBufAllocCount;
-extern int DBufUsedCount;
+extern unsigned int DBufAllocCount;
+extern unsigned int DBufUsedCount;
struct DBufBuffer;
Index: ircu2.10/include/ircd_crypt.h
diff -u ircu2.10/include/ircd_crypt.h:1.3 ircu2.10/include/ircd_crypt.h:1.4
--- ircu2.10/include/ircd_crypt.h:1.3 Sun Nov 7 13:04:58 2004
+++ ircu2.10/include/ircd_crypt.h Wed Dec 5 21:07:31 2007
@@ -18,7 +18,7 @@
*/
/** @file
* @brief Core password encryption and hashing APIs.
- * @version $Id: ircd_crypt.h,v 1.3 2004/11/07 21:04:58 entrope Exp $
+ * @version $Id: ircd_crypt.h,v 1.4 2007/12/06 05:07:31 entrope Exp $
*/
#ifndef INCLUDED_ircd_crypt_h
#define INCLUDED_ircd_crypt_h
@@ -35,7 +35,7 @@
char* crypt_token; /* what identifies a password string
as belonging to this mechanism */
- int crypt_token_size; /* how long is the token */
+ unsigned int crypt_token_size; /* how long is the token */
};
typedef struct crypt_mech_s crypt_mech_t;
Index: ircu2.10/include/ircd_features.h
diff -u ircu2.10/include/ircd_features.h:1.47
ircu2.10/include/ircd_features.h:1.48
--- ircu2.10/include/ircd_features.h:1.47 Tue Dec 4 20:13:59 2007
+++ ircu2.10/include/ircd_features.h Wed Dec 5 21:07:31 2007
@@ -20,7 +20,7 @@
*/
/** @file
* @brief Public interfaces and declarations for dealing with configurable
features.
- * @version $Id: ircd_features.h,v 1.47 2007/12/05 04:13:59 entrope Exp $
+ * @version $Id: ircd_features.h,v 1.48 2007/12/06 05:07:31 entrope Exp $
*/
struct Client;
@@ -210,5 +210,6 @@
extern int feature_int(enum Feature feat);
extern int feature_bool(enum Feature feat);
extern const char *feature_str(enum Feature feat);
+extern unsigned int feature_uint(enum Feature feat);
#endif /* INCLUDED_features_h */
Index: ircu2.10/include/res.h
diff -u ircu2.10/include/res.h:1.21 ircu2.10/include/res.h:1.22
--- ircu2.10/include/res.h:1.21 Tue Dec 4 20:13:59 2007
+++ ircu2.10/include/res.h Wed Dec 5 21:07:31 2007
@@ -1,6 +1,6 @@
/** @file
* @brief IRC resolver API.
- * @version $Id: res.h,v 1.21 2007/12/05 04:13:59 entrope Exp $
+ * @version $Id: res.h,v 1.22 2007/12/06 05:07:31 entrope Exp $
*/
#ifndef INCLUDED_res_h
@@ -128,7 +128,7 @@
&& ((ADDR)->in6_16[5] == 0 \
|| (ADDR)->in6_16[5] == 65535))
/** Evaluate to non-zero if \a ADDR is a valid address (not all 0s and not all
1s). */
-#define irc_in_addr_valid(ADDR) (((ADDR)->in6_16[0] && ~(ADDR)->in6_16[0]) \
+#define irc_in_addr_valid(ADDR) (((ADDR)->in6_16[0] && ((ADDR)->in6_16[0] !=
65535)) \
|| (ADDR)->in6_16[1] != (ADDR)->in6_16[0] \
|| (ADDR)->in6_16[2] != (ADDR)->in6_16[0] \
|| (ADDR)->in6_16[3] != (ADDR)->in6_16[0] \
Index: ircu2.10/ircd/channel.c
diff -u ircu2.10/ircd/channel.c:1.178 ircu2.10/ircd/channel.c:1.179
--- ircu2.10/ircd/channel.c:1.178 Tue Dec 4 20:14:00 2007
+++ ircu2.10/ircd/channel.c Wed Dec 5 21:07:31 2007
@@ -19,7 +19,7 @@
*/
/** @file
* @brief Channel management and maintenance
- * @version $Id: channel.c,v 1.178 2007/12/05 04:14:00 entrope Exp $
+ * @version $Id: channel.c,v 1.179 2007/12/06 05:07:31 entrope Exp $
*/
#include "config.h"
@@ -1277,8 +1277,8 @@
{
struct Invite **uprev = &cli_user(cptr)->invited;
struct Invite *inv;
- int max = feature_int(FEAT_MAXCHANNELSPERUSER);
- int count = 0;
+ unsigned int max = feature_uint(FEAT_MAXCHANNELSPERUSER);
+ unsigned int count = 0;
/* See if the user is already invited. */
while ((inv = *uprev) != NULL)
@@ -2098,8 +2098,8 @@
MODE_DELJOINS, 'D',
0x0, 0x0
};
- unsigned int add;
- int i, bufpos = 0, len;
+ unsigned int add, i, len;
+ int bufpos = 0;
int *flag_p;
char *key = 0, limitbuf[20];
char *apass = 0, *upass = 0;
@@ -3537,7 +3537,7 @@
{
char chanlist[BUFSIZE];
int chanlist_i = 0;
- int i;
+ unsigned int i;
if (!jbuf->jb_count || jbuf->jb_type == JOINBUF_TYPE_PARTALL ||
jbuf->jb_type == JOINBUF_TYPE_JOIN)
Index: ircu2.10/ircd/class.c
diff -u ircu2.10/ircd/class.c:1.38 ircu2.10/ircd/class.c:1.39
--- ircu2.10/ircd/class.c:1.38 Fri Jan 6 03:22:31 2006
+++ ircu2.10/ircd/class.c Wed Dec 5 21:07:31 2007
@@ -18,7 +18,7 @@
*/
/** @file
* @brief Implementation of connection class handling functions.
- * @version $Id: class.c,v 1.38 2006/01/06 11:22:31 isomer Exp $
+ * @version $Id: class.c,v 1.39 2007/12/06 05:07:31 entrope Exp $
*/
#include "config.h"
@@ -103,7 +103,7 @@
PingFreq(connClassList) = feature_int(FEAT_PINGFREQUENCY);
ConFreq(connClassList) = feature_int(FEAT_CONNECTFREQUENCY);
MaxLinks(connClassList) = feature_int(FEAT_MAXIMUM_LINKS);
- MaxSendq(connClassList) = feature_int(FEAT_DEFAULTMAXSENDQLENGTH);
+ MaxSendq(connClassList) = feature_uint(FEAT_DEFAULTMAXSENDQLENGTH);
connClassList->valid = 1;
Links(connClassList) = 1;
}
@@ -226,7 +226,7 @@
PingFreq(p) = ping;
MaxLinks(p) = maxli;
MaxSendq(p) = (sendq > 0U) ?
- sendq : feature_int(FEAT_DEFAULTMAXSENDQLENGTH);
+ sendq : feature_uint(FEAT_DEFAULTMAXSENDQLENGTH);
p->valid = 1;
}
@@ -291,7 +291,7 @@
}
}
}
- return feature_int(FEAT_DEFAULTMAXSENDQLENGTH);
+ return feature_uint(FEAT_DEFAULTMAXSENDQLENGTH);
}
/** Report connection class memory statistics to a client.
Index: ircu2.10/ircd/dbuf.c
diff -u ircu2.10/ircd/dbuf.c:1.14 ircu2.10/ircd/dbuf.c:1.15
--- ircu2.10/ircd/dbuf.c:1.14 Fri Jan 6 03:22:31 2006
+++ ircu2.10/ircd/dbuf.c Wed Dec 5 21:07:31 2007
@@ -18,7 +18,7 @@
*/
/** @file
* @brief Implementation of functions dealing with data buffers.
- * @version $Id: dbuf.c,v 1.14 2006/01/06 11:22:31 isomer Exp $
+ * @version $Id: dbuf.c,v 1.15 2007/12/06 05:07:31 entrope Exp $
*/
#include "config.h"
@@ -44,11 +44,11 @@
/** Number of dbufs allocated.
* This should only be modified by dbuf.c.
*/
-int DBufAllocCount = 0;
+unsigned int DBufAllocCount = 0;
/** Number of dbufs in use.
* This should only be modified by dbuf.c.
*/
-int DBufUsedCount = 0;
+unsigned int DBufUsedCount = 0;
/** List of allocated but unused DBuf structures. */
static struct DBufBuffer *dbufFreeList = 0;
@@ -89,7 +89,7 @@
dbufFreeList = db->next;
++DBufUsedCount;
}
- else if (DBufAllocCount * DBUF_SIZE < feature_int(FEAT_BUFFERPOOL)) {
+ else if (DBufAllocCount * DBUF_SIZE < feature_uint(FEAT_BUFFERPOOL)) {
db = (struct DBufBuffer*) MyMalloc(sizeof(struct DBufBuffer));
assert(0 != db);
++DBufAllocCount;
Index: ircu2.10/ircd/engine_poll.c
diff -u ircu2.10/ircd/engine_poll.c:1.10 ircu2.10/ircd/engine_poll.c:1.11
--- ircu2.10/ircd/engine_poll.c:1.10 Fri Dec 10 21:13:44 2004
+++ ircu2.10/ircd/engine_poll.c Wed Dec 5 21:07:31 2007
@@ -18,7 +18,7 @@
*/
/** @file
* @brief POSIX poll() event engine.
- * @version $Id: engine_poll.c,v 1.10 2004/12/11 05:13:44 klmitch Exp $
+ * @version $Id: engine_poll.c,v 1.11 2007/12/06 05:07:31 entrope Exp $
*/
#include "config.h"
@@ -168,7 +168,7 @@
static int
engine_add(struct Socket* sock)
{
- int i;
+ unsigned int i;
assert(0 != sock);
@@ -276,7 +276,7 @@
{
int wait;
int nfds;
- int i;
+ unsigned int i;
int errcode;
socklen_t codesize;
struct Socket *sock;
Index: ircu2.10/ircd/gline.c
diff -u ircu2.10/ircd/gline.c:1.67 ircu2.10/ircd/gline.c:1.68
--- ircu2.10/ircd/gline.c:1.67 Tue Dec 4 20:14:00 2007
+++ ircu2.10/ircd/gline.c Wed Dec 5 21:07:31 2007
@@ -19,7 +19,7 @@
*/
/** @file
* @brief Implementation of Gline manipulation functions.
- * @version $Id: gline.c,v 1.67 2007/12/05 04:14:00 entrope Exp $
+ * @version $Id: gline.c,v 1.68 2007/12/06 05:07:31 entrope Exp $
*/
#include "config.h"
@@ -140,7 +140,7 @@
for (acptr = GlobalClientList; acptr; acptr = cli_next(acptr)) {
if (!IsUser(acptr))
continue;
- if (strlen(cli_info(acptr)) < minlen)
+ if (strlen(cli_info(acptr)) < (unsigned int)minlen)
continue;
if (!matchexec(cli_info(acptr), cmask, minlen))
count++;
@@ -461,7 +461,7 @@
} else {
canon_userhost(userhost, &user, &host, "*");
if (sizeof(uhmask) <
- ircd_snprintf(0, uhmask, sizeof(uhmask), "[EMAIL PROTECTED]", user,
host))
+ (unsigned int)ircd_snprintf(0, uhmask, sizeof(uhmask), "[EMAIL
PROTECTED]", user, host))
return send_reply(sptr, ERR_LONGMASK);
else if (MyUser(sptr) || (IsUser(sptr) && flags & GLINE_LOCAL)) {
switch (gline_checkmask(host)) {
Index: ircu2.10/ircd/ircd_events.c
diff -u ircu2.10/ircd/ircd_events.c:1.13 ircu2.10/ircd/ircd_events.c:1.14
--- ircu2.10/ircd/ircd_events.c:1.13 Tue Dec 4 20:14:00 2007
+++ ircu2.10/ircd/ircd_events.c Wed Dec 5 21:07:31 2007
@@ -18,7 +18,7 @@
*/
/** @file
* @brief Implementation of event loop mid-layer.
- * @version $Id: ircd_events.c,v 1.13 2007/12/05 04:14:00 entrope Exp $
+ * @version $Id: ircd_events.c,v 1.14 2007/12/06 05:07:31 entrope Exp $
*/
#include "config.h"
@@ -870,7 +870,8 @@
const char*
gen_flags(unsigned int flags)
{
- int i, loc = 0;
+ size_t loc = 0;
+ int i;
static char buf[256];
NS(unsigned int) map[] = {
NM(GEN_DESTROY),
@@ -902,7 +903,8 @@
const char*
sock_flags(unsigned int flags)
{
- int i, loc = 0;
+ size_t loc = 0;
+ int i;
static char buf[256];
NS(unsigned int) map[] = {
NM(SOCK_EVENT_READABLE),
Index: ircu2.10/ircd/ircd_features.c
diff -u ircu2.10/ircd/ircd_features.c:1.63 ircu2.10/ircd/ircd_features.c:1.64
--- ircu2.10/ircd/ircd_features.c:1.63 Tue Dec 4 20:14:00 2007
+++ ircu2.10/ircd/ircd_features.c Wed Dec 5 21:07:31 2007
@@ -18,7 +18,7 @@
*/
/** @file
* @brief Implementation of configurable feature support.
- * @version $Id: ircd_features.c,v 1.63 2007/12/05 04:14:00 entrope Exp $
+ * @version $Id: ircd_features.c,v 1.64 2007/12/06 05:07:31 entrope Exp $
*/
#include "config.h"
@@ -216,7 +216,7 @@
static void
set_isupport_maxchannels(void)
{
- add_isupport_i("MAXCHANNELS", feature_int(FEAT_MAXCHANNELSPERUSER));
+ add_isupport_i("MAXCHANNELS", feature_uint(FEAT_MAXCHANNELSPERUSER));
}
static void
@@ -228,13 +228,13 @@
static void
set_isupport_nicklen(void)
{
- add_isupport_i("NICKLEN", feature_int(FEAT_NICKLEN));
+ add_isupport_i("NICKLEN", feature_uint(FEAT_NICKLEN));
}
static void
set_isupport_channellen(void)
{
- add_isupport_i("CHANNELLEN", feature_int(FEAT_CHANNELLEN));
+ add_isupport_i("CHANNELLEN", feature_uint(FEAT_CHANNELLEN));
}
static void
@@ -288,6 +288,7 @@
#define FEAT_STR 0x0003 /**< set if entry contains a string value */
#define FEAT_ALIAS 0x0004 /**< set if entry is alias for another entry */
#define FEAT_DEP 0x0005 /**< set if entry is deprecated feature */
+#define FEAT_UINT 0x0006 /**< set if entry contains an unsigned value */
#define FEAT_MASK 0x000f /**< possible value types */
/** Extract just the feature type from a feature descriptor. */
@@ -311,6 +312,10 @@
#define F_I(type, flags, v_int, notify)
\
{ FEAT_ ## type, #type, FEAT_INT | (flags), 0, (v_int), 0, 0,
\
0, 0, 0, (notify), 0, 0, 0 }
+/** Declare a feature that takes unsigned integer values. */
+#define F_U(type, flags, v_uint, notify) \
+ { FEAT_ ## type, #type, FEAT_UINT | (flags), 0, (v_uint), 0, 0, \
+ 0, 0, 0, (notify), 0, 0, 0 }
/** Declare a feature that takes boolean values. */
#define F_B(type, flags, v_int, notify)
\
{ FEAT_ ## type, #type, FEAT_BOOL | (flags), 0, (v_int), 0, 0, \
@@ -349,9 +354,9 @@
0, log_feature_unmark, log_feature_mark, log_feature_report),
F_S(DOMAINNAME, 0, DOMAINNAME, 0),
F_B(RELIABLE_CLOCK, 0, 0, 0),
- F_I(BUFFERPOOL, 0, 27000000, 0),
+ F_U(BUFFERPOOL, 0, 27000000, 0),
F_B(HAS_FERGUSON_FLUSHER, 0, 0, 0),
- F_I(CLIENT_FLOOD, 0, 1024, 0),
+ F_U(CLIENT_FLOOD, 0, 1024, 0),
F_I(SERVER_PORT, FEAT_OPER, 4400, 0),
F_B(NODEFAULTMOTD, 0, 1, 0),
F_S(MOTD_BANNER, FEAT_NULL, 0, 0),
@@ -364,7 +369,7 @@
F_B(NOIDENT, 0, 0, 0),
F_N(RANDOM_SEED, FEAT_NODISP, random_seed_set, 0, 0, 0, 0, 0, 0),
F_S(DEFAULT_LIST_PARAM, FEAT_NULL, 0, list_set_default),
- F_I(NICKNAMEHISTORYLENGTH, 0, 800, whowas_realloc),
+ F_U(NICKNAMEHISTORYLENGTH, 0, 800, whowas_realloc),
F_B(HOST_HIDING, 0, 1, 0),
F_S(HIDDEN_HOST, FEAT_CASE, "users.undernet.org", 0),
F_S(HIDDEN_IP, 0, "127.0.0.1", 0),
@@ -378,8 +383,8 @@
/* features that probably should not be touched */
F_I(KILLCHASETIMELIMIT, 0, 30, 0),
- F_I(MAXCHANNELSPERUSER, 0, 10, set_isupport_maxchannels),
- F_I(NICKLEN, 0, 12, set_isupport_nicklen),
+ F_U(MAXCHANNELSPERUSER, 0, 10, set_isupport_maxchannels),
+ F_U(NICKLEN, 0, 12, set_isupport_nicklen),
F_I(AVBANLEN, 0, 40, 0),
F_I(MAXBANS, 0, 45, set_isupport_maxbans),
F_I(MAXSILES, 0, 15, set_isupport_maxsiles),
@@ -389,14 +394,14 @@
F_I(MAXIMUM_LINKS, 0, 1, init_class), /* reinit class 0 as needed */
F_I(PINGFREQUENCY, 0, 120, init_class),
F_I(CONNECTFREQUENCY, 0, 600, init_class),
- F_I(DEFAULTMAXSENDQLENGTH, 0, 40000, init_class),
+ F_U(DEFAULTMAXSENDQLENGTH, 0, 40000, init_class),
F_I(GLINEMAXUSERCOUNT, 0, 20, 0),
F_I(SOCKSENDBUF, 0, SERVER_TCP_WINDOW, 0),
F_I(SOCKRECVBUF, 0, SERVER_TCP_WINDOW, 0),
F_I(IPCHECK_CLONE_LIMIT, 0, 4, 0),
F_I(IPCHECK_CLONE_PERIOD, 0, 40, 0),
F_I(IPCHECK_CLONE_DELAY, 0, 600, 0),
- F_I(CHANNELLEN, 0, 200, set_isupport_channellen),
+ F_U(CHANNELLEN, 0, 200, set_isupport_channellen),
/* Some misc. default paths */
F_S(MPATH, FEAT_CASE | FEAT_MYOPER, "ircd.motd", motd_init_local),
@@ -593,6 +598,7 @@
break;
}
+ case FEAT_UINT: /* an unsigned integer value */
case FEAT_INT: /* an integer value */
tmp = feat->v_int; /* detect changes... */
@@ -747,6 +753,7 @@
}
break;
+ case FEAT_UINT: /* Unsigned... */
case FEAT_INT: /* Integer... */
case FEAT_BOOL: /* Boolean... */
if (feat->v_int != feat->def_int)
@@ -810,6 +817,11 @@
":Integer value of %s: %d", feat->type, feat->v_int);
break;
+ case FEAT_UINT: /* unsigned integer, report its value */
+ send_reply(from, SND_EXPLICIT | RPL_FEATURE,
+ ":Unsigned value of %s: %u", feat->type, feat->v_int);
+ break;
+
case FEAT_BOOL: /* boolean, report boolean value */
send_reply(from, SND_EXPLICIT | RPL_FEATURE,
":Boolean value of %s: %s", feat->type,
@@ -860,6 +872,7 @@
break;
case FEAT_INT: /* Integers or Booleans... */
+ case FEAT_UINT:
case FEAT_BOOL:
if (!(features[i].flags & FEAT_MARK)) { /* not changed? */
if (features[i].v_int != features[i].def_int)
@@ -899,6 +912,7 @@
break;
case FEAT_INT: /* Integers or Booleans... */
+ case FEAT_UINT:
case FEAT_BOOL:
feat->v_int = feat->def_int;
break;
@@ -946,6 +960,12 @@
features[i].type, features[i].v_int);
break;
+ case FEAT_UINT: /* Report an F-line with unsigned values */
+ if (features[i].flags & FEAT_MARK) /* it's been changed */
+ send_reply(to, SND_EXPLICIT | RPL_STATSFLINE, "F %s %u",
+ features[i].type, features[i].v_int);
+ break;
+
case FEAT_BOOL: /* Report an F-line with boolean values */
if (features[i].flags & FEAT_MARK) /* it's been changed */
send_reply(to, SND_EXPLICIT | RPL_STATSFLINE, "F %s %s",
@@ -979,6 +999,19 @@
return features[feat].v_int;
}
+/** Return a feature's unsigned integer value.
+ * @param[in] feat &Feature identifier.
+ * @return Unsigned integer value of feature.
+ */
+unsigned int
+feature_uint(enum Feature feat)
+{
+ assert(features[feat].feat == feat);
+ assert(feat_type(&features[feat]) == FEAT_UINT);
+
+ return features[feat].v_int;
+}
+
/** Return a feature's boolean value.
* @param[in] feat &Feature identifier.
* @return Boolean value of feature.
Index: ircu2.10/ircd/ircd_parser.y
diff -u ircu2.10/ircd/ircd_parser.y:1.74 ircu2.10/ircd/ircd_parser.y:1.75
--- ircu2.10/ircd/ircd_parser.y:1.74 Tue Dec 4 20:14:00 2007
+++ ircu2.10/ircd/ircd_parser.y Wed Dec 5 21:07:31 2007
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
- * $Id: ircd_parser.y,v 1.74 2007/12/05 04:14:00 entrope Exp $
+ * $Id: ircd_parser.y,v 1.75 2007/12/06 05:07:31 entrope Exp $
*/
%{
@@ -372,7 +372,7 @@
;
else if (localConf.numeric == 0)
localConf.numeric = $3;
- else if (localConf.numeric != $3)
+ else if (localConf.numeric != (unsigned int)$3)
parse_error("Redefinition of server numeric %i (%i)", $3,
localConf.numeric);
};
@@ -1142,7 +1142,7 @@
stringlist[0] = $1;
stringno = 1;
} '=' stringlist ';' {
- unsigned int ii;
+ int ii;
if (permitted(BLOCK_FEATURES, 0))
feature_set(NULL, (const char * const *)stringlist, stringno);
for (ii = 0; ii < stringno; ++ii)
@@ -1268,7 +1268,7 @@
child = MyCalloc(1, sizeof(*child) + strlen($3));
strcpy(child->cb_fname, $3);
- child->cb_allowed = $2 & (includes ? includes->cb_allowed : ~0);
+ child->cb_allowed = $2 & (includes ? includes->cb_allowed : ~0ul);
child->cb_parent = includes;
MyFree($3);
Index: ircu2.10/ircd/ircd_snprintf.c
diff -u ircu2.10/ircd/ircd_snprintf.c:1.20 ircu2.10/ircd/ircd_snprintf.c:1.21
--- ircu2.10/ircd/ircd_snprintf.c:1.20 Thu Apr 6 20:56:22 2006
+++ ircu2.10/ircd/ircd_snprintf.c Wed Dec 5 21:07:31 2007
@@ -18,7 +18,7 @@
*/
/** @file
* @brief IRC-specific printf() clone implementation.
- * @version $Id: ircd_snprintf.c,v 1.20 2006/04/07 03:56:22 entrope Exp $
+ * @version $Id: ircd_snprintf.c,v 1.21 2007/12/06 05:07:31 entrope Exp $
*/
#include "config.h"
@@ -212,7 +212,7 @@
static char zeros[] = "00000000000000000000000000000000000000000000000000";
/** Length of predefined padding strings. */
-#define PAD_LENGTH (sizeof(spaces) - 1)
+#define PAD_LENGTH ((int)sizeof(spaces) - 1)
/*
* Note that these string tables have characters reversed. There is, of
Index: ircu2.10/ircd/m_cap.c
diff -u ircu2.10/ircd/m_cap.c:1.4 ircu2.10/ircd/m_cap.c:1.5
--- ircu2.10/ircd/m_cap.c:1.4 Wed Jun 28 19:56:12 2006
+++ ircu2.10/ircd/m_cap.c Wed Dec 5 21:07:31 2007
@@ -21,7 +21,7 @@
*/
/** @file
* @brief Capability negotiation commands
- * @version $Id: m_cap.c,v 1.4 2006/06/29 02:56:12 entrope Exp $
+ * @version $Id: m_cap.c,v 1.5 2007/12/06 05:07:31 entrope Exp $
*/
#include "config.h"
@@ -171,7 +171,8 @@
{
char capbuf[BUFSIZE] = "", pfx[16];
struct MsgBuf *mb;
- int i, loc, len, flags, pfx_len;
+ unsigned int i, loc;
+ int len, flags, pfx_len;
/* set up the buffer for the final LS message... */
mb = msgq_make(sptr, "%:#C " MSG_CAP " %s :", &me, subcmd);
Index: ircu2.10/ircd/m_join.c
diff -u ircu2.10/ircd/m_join.c:1.49 ircu2.10/ircd/m_join.c:1.50
--- ircu2.10/ircd/m_join.c:1.49 Sun Feb 25 07:48:12 2007
+++ ircu2.10/ircd/m_join.c Wed Dec 5 21:07:31 2007
@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: m_join.c,v 1.49 2007/02/25 15:48:12 entrope Exp $
+ * $Id: m_join.c,v 1.50 2007/12/06 05:07:31 entrope Exp $
*/
#include "config.h"
@@ -142,7 +142,7 @@
continue;
}
- if (cli_user(sptr)->joined >= feature_int(FEAT_MAXCHANNELSPERUSER)
+ if (cli_user(sptr)->joined >= feature_uint(FEAT_MAXCHANNELSPERUSER)
&& !HasPriv(sptr, PRIV_CHAN_LIMIT)) {
send_reply(sptr, ERR_TOOMANYCHANNELS, name);
break; /* no point processing the other channels */
@@ -157,7 +157,7 @@
if (!(chptr = FindChannel(name))) {
if (((name[0] == '&') && !feature_bool(FEAT_LOCAL_CHANNELS))
- || strlen(name) >= IRCD_MIN(CHANNELLEN,
feature_int(FEAT_CHANNELLEN))) {
+ || strlen(name) >= IRCD_MIN(CHANNELLEN,
feature_uint(FEAT_CHANNELLEN))) {
send_reply(sptr, ERR_NOSUCHCHANNEL, name);
continue;
}
Index: ircu2.10/ircd/m_nick.c
diff -u ircu2.10/ircd/m_nick.c:1.30 ircu2.10/ircd/m_nick.c:1.31
--- ircu2.10/ircd/m_nick.c:1.30 Sat Nov 4 14:01:34 2006
+++ ircu2.10/ircd/m_nick.c Wed Dec 5 21:07:31 2007
@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: m_nick.c,v 1.30 2006/11/04 22:01:34 entrope Exp $
+ * $Id: m_nick.c,v 1.31 2007/12/06 05:07:31 entrope Exp $
*/
#include "config.h"
@@ -122,8 +122,8 @@
* garbage
*/
arg = parv[1];
- if (strlen(arg) > IRCD_MIN(NICKLEN, feature_int(FEAT_NICKLEN)))
- arg[IRCD_MIN(NICKLEN, feature_int(FEAT_NICKLEN))] = '\0';
+ if (strlen(arg) > IRCD_MIN(NICKLEN, feature_uint(FEAT_NICKLEN)))
+ arg[IRCD_MIN(NICKLEN, feature_uint(FEAT_NICKLEN))] = '\0';
if ((s = strchr(arg, '~')))
*s = '\0';
Index: ircu2.10/ircd/m_server.c
diff -u ircu2.10/ircd/m_server.c:1.45 ircu2.10/ircd/m_server.c:1.46
--- ircu2.10/ircd/m_server.c:1.45 Mon Jul 24 20:27:18 2006
+++ ircu2.10/ircd/m_server.c Wed Dec 5 21:07:31 2007
@@ -22,7 +22,7 @@
*/
/** @file
* @brief Handlers for the SERVER command.
- * @version $Id: m_server.c,v 1.45 2006/07/25 03:27:18 entrope Exp $
+ * @version $Id: m_server.c,v 1.46 2007/12/06 05:07:31 entrope Exp $
*/
#include "config.h"
@@ -110,7 +110,7 @@
* was SQUIT. 1 if the new server is allowed.
*/
static int
-check_loop_and_lh(struct Client* cptr, struct Client *sptr, time_t *ghost,
const char *host, const char *numnick, time_t timestamp, int hop, int junction)
+check_loop_and_lh(struct Client* cptr, struct Client *sptr, time_t *ghost,
const char *host, const char *numnick, time_t timestamp, unsigned int hop, int
junction)
{
struct Client* acptr;
struct Client* LHcptr = NULL;
@@ -514,7 +514,7 @@
char* host;
struct ConfItem* aconf;
struct Jupe* ajupe;
- int hop;
+ unsigned int hop;
int ret;
unsigned short prot;
time_t start_timestamp;
Index: ircu2.10/ircd/msgq.c
diff -u ircu2.10/ircd/msgq.c:1.15 ircu2.10/ircd/msgq.c:1.16
--- ircu2.10/ircd/msgq.c:1.15 Wed Aug 2 20:32:46 2006
+++ ircu2.10/ircd/msgq.c Wed Dec 5 21:07:31 2007
@@ -18,7 +18,7 @@
*/
/** @file
* @brief Outbound message queue implementation.
- * @version $Id: msgq.c,v 1.15 2006/08/03 03:32:46 entrope Exp $
+ * @version $Id: msgq.c,v 1.16 2007/12/06 05:07:31 entrope Exp $
*/
#include "config.h"
@@ -56,7 +56,7 @@
};
/** Return allocated length of the buffer of \a buf. */
-#define bufsize(buf) (1 << (buf)->power)
+#define bufsize(buf) (1u << (buf)->power)
/** Message body for a particular destination. */
struct Msg {
@@ -256,7 +256,7 @@
msgq_alloc(struct MsgBuf *in_mb, int length)
{
struct MsgBuf *mb;
- int power;
+ unsigned int power;
/* Find the power of two size that will accommodate the message */
for (power = MB_BASE_SHIFT; power < MB_MAX_SHIFT + 1; power++)
@@ -275,7 +275,7 @@
/* Try popping one off the freelist first */
if ((mb = MQData.msgBufs[power - MB_BASE_SHIFT].free)) {
MQData.msgBufs[power - MB_BASE_SHIFT].free = mb->next;
- } else if (MQData.tot_bufsize < feature_int(FEAT_BUFFERPOOL)) {
+ } else if (MQData.tot_bufsize < feature_uint(FEAT_BUFFERPOOL)) {
/* Allocate another if we won't bust the BUFFERPOOL */
Debug((DEBUG_MALLOC, "Allocating MsgBuf of length %d (total size %zu)",
length, sizeof(struct MsgBuf) + length));
Index: ircu2.10/ircd/numnicks.c
diff -u ircu2.10/ircd/numnicks.c:1.32 ircu2.10/ircd/numnicks.c:1.33
--- ircu2.10/ircd/numnicks.c:1.32 Fri Jan 6 03:22:31 2006
+++ ircu2.10/ircd/numnicks.c Wed Dec 5 21:07:32 2007
@@ -18,7 +18,7 @@
*/
/** @file
* @brief Implementation of numeric nickname operations.
- * @version $Id: numnicks.c,v 1.32 2006/01/06 11:22:31 isomer Exp $
+ * @version $Id: numnicks.c,v 1.33 2007/12/06 05:07:32 entrope Exp $
*/
#include "config.h"
@@ -392,7 +392,7 @@
int markMatchexServer(const char *cmask, int minlen)
{
int cnt = 0;
- int i;
+ unsigned int i;
struct Client *acptr;
for (i = 0; i < lastNNServer; i++) {
@@ -417,7 +417,7 @@
struct Client* find_match_server(char *mask)
{
struct Client *acptr;
- int i;
+ unsigned int i;
if (!(BadPtr(mask))) {
collapse(mask);
Index: ircu2.10/ircd/s_bsd.c
diff -u ircu2.10/ircd/s_bsd.c:1.90 ircu2.10/ircd/s_bsd.c:1.91
--- ircu2.10/ircd/s_bsd.c:1.90 Tue Dec 4 20:14:01 2007
+++ ircu2.10/ircd/s_bsd.c Wed Dec 5 21:07:32 2007
@@ -19,7 +19,7 @@
*/
/** @file
* @brief Functions that now (or in the past) relied on BSD APIs.
- * @version $Id: s_bsd.c,v 1.90 2007/12/05 04:14:01 entrope Exp $
+ * @version $Id: s_bsd.c,v 1.91 2007/12/06 05:07:32 entrope Exp $
*/
#include "config.h"
@@ -599,7 +599,7 @@
if (socket_ready &&
!(IsUser(cptr) &&
- DBufLength(&(cli_recvQ(cptr))) > feature_int(FEAT_CLIENT_FLOOD))) {
+ DBufLength(&(cli_recvQ(cptr))) > feature_uint(FEAT_CLIENT_FLOOD))) {
switch (os_recv_nonb(cli_fd(cptr), readbuf, sizeof(readbuf), &length)) {
case IO_SUCCESS:
if (length)
@@ -638,7 +638,7 @@
if (length > 0 && dbuf_put(&(cli_recvQ(cptr)), readbuf, length) == 0)
return exit_client(cptr, cptr, &me, "dbuf_put fail");
- if (DBufLength(&(cli_recvQ(cptr))) > feature_int(FEAT_CLIENT_FLOOD))
+ if (DBufLength(&(cli_recvQ(cptr))) > feature_uint(FEAT_CLIENT_FLOOD))
return exit_client(cptr, cptr, &me, "Excess Flood");
while (DBufLength(&(cli_recvQ(cptr))) && !NoNewLine(cptr) &&
Index: ircu2.10/ircd/s_debug.c
diff -u ircu2.10/ircd/s_debug.c:1.43 ircu2.10/ircd/s_debug.c:1.44
--- ircu2.10/ircd/s_debug.c:1.43 Sun Jul 23 19:08:33 2006
+++ ircu2.10/ircd/s_debug.c Wed Dec 5 21:07:32 2007
@@ -19,7 +19,7 @@
*/
/** @file
* @brief Debug support for the ircd.
- * @version $Id: s_debug.c,v 1.43 2006/07/24 02:08:33 entrope Exp $
+ * @version $Id: s_debug.c,v 1.44 2007/12/06 05:07:32 entrope Exp $
*/
#include "config.h"
@@ -70,11 +70,11 @@
*/
const char* debug_serveropts(void)
{
- int bp;
+ unsigned int bp;
int i = 0;
#define AddC(c) serveropts[i++] = (c)
- bp = feature_int(FEAT_BUFFERPOOL);
+ bp = feature_uint(FEAT_BUFFERPOOL);
if (bp < 1000000) {
AddC('b');
if (bp > 99999)
@@ -192,7 +192,7 @@
{
os_get_rusage(cptr, CurrentTime - cli_since(&me), debug_enumerator);
- send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":DBUF alloc %d used %d",
+ send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":DBUF alloc %u used %u",
DBufAllocCount, DBufUsedCount);
}
#endif /* DEBUGMODE */
@@ -253,7 +253,7 @@
totcl = 0, totch = 0, totww = 0, tot = 0;
count_whowas_memory(&wwu, &wwm, &wwa, &wwam);
- wwm += sizeof(struct Whowas) * feature_int(FEAT_NICKNAMEHISTORYLENGTH);
+ wwm += sizeof(struct Whowas) * feature_uint(FEAT_NICKNAMEHISTORYLENGTH);
wwm += sizeof(struct Whowas *) * WW_MAX;
for (acptr = GlobalClientList; acptr; acptr = cli_next(acptr))
@@ -334,9 +334,9 @@
totch = chm + chbm;
send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG,
- ":Whowas Users %d(%zu) Away %d(%zu) Array %d(%zu)",
+ ":Whowas Users %d(%zu) Away %d(%zu) Array %u(%zu)",
wwu, wwu * sizeof(struct User), wwa, wwam,
- feature_int(FEAT_NICKNAMEHISTORYLENGTH), wwm);
+ feature_uint(FEAT_NICKNAMEHISTORYLENGTH), wwm);
totww = wwu * sizeof(struct User) + wwam + wwm;
@@ -364,7 +364,7 @@
*/
dbuf_count_memory(&dbufs_allocated, &dbufs_used);
send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG,
- ":DBufs allocated %d(%zu) used %d(%zu)", DBufAllocCount,
+ ":DBufs allocated %u(%zu) used %u(%zu)", DBufAllocCount,
dbufs_allocated, DBufUsedCount, dbufs_used);
/* The DBuf caveats now count for this, but this routine now sends
Index: ircu2.10/ircd/s_misc.c
diff -u ircu2.10/ircd/s_misc.c:1.56 ircu2.10/ircd/s_misc.c:1.57
--- ircu2.10/ircd/s_misc.c:1.56 Tue Dec 4 20:14:01 2007
+++ ircu2.10/ircd/s_misc.c Wed Dec 5 21:07:32 2007
@@ -22,7 +22,7 @@
*/
/** @file
* @brief Miscellaneous support functions.
- * @version $Id: s_misc.c,v 1.56 2007/12/05 04:14:01 entrope Exp $
+ * @version $Id: s_misc.c,v 1.57 2007/12/06 05:07:32 entrope Exp $
*/
#include "config.h"
@@ -297,7 +297,7 @@
struct DLink *next;
struct DLink *lp;
struct Client **acptrp;
- int i;
+ unsigned int i;
/* Run over all its downlinks */
for (lp = cli_serv(cptr)->down; lp; lp = next)
Index: ircu2.10/ircd/s_user.c
diff -u ircu2.10/ircd/s_user.c:1.110 ircu2.10/ircd/s_user.c:1.111
--- ircu2.10/ircd/s_user.c:1.110 Tue Dec 4 20:14:01 2007
+++ ircu2.10/ircd/s_user.c Wed Dec 5 21:07:32 2007
@@ -22,7 +22,7 @@
*/
/** @file
* @brief Miscellaneous user-related helper functions.
- * @version $Id: s_user.c,v 1.110 2007/12/05 04:14:01 entrope Exp $
+ * @version $Id: s_user.c,v 1.111 2007/12/06 05:07:32 entrope Exp $
*/
#include "config.h"
@@ -975,7 +975,7 @@
char** p;
char* m;
int what;
- int i;
+ unsigned int i;
struct Flags setflags;
unsigned int tmpmask = 0;
int snomask_given = 0;
@@ -1222,7 +1222,7 @@
{
/* Maximum string size: "owidgrx\0" */
char *m = umodeBuf;
- int i;
+ unsigned int i;
struct Flags c_flags = cli_flags(cptr);
if (!HasPriv(cptr, PRIV_PROPAGATE))
@@ -1273,7 +1273,7 @@
void send_umode(struct Client *cptr, struct Client *sptr, struct Flags *old,
int sendset)
{
- int i;
+ unsigned int i;
int flag;
char *m;
int what = MODE_NULL;
@@ -1614,7 +1614,7 @@
usable = BUFSIZE - 10
- strlen(cli_name(&me))
- strlen(get_error_numeric(RPL_ISUPPORT)->format)
- - feature_int(FEAT_NICKLEN);
+ - feature_uint(FEAT_NICKLEN);
plink = &isupport_lines;
used = 0;
Index: ircu2.10/ircd/uping.c
diff -u ircu2.10/ircd/uping.c:1.28 ircu2.10/ircd/uping.c:1.29
--- ircu2.10/ircd/uping.c:1.28 Sun Jul 23 17:29:17 2006
+++ ircu2.10/ircd/uping.c Wed Dec 5 21:07:32 2007
@@ -18,7 +18,7 @@
*/
/** @file
* @brief UDP ping implementation.
- * @version $Id: uping.c,v 1.28 2006/07/24 00:29:17 entrope Exp $
+ * @version $Id: uping.c,v 1.29 2007/12/06 05:07:32 entrope Exp $
*/
#include "config.h"
@@ -309,7 +309,7 @@
struct irc_sockaddr sin;
struct timeval tv;
unsigned int len;
- unsigned int pingtime;
+ time_t pingtime;
char* s;
char buf[BUFSIZE + 1];
IOResult ior;
@@ -349,7 +349,7 @@
timer_chg(&pptr->killer, TT_RELATIVE, UPINGTIMEOUT);
s = pptr->buf + strlen(pptr->buf);
- sprintf(s, " %u", pingtime);
+ sprintf(s, " %u", (unsigned int)pingtime);
if (pptr->received == pptr->count)
uping_end(pptr);
Index: ircu2.10/ircd/whowas.c
diff -u ircu2.10/ircd/whowas.c:1.20 ircu2.10/ircd/whowas.c:1.21
--- ircu2.10/ircd/whowas.c:1.20 Fri Jul 14 17:09:10 2006
+++ ircu2.10/ircd/whowas.c Wed Dec 5 21:07:32 2007
@@ -68,7 +68,7 @@
/** @file
* @brief Manipulation functions for the whowas list.
- * @version \$Id: whowas.c,v 1.20 2006/07/15 00:09:10 entrope Exp $
+ * @version \$Id: whowas.c,v 1.21 2007/12/06 05:07:32 entrope Exp $
*
* Since the introduction of numeric nicks (at least for upstream messages,
* like MODE +o \<nick\>, KICK \#chan \<nick\>, KILL \<nick\> etc), there is no
@@ -219,7 +219,7 @@
{
struct Whowas *ww;
- if (wwList.ww_alloc >= feature_int(FEAT_NICKNAMEHISTORYLENGTH)) {
+ if (wwList.ww_alloc >= feature_uint(FEAT_NICKNAMEHISTORYLENGTH)) {
/* reclaim the oldest whowas entry */
ww = whowas_clean(wwList.ww_tail);
} else {
@@ -241,10 +241,10 @@
whowas_realloc(void)
{
Debug((DEBUG_LIST, "whowas_realloc() called with alloc count %d, "
- "history length %d, tail pointer %p", wwList.ww_alloc,
- feature_int(FEAT_NICKNAMEHISTORYLENGTH), wwList.ww_tail));
+ "history length %u, tail pointer %p", wwList.ww_alloc,
+ feature_uint(FEAT_NICKNAMEHISTORYLENGTH), wwList.ww_tail));
- while (wwList.ww_alloc > feature_int(FEAT_NICKNAMEHISTORYLENGTH)) {
+ while (wwList.ww_alloc > feature_uint(FEAT_NICKNAMEHISTORYLENGTH)) {
if (!wwList.ww_tail) { /* list is empty... */
Debug((DEBUG_LIST, "whowas list emptied with alloc count %d",
wwList.ww_alloc));
----------------------- End of diff -----------------------
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches