#
# ChangeLog for ircu2.10.11
#
-# $Id: ChangeLog,v 1.14 2000-03-18 06:48:21 bleep Exp $
+# $Id: ChangeLog,v 1.15 2000-03-19 05:49:04 bleep Exp $
#
# Insert new changes at beginning of the change list.
#
#-----------------------------------------------------------------------------
+* Merge in u2_10_10_beta06 changes --Bleep
* Start ircu2.10.11 development, beta branch u2_10_10 --Bleep
#
# ChangeLog for ircu2.10.10
#
-# $Id: ChangeLog.10,v 1.1 2000-03-18 05:20:28 bleep Exp $
+# $Id: ChangeLog.10,v 1.2 2000-03-19 05:49:04 bleep Exp $
#
# Insert new changes at beginning of the change list.
#
+* Merge u2_10_10_beta06 create branch u2_10_10_beta07 --Bleep
+* Remove size_t from socket calls, audit usage of size_t
+ values. --Bleep
+* Fix for OSF1, RES_NOALIASES not defined there. --Bleep
* Don't bother doing hostname lookup or setting me.sockhost
since we never want to display it there is really no reason
to have the info. --Bleep
*/
#define MAGIC_REMOTE_JOIN_TS 1270080000
- #ifdef OPER_WALK_THROUGH_LMODES
- /* used in can_join to determine if an oper forced a join on a channel */
- #define MAGIC_OPER_OVERRIDE 1000
- #endif
+#ifdef OPER_WALK_THROUGH_LMODES
+/*
+ * used in can_join to determine if an oper forced a join on a channel
+ */
+#define MAGIC_OPER_OVERRIDE 1000
+#endif
extern const char* const PartFmt1;
extern unsigned int get_conf_class(struct ConfItem *aconf);
extern unsigned int get_client_class(struct Client *acptr);
extern void add_class(unsigned int conclass, unsigned int ping,
- unsigned int confreq, unsigned int maxli, size_t sendq);
+ unsigned int confreq, unsigned int maxli, unsigned int sendq);
extern void check_class(void);
extern void initclass(void);
extern void report_classes(struct Client *sptr);
-extern size_t get_sendq(struct Client* cptr);
+extern unsigned int get_sendq(struct Client* cptr);
extern struct ConfClass *classes;
HandlerType handler; /* message index into command table for parsing */
struct DNSReply* dns_reply; /* DNS reply used during client registration */
struct ListingArgs* listing;
- size_t max_sendq; /* cached max send queue for client */
+ unsigned int max_sendq; /* cached max send queue for client */
unsigned short lastsq; /* # 2k blocks when sendqueued called last */
unsigned short port; /* and the remote port# too :-) */
unsigned char targets[MAXTARGETS]; /* Hash values of current targets */
struct DBufBuffer;
struct DBuf {
- size_t length; /* Current number of bytes stored */
+ unsigned int length; /* Current number of bytes stored */
struct DBufBuffer *head; /* First data buffer, if length > 0 */
struct DBufBuffer *tail; /* last data buffer, if length > 0 */
};
/*
* Prototypes
*/
-extern void dbuf_delete(struct DBuf *dyn, size_t length);
-extern int dbuf_put(struct DBuf *dyn, const char *buf, size_t length);
-extern const char *dbuf_map(const struct DBuf *dyn, size_t *length);
-extern size_t dbuf_get(struct DBuf *dyn, char *buf, size_t length);
-extern size_t dbuf_getmsg(struct DBuf *dyn, char *buf, size_t length);
+extern void dbuf_delete(struct DBuf *dyn, unsigned int length);
+extern int dbuf_put(struct DBuf *dyn, const char *buf, unsigned int length);
+extern const char *dbuf_map(const struct DBuf *dyn, unsigned int *length);
+extern unsigned int dbuf_get(struct DBuf *dyn, char *buf, unsigned int length);
+extern unsigned int dbuf_getmsg(struct DBuf *dyn, char *buf, unsigned int length);
extern void dbuf_count_memory(size_t *allocated, size_t *used);
struct Client* server, const char* yxx);
extern void ClearServerYXX(const struct Client* server);
-extern void SetYXXCapacity(struct Client* myself, size_t max_clients);
+extern void SetYXXCapacity(struct Client* myself, unsigned int max_clients);
extern void SetYXXServerName(struct Client* myself, unsigned int numeric);
extern int markMatchexServer(const char* cmask, int minlen);
extern struct Client* FindNServer(const char* numeric);
extern unsigned int base64toint(const char* str);
-extern const char* inttobase64(char* buf, unsigned int v, size_t count);
+extern const char* inttobase64(char* buf, unsigned int v, unsigned int count);
#endif /* INCLUDED_numnicks_h */
*/
extern int server_dopacket(struct Client* cptr, const char* buffer, int length);
-extern int client_dopacket(struct Client* cptr, size_t length);
+extern int client_dopacket(struct Client* cptr, unsigned int length);
#endif /* INCLUDED_packet_h */
* $Id$
*
*/
-
#define PATCHLEVEL "00"
#define RELEASE ".11.alpha."
* pointer arg, DO NOT call this from a resolver callback function the
* resolver will delete the query itself for the affected client.
*/
-extern void delete_resolver_queries(const void* vptr);
-extern unsigned long cres_mem(struct Client* cptr);
-extern int m_dns(struct Client* cptr, struct Client* sptr,
+extern void delete_resolver_queries(const void* vptr);
+extern size_t cres_mem(struct Client* cptr);
+extern int m_dns(struct Client* cptr, struct Client* sptr,
int parc, char* parv[]);
-extern int resolver_read(void);
-extern void resolver_read_multiple(int count);
-extern void flush_resolver_cache(void);
+extern int resolver_read(void);
+extern void resolver_read_multiple(int count);
+extern void flush_resolver_cache(void);
/*
* add_local_domain - append local domain suffix to hostnames that
/*
* Proto types
*/
-extern size_t deliver_it(struct Client *cptr, const char *str, size_t len);
+extern unsigned int deliver_it(struct Client *cptr, const char *str, unsigned int len);
extern int connect_server(struct ConfItem* aconf, struct Client* by,
struct DNSReply* reply);
extern void release_dns_reply(struct Client* cptr);
name = lp->value.ban.banstr;
else
name = lp->value.cptr->name;
- if (strlen(parabuf) + strlen(name) + 11 < (size_t)MODEBUFLEN)
+ if (strlen(parabuf) + strlen(name) + 11 < MODEBUFLEN)
{
strcat(parabuf, " ");
strcat(parabuf, name);
{
lp = &chops[opcnt++];
lp->value.cp = *parv;
- if (strlen(lp->value.cp) > (size_t)KEYLEN)
+ if (strlen(lp->value.cp) > KEYLEN)
lp->value.cp[KEYLEN] = '\0';
lp->flags = MODE_KEY | MODE_ADD;
keychange = 1;
}
/* What could be added: cp+' '+' '+<TS>+'\0' */
- if (len + strlen(cp) + 13 > (size_t)MODEBUFLEN ||
- nlen + strlen(cp) + NUMNICKLEN + 12 > (size_t)MODEBUFLEN)
+ if (len + strlen(cp) + 13 > MODEBUFLEN ||
+ nlen + strlen(cp) + NUMNICKLEN + 12 > MODEBUFLEN)
break;
switch (lp->flags & MODE_WPARAS)
{
case MODE_KEY:
- if (strlen(cp) > (size_t)KEYLEN)
+ if (strlen(cp) > KEYLEN)
*(cp + KEYLEN) = '\0';
if ((whatt == MODE_ADD && (*mode->key == '\0' ||
0 != ircd_strcmp(mode->key, cp))) ||
MyFree(banstr[cnt]);
sblen += len[cnt];
}
- for (member_z = chptr->members; member_z; member_z = member_z->next_member)
- if (MyConnect(acptr = member_z->user) && !IsZombie(member_z))
+ for (member_z = chptr->members; member_z; member_z = member_z->next_member) {
+ acptr = member_z->user;
+ if (MyConnect(acptr) && !IsZombie(member_z))
sendbufto_one(acptr);
+ }
if (delayed)
{
banstr[0] = banstr[delayed - 1];
if (!*(tmp + 1))
break;
else
- for (s = tmp; (*s = *++s);)
+ for (s = tmp; *s; *s = *++s)
;
tmp++;
}
* immeadiately after the first one (class 0).
*/
void add_class(unsigned int conClass, unsigned int ping, unsigned int confreq,
- unsigned int maxli, size_t sendq)
+ unsigned int maxli, unsigned int sendq)
{
struct ConfClass *t, *p;
MaxLinks(cltmp), MaxSendq(cltmp));
}
-size_t get_sendq(struct Client *cptr)
+unsigned int get_sendq(struct Client *cptr)
{
assert(0 != cptr);
assert(0 != cptr->local);
* buf: Pointer to data to be stored
* length: Number of bytes to store
*/
-int dbuf_put(struct DBuf *dyn, const char *buf, size_t length)
+int dbuf_put(struct DBuf *dyn, const char *buf, unsigned int length)
{
struct DBufBuffer** h;
struct DBufBuffer* db;
- size_t chunk;
+ unsigned int chunk;
assert(0 != dyn);
assert(0 != buf);
* dyn: Dynamic buffer header
* length: Return number of bytes accessible
*/
-const char *dbuf_map(const struct DBuf *dyn, size_t *length)
+const char *dbuf_map(const struct DBuf* dyn, unsigned int* length)
{
assert(0 != dyn);
assert(0 != length);
* dyn: Dynamic buffer header
* length: Number of bytes to delete
*/
-void dbuf_delete(struct DBuf *dyn, size_t length)
+void dbuf_delete(struct DBuf *dyn, unsigned int length)
{
struct DBufBuffer *db;
- size_t chunk;
+ unsigned int chunk;
if (length > dyn->length)
length = dyn->length;
* buf: Pointer to buffer to receive the data
* length: Max amount of bytes that can be received
*/
-size_t dbuf_get(struct DBuf *dyn, char *buf, size_t length)
+unsigned int dbuf_get(struct DBuf *dyn, char *buf, unsigned int length)
{
- size_t moved = 0;
- size_t chunk;
+ unsigned int moved = 0;
+ unsigned int chunk;
const char *b;
assert(0 != dyn);
return moved;
}
-static size_t dbuf_flush(struct DBuf *dyn)
+static unsigned int dbuf_flush(struct DBuf *dyn)
{
struct DBufBuffer *db = dyn->head;
* possible (determined by length) into buf and return the amount copied
* else return 0.
*/
-size_t dbuf_getmsg(struct DBuf *dyn, char *buf, size_t length)
+unsigned int dbuf_getmsg(struct DBuf *dyn, char *buf, unsigned int length)
{
struct DBufBuffer *db;
char *start;
char *end;
- size_t count;
- size_t copied = 0;
+ unsigned int count;
+ unsigned int copied = 0;
assert(0 != dyn);
assert(0 != buf);
/*
* whee!! :)
*/
- if (!acptr->user || strlen(acptr->sockhost) > (size_t)HOSTLEN ||
- (acptr->user->username ? strlen(acptr->user->username) : 0) >
- (size_t)HOSTLEN)
+ if (!acptr->user || strlen(acptr->sockhost) > HOSTLEN ||
+ (acptr->user->username ? strlen(acptr->user->username) : 0) > HOSTLEN)
continue; /* these tests right out of
find_kill for safety's sake */
#endif
* Other functions visible externally
*/
-int strnChattr(const char *s, const size_t n)
+int strnChattr(const char *s, size_t n)
{
const char *rs = s;
unsigned int x = ~0;
* ircd_strncmp - counted case insensitive comparison of 2 strings
* NOTE: see ircd_chattr.h for notes on case mapping.
*/
-int ircd_strncmp(const char *a, const char *b, const size_t n)
+int ircd_strncmp(const char *a, const char *b, size_t n)
{
const char* ra = a;
const char* rb = b;
*/
void accept_connection(struct Listener* listener)
{
- struct sockaddr_in addr;
- size_t addrlen = sizeof(struct sockaddr_in);
+ struct sockaddr_in addr = { 0 };
+ unsigned int addrlen = sizeof(struct sockaddr_in);
int fd;
assert(0 != listener);
if (EmptyString(path))
return need_more_params(sptr, parv[0], "KILL");
- if (strlen(path) > (size_t)TOPICLEN)
+ if (strlen(path) > TOPICLEN)
path[TOPICLEN] = '\0';
}
return exit_client(cptr, sptr, sptr, "Signed off");
}
}
- if (strlen(comment) > (size_t)TOPICLEN)
+ if (strlen(comment) > TOPICLEN)
comment[TOPICLEN] = '\0';
return IsServer(sptr) ? 0 : exit_client(cptr, sptr, sptr, comment);
}
return i;
}
-const char* inttobase64(char* buf, unsigned int v, size_t count)
+const char* inttobase64(char* buf, unsigned int v, unsigned int count)
{
buf[count] = '\0';
while (count > 0) {
struct Client* FindNServer(const char* numeric)
{
- size_t len = strlen(numeric);
+ unsigned int len = strlen(numeric);
if (len < 3) {
Debug((DEBUG_DEBUG, "FindNServer: %s(%d)", numeric, base64toint(numeric)));
sizeof(struct Client*));
}
-void SetYXXCapacity(struct Client* c, size_t capacity)
+void SetYXXCapacity(struct Client* c, unsigned int capacity)
{
unsigned int max_clients;
#if defined(EXTENDED_NUMERICS)
{
int err = 0;
#if defined(SO_ERROR)
- size_t len = sizeof(err);
+ unsigned int len = sizeof(err);
getsockopt(fd, SOL_SOCKET, SO_ERROR, &err, &len);
#endif
return err;
*/
int os_set_reuseaddr(int fd)
{
- size_t opt = 1;
+ unsigned int opt = 1;
return (0 == setsockopt(fd, SOL_SOCKET, SO_REUSEADDR,
(const char*) &opt, sizeof(opt)));
}
int os_set_sockbufs(int fd, unsigned int size)
{
- size_t opt = size;
+ unsigned int opt = size;
return (0 == setsockopt(fd, SOL_SOCKET, SO_RCVBUF,
(const char*) &opt, sizeof(opt)) &&
0 == setsockopt(fd, SOL_SOCKET, SO_SNDBUF,
unsigned int* length_out, struct sockaddr_in* sin_out)
{
int res;
- size_t len = sizeof(struct sockaddr_in);
+ unsigned int len = sizeof(struct sockaddr_in);
assert(0 != buf);
assert(0 != length_out);
assert(0 != sin_out);
int os_get_sockname(int fd, struct sockaddr_in* sin_out)
{
- size_t len = sizeof(struct sockaddr_in);
+ unsigned int len = sizeof(struct sockaddr_in);
assert(0 != sin_out);
return (0 == getsockname(fd, (struct sockaddr*) sin_out, &len));
}
int os_get_peername(int fd, struct sockaddr_in* sin_out)
{
- size_t len = sizeof(struct sockaddr_in);
+ unsigned int len = sizeof(struct sockaddr_in);
assert(0 != sin_out);
return (0 == getpeername(fd, (struct sockaddr*) sin_out, &len));
}
{
int err = 0;
#if defined(SO_ERROR)
- size_t len = sizeof(err);
+ unsigned int len = sizeof(err);
getsockopt(fd, SOL_SOCKET, SO_ERROR, &err, &len);
#endif
return err;
*/
int os_set_reuseaddr(int fd)
{
- size_t opt = 1;
+ unsigned int opt = 1;
return (0 == setsockopt(fd, SOL_SOCKET, SO_REUSEADDR,
(const char*) &opt, sizeof(opt)));
}
int os_set_sockbufs(int fd, unsigned int size)
{
- size_t opt = size;
+ unsigned int opt = size;
return (0 == setsockopt(fd, SOL_SOCKET, SO_RCVBUF,
(const char*) &opt, sizeof(opt)) &&
0 == setsockopt(fd, SOL_SOCKET, SO_SNDBUF,
unsigned int* length_out, struct sockaddr_in* sin_out)
{
int res;
- size_t len = sizeof(struct sockaddr_in);
+ unsigned int len = sizeof(struct sockaddr_in);
assert(0 != buf);
assert(0 != length_out);
assert(0 != sin_out);
int os_get_sockname(int fd, struct sockaddr_in* sin_out)
{
- size_t len = sizeof(struct sockaddr_in);
+ unsigned int len = sizeof(struct sockaddr_in);
assert(0 != sin_out);
return (0 == getsockname(fd, (struct sockaddr*) sin_out, &len));
}
int os_get_peername(int fd, struct sockaddr_in* sin_out)
{
- size_t len = sizeof(struct sockaddr_in);
+ unsigned int len = sizeof(struct sockaddr_in);
assert(0 != sin_out);
return (0 == getpeername(fd, (struct sockaddr*) sin_out, &len));
}
int os_get_sockerr(int fd)
{
int err = 0;
- size_t len = sizeof(err);
+ unsigned int len = sizeof(err);
getsockopt(fd, SOL_SOCKET, SO_ERROR, &err, &len);
return err;
}
*/
int os_set_reuseaddr(int fd)
{
- size_t opt = 1;
+ unsigned int opt = 1;
return (0 == setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)));
}
int os_set_sockbufs(int fd, unsigned int size)
{
- size_t opt = size;
+ unsigned int opt = size;
return (0 == setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &opt, sizeof(opt)) &&
0 == setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &opt, sizeof(opt)));
}
unsigned int* length_out, struct sockaddr_in* sin_out)
{
int res;
- size_t len = sizeof(struct sockaddr_in);
+ unsigned int len = sizeof(struct sockaddr_in);
assert(0 != buf);
assert(0 != length_out);
assert(0 != sin_out);
int os_get_sockname(int fd, struct sockaddr_in* sin_out)
{
- size_t len = sizeof(struct sockaddr_in);
+ unsigned int len = sizeof(struct sockaddr_in);
assert(0 != sin_out);
return (0 == getsockname(fd, (struct sockaddr*) sin_out, &len));
}
int os_get_peername(int fd, struct sockaddr_in* sin_out)
{
- size_t len = sizeof(struct sockaddr_in);
+ unsigned int len = sizeof(struct sockaddr_in);
assert(0 != sin_out);
return (0 == getpeername(fd, (struct sockaddr*) sin_out, &len));
}
*/
int os_set_reuseaddr(int fd)
{
- size_t opt = 1;
+ unsigned int opt = 1;
return (0 == setsockopt(fd, SOL_SOCKET, SO_REUSEADDR,
(const char*) &opt, sizeof(opt)));
}
int os_set_sockbufs(int fd, unsigned int size)
{
- size_t opt = size;
+ unsigned int opt = size;
return (0 == setsockopt(fd, SOL_SOCKET, SO_RCVBUF,
(const char*) &opt, sizeof(opt)) &&
0 == setsockopt(fd, SOL_SOCKET, SO_SNDBUF,
unsigned int* length_out, struct sockaddr_in* sin_out)
{
int res;
- size_t len = sizeof(struct sockaddr_in);
+ unsigned int len = sizeof(struct sockaddr_in);
assert(0 != buf);
assert(0 != length_out);
assert(0 != sin_out);
#include <assert.h>
-static void update_bytes_received(struct Client* cptr, size_t length)
+static void update_bytes_received(struct Client* cptr, unsigned int length)
{
me.receiveB += length; /* Update bytes received */
cptr->receiveB += length;
/*
* client_dopacket - handle client messages
*/
-int client_dopacket(struct Client *cptr, size_t length)
+int client_dopacket(struct Client *cptr, unsigned int length)
{
assert(0 != cptr);
#define MAXPACKET 1024 /* rfc sez 512 but we expand names so ... */
#define RES_MAXALIASES 35 /* maximum aliases allowed */
#define RES_MAXADDRS 35 /* maximum addresses allowed */
+/*
+ * OSF1 doesn't have RES_NOALIASES
+ */
+#ifndef RES_NOALIASES
+#define RES_NOALIASES 0
+#endif
/*
* macros used to calulate offsets into fixed query buffer
*/
-#define ALIAS_BLEN (size_t) ((RES_MAXALIASES + 1) * sizeof(char*))
-#define ADDRS_BLEN (size_t) ((RES_MAXADDRS + 1) * sizeof(struct in_addr*))
+#define ALIAS_BLEN ((RES_MAXALIASES + 1) * sizeof(char*))
+#define ADDRS_BLEN ((RES_MAXADDRS + 1) * sizeof(struct in_addr*))
-#define ADDRS_OFFSET (size_t) (ALIAS_BLEN + ADDRS_BLEN)
-#define ADDRS_DLEN (size_t) (RES_MAXADDRS * sizeof(struct in_addr))
-#define NAMES_OFFSET (size_t) (ADDRS_OFFSET + ADDRS_DLEN)
-#define MAXGETHOSTLEN (size_t) (NAMES_OFFSET + MAXPACKET)
+#define ADDRS_OFFSET (ALIAS_BLEN + ADDRS_BLEN)
+#define ADDRS_DLEN (RES_MAXADDRS * sizeof(struct in_addr))
+#define NAMES_OFFSET (ADDRS_OFFSET + ADDRS_DLEN)
+#define MAXGETHOSTLEN (NAMES_OFFSET + MAXPACKET)
#define AR_TTL 600 /* TTL in seconds for dns cache entries */
* should be named, so for now, we'll just name them this way.
* we probably should look at what named calls them or something.
*/
-#define TYPE_SIZE (size_t) 2
-#define CLASS_SIZE (size_t) 2
-#define TTL_SIZE (size_t) 4
-#define RDLENGTH_SIZE (size_t) 2
+#define TYPE_SIZE 2
+#define CLASS_SIZE 2
+#define TTL_SIZE 4
+#define RDLENGTH_SIZE 2
#define ANSWER_FIXED_SIZE (TYPE_SIZE + CLASS_SIZE + TTL_SIZE + RDLENGTH_SIZE)
/*
* add_local_domain - Add the domain to hostname, if it is missing
* (as suggested by eps@TOASTER.SFSU.EDU)
*/
-void add_local_domain(char* hname, size_t size)
+void add_local_domain(char* hname, unsigned int size)
{
assert(0 != hname);
/*
*/
if ((_res.options & RES_DEFNAMES) && !strchr(hname, '.')) {
if (_res.defdname[0]) {
- size_t len = strlen(hname);
+ unsigned len = strlen(hname);
if ((strlen(_res.defdname) + len + 2) < size) {
hname[len++] = '.';
strcpy(hname + len, _res.defdname);
return 0;
}
-unsigned long cres_mem(struct Client* sptr)
+size_t cres_mem(struct Client* sptr)
{
struct CacheEntry* entry;
struct ResRequest* request;
size_t cache_mem = 0;
- int cache_count = 0;
size_t request_mem = 0;
+ int cache_count = 0;
int request_count = 0;
for (entry = cacheTop; entry; entry = entry->list_next) {
* this replaces the original sendheader macros
*/
static struct {
- const char* message;
- size_t length;
+ const char* message;
+ unsigned int length;
} HeaderMessages [] = {
/* 123456789012345678901234567890123456789012345678901234567890 */
{ "NOTICE AUTH :*** Looking up your hostname\r\n", 43 },
struct sockaddr_in us;
struct sockaddr_in them;
char authbuf[32];
- size_t count;
+ unsigned int count;
assert(0 != auth);
assert(0 != auth->client);
*/
void read_auth_reply(struct AuthRequest* auth)
{
- char* username = 0;
- size_t len;
+ char* username = 0;
+ unsigned int len;
/*
* rfc1453 sez we MUST accept 512 bytes
*/
* net.loads today anyway. Commented out the alarms to save cpu.
* --Run
*/
-size_t deliver_it(struct Client *cptr, const char *str, size_t len)
+unsigned int deliver_it(struct Client *cptr, const char *str, unsigned int len)
{
- size_t bytes_written = 0;
+ unsigned int bytes_written = 0;
assert(0 != cptr);
switch (os_send_nonb(cptr->fd, str, len, &bytes_written)) {
*/
static int read_packet(struct Client *cptr, int socket_ready)
{
- size_t dolen = 0;
- size_t length = 0;
+ unsigned int dolen = 0;
+ unsigned int length = 0;
if (socket_ready && !(IsUser(cptr) && DBufLength(&cptr->recvQ) > CLIENT_FLOOD)) {
switch (os_recv_nonb(cptr->fd, readbuf, sizeof(readbuf), &length)) {
int read_ready;
int write_ready;
- unsigned long timeout;
+ unsigned int timeout;
for ( ; ; ) {
pfd_count = 0;
int nfds;
struct timeval wait;
time_t delay2 = delay;
- unsigned long usec = 0;
+ unsigned int usec = 0;
int res = 0;
int length;
int i;
*/
static int is_comment(const char *comment)
{
- size_t i;
- size_t len = strlen(comment);
+ unsigned int i;
+ unsigned int len = strlen(comment);
for (i = 0; i < len; ++i) {
if (!IsKTimeChar(comment[i]))
return 1;
const char* hname;
for (hname = hp->h_name; hname; hname = hp->h_aliases[i++]) {
- size_t fullnamelen = 0;
- size_t label_count = 0;
+ unsigned int fullnamelen = 0;
+ unsigned int label_count = 0;
ircd_strncpy(fullname, hname, HOSTLEN);
fullname[HOSTLEN] = '\0';
* whee :)
* XXX - if this ever happens, we're already screwed
*/
- if (strlen(host) > (size_t)HOSTLEN ||
- (name ? strlen(name) : 0) > (size_t)HOSTLEN)
+ if (strlen(host) > HOSTLEN ||
+ (name ? strlen(name) : 0) > HOSTLEN)
return (0);
#endif
/*
* Marking as away
*/
- size_t len = strlen(message);
+ unsigned int len = strlen(message);
if (len > TOPICLEN) {
message[TOPICLEN] = '\0';
void add_target(struct Client *sptr, void *target)
{
unsigned char *p;
- unsigned int tmp = ((size_t)target & 0xffff00) >> 8;
+ unsigned int tmp = ((size_t) target & 0xffff00) >> 8;
unsigned char hash = (tmp * tmp) >> 12;
if (sptr->targets[0] == hash) /* Last person that we messaged ourself? */
return;
return; /* Don't bother */
while (DBufLength(&to->sendQ) > 0) {
- size_t len;
+ unsigned int len;
const char* msg = dbuf_map(&to->sendQ, &len);
if ((len = deliver_it(to, msg, len))) {
{
if (!sdbflag && !IsUser(to)) {
char sbuf2[BUFSIZE + 1];
- size_t len = strlen(buf) - 2; /* Remove "\r\n" */
+ unsigned int len = strlen(buf) - 2; /* Remove "\r\n" */
sdbflag = 1;
len = IRCD_MIN(len, BUFSIZE);
void send_buffer(struct Client* to, char* buf)
{
- size_t len;
+ unsigned int len;
assert(0 != to);
assert(0 != buf);
va_start(vl, pattern);
for (member = chptr->members; member; member = member->next_member) {
- if (MyConnect(acptr = member->user) && !IsZombie(member))
+ acptr = member->user;
+ if (MyConnect(acptr) && !IsZombie(member))
vsendto_prefix_one(acptr, from, pattern, vl);
}
va_end(vl);
[ 100000000 , 4294967295 ]
Actually prints like "%09lu" */
{
- unsigned long v1, v2;
+ unsigned long v1;
+ unsigned long v2;
const char *ap;
++format;
v1 = va_arg(vl, unsigned long);
void polludp(int udpfd)
{
struct sockaddr_in from;
- size_t len = 0;
+ unsigned int len = 0;
static time_t last = 0;
static int counter = 0;
char buf[BUFSIZE + 1];
{
struct Whowas *tmp;
int i;
- int u = 0, a = 0;
- size_t um = 0, am = 0;
+ int u = 0;
+ int a = 0;
+ size_t um = 0;
+ size_t am = 0;
+ assert(0 != wwu);
+ assert(0 != wwum);
+ assert(0 != wwa);
+ assert(0 != wwam);
- for (i = 0, tmp = whowas; i < NICKNAMEHISTORYLENGTH; i++, tmp++)
- if (tmp->hashv != WHOWAS_UNUSED)
- {
+ for (i = 0, tmp = whowas; i < NICKNAMEHISTORYLENGTH; i++, tmp++) {
+ if (tmp->hashv != WHOWAS_UNUSED) {
u++;
um += (strlen(tmp->name) + 1);
um += (strlen(tmp->username) + 1);
um += (strlen(tmp->hostname) + 1);
um += (strlen(tmp->servername) + 1);
- if (tmp->away)
- {
+ if (tmp->away) {
a++;
am += (strlen(tmp->away) + 1);
}
}
-
+ }
*wwu = u;
*wwum = um;
*wwa = a;