CLEANUP: Standardize on uint32_t instead of u_int32_t
authorRemco Rijnders <remmy@serenity-irc.net>
Mon, 26 Jan 2026 21:51:10 +0000 (21:51 +0000)
committerRemco Rijnders <remmy@serenity-irc.net>
Mon, 26 Jan 2026 21:51:10 +0000 (21:51 +0000)
Config
Makefile.dist
include/h.h
include/struct.h
src/ircd.c
src/md5.c
src/s_user.c

diff --git a/Config b/Config
index 4bda7cc7a429b532c1bfbb1f87da106b5a230365..826d5989fd81a2e6c6e0197c4a0a09511cc8451b 100755 (executable)
--- 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 <sys/types.h>
-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
index d6f7f6a239312d737a96f8e86ff098a07f0e98de..529c29a126a4831b2d2a69e5013ab895edcf1d14 100755 (executable)
@@ -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
index e627895e96fd58dd9a1c5a5cf0db11a003654ff7..58d76d92b89e26dfd757ba2abcb2243f24d04925 100644 (file)
@@ -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"
index 4d984ae326e9d4ed105a5469fd54a72125813a08..6d766c370e87f567dce5cf7f12565159f0d8fe8b 100644 (file)
@@ -55,10 +55,6 @@ typedef struct  Zdata   aZdata;
 #include <zlib.h>
 #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 */
index 49fd9f9898e05cd2cd15743d495f2d60f0f3244a..683f0dc27ac220cc61e6ce87900dfa1fb2396c06 100644 (file)
@@ -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;
index e0f1f5762f12310800dd74505ac98ccf9aa2c1e9..64513613d9848d230e3a662d78115ec892e550f7 100644 (file)
--- 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];
index dea25c1b0b136476fcec27ee3ec42cde607b2475..d480fb354e6584ca4c6c3bcac23886c34cc7932c 100644 (file)
@@ -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))