ANSI fixes
----------
-- Compile with -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast
- Fix any function arg mismatch (use -Werror=) (too many arg)
- Fix format argument related warnings
- Recheck warnings with -Wall
}
}
- sendto_realops("remove_from_list(%x, %x) failed!!", (int) list, (int) ptr);
+ sendto_realops("remove_from_list(%p, %p) failed!!", list, ptr);
}
#include <sys/types.h>
#include <sys/resource.h>
#include <sys/socket.h>
+#include <stdint.h>
#include <pwd.h>
#include <signal.h>
#include <fcntl.h>
was_here = YES;
#ifdef USE_SYSLOG
- (void) syslog(LOG_WARNING, "Restarting Server because: %s, sbrk(0)-etext: %d",
- mesg, (u_int) sbrk((size_t) 0) - (u_int) sbrk0);
+ (void) syslog(LOG_WARNING, "Restarting Server because: %s, sbrk(0)-etext: %lld",
+ mesg, (intptr_t)sbrk((size_t)0) - (intptr_t)sbrk0);
#endif
server_reboot();
}
void server_reboot()
{
int i;
- sendto_ops("Aieeeee!!! Restarting server... sbrk(0)-etext: %d",
- (u_int) sbrk((size_t) 0) - (u_int) sbrk0);
-
+ sendto_ops("Aieeeee!!! Restarting server... sbrk(0)-etext: %lld",
+ (intptr_t)sbrk((size_t)0) - (intptr_t)sbrk0);
+
Debug((DEBUG_NOTICE, "Restarting server..."));
dump_connections(me.fd);
/*
#include <sys/stat.h>
#include <utmp.h>
#include <fcntl.h>
+#include <stdint.h>
#include "h.h"
#include "zlink.h"
#include "userban.h"
me.name, RPL_STATSDEBUG, nick, totww, totch, totcl, totmisc,
/*db,*/ tothash, rm, linkallocsz, fludallocsz, totuban);
- sendto_one(cptr, ":%s %d %s :TOTAL: %d sbrk(0)-etext: %u",
+ sendto_one(cptr, ":%s %d %s :TOTAL: %d sbrk(0)-etext: %lld",
me.name, RPL_STATSDEBUG, nick, tot,
- (u_int) sbrk((size_t) 0) - (u_int) sbrk0);
+ (intptr_t)sbrk((size_t)0) - (intptr_t)sbrk0);
return;
}
if(hk->owner == owner)
{
sendto_realops_lev(DEBUG_LEV, "Module cleanup: removing hook [%s]"
- " for opaque %d", get_texthooktype(hk->hooktype),
- (int) owner);
+ " for opaque %p", get_texthooktype(hk->hooktype),
+ owner);
hooklist = get_hooklist((enum c_hooktype) hk->hooktype);
if(!(owner = find_module_opaque(opaque)))
{
sendto_realops_lev(DEBUG_LEV, "Module tried to add hooktype %d with"
- " unknown opaque 0x%x", (int) hooktype, (int) opaque);
+ " unknown opaque %p", (int) hooktype, opaque);
return NULL;
}
static unsigned int hash_cp(char *cp)
{
- return ((unsigned int) cp) % ARES_IDCACSIZE;
+ return (unsigned int)((intptr_t)cp) % ARES_IDCACSIZE;
}
/* Add a new cache item to the queue and hash table. */
#include "socketengine.h"
#include <sys/poll.h>
+#include <stdint.h>
static void engine_get_pollfds(struct pollfd **pfds, int *numpfds);
struct pollfd poll_fds[MAXCONNECTIONS];
-int last_pfd = -1;
+intptr_t last_pfd = -1;
void engine_init(void)
{
void engine_del_fd(int fd)
{
- int arrayidx = (int) get_fd_internal(fd);
+ intptr_t arrayidx = (intptr_t)get_fd_internal(fd);
/* If it's at the end of the array, just chop it off */
if(arrayidx == last_pfd)
void engine_change_fd_state(int fd, unsigned int stateplus)
{
- int arrayidx = (int) get_fd_internal(fd);
+ intptr_t arrayidx = (intptr_t)get_fd_internal(fd);
struct pollfd *pfd = &poll_fds[arrayidx];
pfd->events = 0;