From: Remco Rijnders Date: Mon, 26 Jan 2026 21:51:10 +0000 (+0000) Subject: CLEANUP: Standardize on uint32_t instead of u_int32_t X-Git-Url: http://git.serene-ircd.net/?a=commitdiff_plain;h=2176dc81a3305e039cc65fc6c422357a1db5531d;p=serene-ircd.git CLEANUP: Standardize on uint32_t instead of u_int32_t --- diff --git a/Config b/Config index 4bda7cc..826d598 100755 --- a/Config +++ b/Config @@ -693,28 +693,6 @@ if [ $? -ne 0 -o "$OSNAME" = "Linux RedHat 5.0" -o -n "$NEEDSKIPNAME" -o "$GLIBC fi $RM -f $EXEC $TMP cat > $TMP <<__EOF__ -#include -int main(void) -{ - u_int32_t foo; - return 0; -} -__EOF__ -$COMP >/dev/null 2>&1 -if [ $? -ne 0 ] ; then - echo $n " u_int32_t$c" - $RM -f Makefile.tmp - sed -e "s@^NEED_U_INT32_T=\(.*\)@NEED_U_INT32_T=-DNEED_U_INT32_T@" Makefile > Makefile.tmp - cp Makefile.tmp Makefile - $RM -f Makefile.tmp -else - $RM -f Makefile.tmp - sed -e "s@^NEED_U_INT32_T=\(.*\)@NEED_U_INT32_T=@" Makefile > Makefile.tmp - cp Makefile.tmp Makefile - $RM -f Makefile.tmp -fi -$RM -f $EXEC $TMP -cat > $TMP <<__EOF__ #$STRINGH STRINGH #$STRINGSH STRINGSH #ifdef STRINGH diff --git a/Makefile.dist b/Makefile.dist index d6f7f6a..529c29a 100755 --- a/Makefile.dist +++ b/Makefile.dist @@ -44,13 +44,7 @@ IRCDMODE = 711 # IRCDDIR=/usr/local/lib/ircd -# [CHANGEME] -# If you get a compile-time error dealing with u_int32_t, comment out -# this line. -# NEED_U_INT32_T= -DNEED_U_INT32_T -NEED_U_INT32_T= - -CFLAGS=-I$(INCLUDEDIR) $(XCFLAGS) $(NEED_U_INT32_T) +CFLAGS=-I$(INCLUDEDIR) $(XCFLAGS) $(NEED_U_INT32_T) SHELL=/bin/sh SUBDIRS=src diff --git a/include/h.h b/include/h.h index e627895..58d76d9 100644 --- a/include/h.h +++ b/include/h.h @@ -36,7 +36,7 @@ extern time_t check_pings(time_t now, int check_kills); InnerFIRE */ #ifdef NOSPOOF -extern u_int32_t NOSPOOF_SEED01, NOSPOOF_SEED02 ; +extern uint32_t NOSPOOF_SEED01, NOSPOOF_SEED02 ; #endif /* NOSPOOF*/ #define BREPORT_DO_DNS "NOTICE AUTH :*** Looking up your hostname...\r\n" diff --git a/include/struct.h b/include/struct.h index 4d984ae..6d766c3 100644 --- a/include/struct.h +++ b/include/struct.h @@ -55,10 +55,6 @@ typedef struct Zdata aZdata; #include #endif -#ifdef NEED_U_INT32_T -typedef unsigned int u_int32_t; /* XXX Hope this works! */ -#endif - #include "class.h" #include "dbuf.h" /* THIS REALLY SHOULDN'T BE HERE!!! --msa */ @@ -537,7 +533,7 @@ struct User { Link *silence; /* chain of silence pointer blocks */ char *away; /* pointer to away message */ time_t last; - u_int32_t servicestamp; /* Services' time stamp variable */ + uint32_t servicestamp; /* Services' time stamp variable */ int refcnt; /* Number of times this block is referenced */ int joined; /* number of channels joined */ char username[USERLEN+1]; @@ -588,7 +584,7 @@ struct SynchList { struct Event { void (*func)(char *); char arg[ARGLEN+1]; - u_int32_t exectime; + uint32_t exectime; aEvent *next, *prev; }; @@ -644,7 +640,7 @@ struct Client { dbuf sendQ; /* Outgoing message queue--if socket full */ dbuf recvQ; /* Hold for data incoming yet to be parsed */ #ifdef NOSPOOF - u_int32_t nospoof; /* Anti-spoofing random number */ + uint32_t nospoof; /* Anti-spoofing random number */ #endif long oflag; /* Operator access flags -Cabal95 */ long proto; /* ProtoCtl options */ diff --git a/src/ircd.c b/src/ircd.c index 49fd9f9..683f0dc 100644 --- a/src/ircd.c +++ b/src/ircd.c @@ -39,7 +39,7 @@ char *malloc_options = "h" MALLOC_FLAGS_EXTRA; #endif #ifdef NOSPOOF -u_int32_t NOSPOOF_SEED01, NOSPOOF_SEED02; +uint32_t NOSPOOF_SEED01, NOSPOOF_SEED02; #endif /* NOSPOOF */ int R_do_dns, R_fin_dns, R_fin_dnsc, R_fail_dns, R_do_id, R_fin_id, R_fail_id; diff --git a/src/md5.c b/src/md5.c index e0f1f57..6451361 100644 --- a/src/md5.c +++ b/src/md5.c @@ -51,7 +51,7 @@ * QUESTION: Replace this with SHA, which as generally received better * reviews from the cryptographic community? */ -void MD5Init (u_int32_t buf[4]) +void MD5Init (uint32_t buf[4]) { buf[0] = 0x67452301; buf[1] = 0xefcdab89; @@ -75,9 +75,9 @@ void MD5Init (u_int32_t buf[4]) * The core of the MD5 algorithm, this alters an existing MD5 hash to * reflect the addition of 16 longwords of new data. */ -void MD5Transform (u_int32_t buf[4], u_int32_t in[16]) +void MD5Transform (uint32_t buf[4], uint32_t in[16]) { - u_int32_t a, b, c, d; + uint32_t a, b, c, d; a = buf[0]; b = buf[1]; diff --git a/src/s_user.c b/src/s_user.c index dea25c1..d480fb3 100644 --- a/src/s_user.c +++ b/src/s_user.c @@ -47,8 +47,8 @@ int ZLineExists (char *); #ifdef NOSPOOF /* From md5.c */ -void MD5Init (u_int32_t[]); -void MD5Transform (u_int32_t[], u_int32_t[]); +void MD5Init (uint32_t[]); +void MD5Transform (uint32_t[], uint32_t[]); #endif /* @@ -867,8 +867,8 @@ int m_nick (cptr, sptr, parc, parv) int differ = 1; #ifdef NOSPOOF - u_int32_t md5data[16]; - static u_int32_t md5hash[4]; + uint32_t md5data[16]; + static uint32_t md5hash[4]; #endif /* @@ -2259,7 +2259,7 @@ int m_user (cptr, sptr, parc, parv) { #define UFLAGS (UMODE_INVISIBLE|UMODE_SERVNOTICE) char *username, *host, *server, *realname; - u_int32_t sstamp = 0; + uint32_t sstamp = 0; anUser *user; if (IsServer (cptr) && !IsUnknown (sptr))