diff --git a/ChangeLog b/ChangeLog index 3a03e270..b318b94c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ $Id$ + WARNING, DO NOT USE !!!! v0.81.1 09-Oct-2005 diff --git a/README.developer b/README.developer index 70a5c8bb..4dfe165f 100644 --- a/README.developer +++ b/README.developer @@ -8,6 +8,19 @@ development only. There are no secrets in this file because it's public available. + Wordlengths. + +From bits/types.h: + + Here we assume what is presently the case in all the GCC configurations + we support: long long is always 64 bits, long is always word/address size, + and int is always 32 bits. + +IOW: Never use long in the sources because it breaks between 32/64 bit +hardware. + +How about time_t, it seems an alias for long! + CVS tags. diff --git a/lib/attach.c b/lib/attach.c index 9bc361e6..8f671667 100644 --- a/lib/attach.c +++ b/lib/attach.c @@ -160,7 +160,7 @@ int check_flo(faddr *node, char *filename, char flavor) { char *flofile, *ticfile, *buf; FILE *fp; - long filepos, newpos; + int filepos, newpos; char tpl = '~'; int rc = 0; diff --git a/lib/batchrd.c b/lib/batchrd.c index 3fd33159..16b60a72 100644 --- a/lib/batchrd.c +++ b/lib/batchrd.c @@ -4,7 +4,7 @@ * Purpose ...............: Batch reading * ***************************************************************************** - * Copyright (C) 1997-2004 + * Copyright (C) 1997-2005 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -32,7 +32,7 @@ #include "mbselib.h" -static long counter = 0L; +static int counter = 0L; static int batchmode = -1; int usetmp = 0; @@ -42,18 +42,18 @@ char *bgets(char *buf, int count, FILE *fp) return fgets(buf,count,fp); } - if ((batchmode == 1) && (counter > 0L) && (counter < (long)(count-1))) - count=(int)(counter+1L); + if ((batchmode == 1) && (counter > 0L) && (counter < (count-1))) + count=(counter+1); if (fgets(buf,count,fp) == NULL) return NULL; switch (batchmode) { case -1: if (!strncmp(buf,"#! rnews ",9) || !strncmp(buf,"#!rnews ",8)) { batchmode=1; - sscanf(buf+8,"%ld",&counter); - Syslog('m', "first chunk of input batch: %ld",counter); - if (counter < (long)(count-1)) - count=(int)(counter+1L); + sscanf(buf+8,"%d",&counter); + Syslog('m', "first chunk of input batch: %d",counter); + if (counter < (count-1)) + count=(counter+1); if (fgets(buf,count,fp) == NULL) return NULL; else { @@ -73,12 +73,12 @@ char *bgets(char *buf, int count, FILE *fp) if (fgets(buf,count,fp) == NULL) return NULL; } - sscanf(buf+8,"%ld",&counter); - Syslog('m', "next chunk of input batch: %ld",counter); + sscanf(buf+8,"%d",&counter); + Syslog('m', "next chunk of input batch: %d",counter); return NULL; } else { - counter -= (long)strlen(buf); - Syslog('m', "bread \"%s\", %ld left of this chunk", buf,counter); + counter -= strlen(buf); + Syslog('m', "bread \"%s\", %d left of this chunk", buf,counter); return buf; } } diff --git a/lib/bluewave.h b/lib/bluewave.h index d868d95f..ab79af98 100644 --- a/lib/bluewave.h +++ b/lib/bluewave.h @@ -93,8 +93,8 @@ typedef signed char tCHAR; /* 8 bit signed values */ typedef unsigned char tBYTE; /* 8 bit unsigned values */ typedef signed short tINT; /* 16 bit signed values */ typedef unsigned short tWORD; /* 16 bit unsigned values */ -typedef signed long tLONG; /* 32 bit signed values */ -typedef unsigned long tDWORD; /* 32 bit unsigned values */ +typedef int tLONG; /* 32 bit signed values */ +typedef unsigned int tDWORD; /* 32 bit unsigned values */ diff --git a/lib/clcomm.c b/lib/clcomm.c index 06109309..d3922702 100644 --- a/lib/clcomm.c +++ b/lib/clcomm.c @@ -4,7 +4,7 @@ * Purpose ...............: Client/Server communications * ***************************************************************************** - * Copyright (C) 1997-2004 + * Copyright (C) 1997-2005 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -41,9 +41,9 @@ char logdebug[PATH_MAX]; /* Debug logfile */ char logfile[PATH_MAX]; /* Normal logfile */ char errfile[PATH_MAX]; /* Error logfile */ char mgrfile[PATH_MAX]; /* Area/File- mgr logfile */ -long loggrade; /* Logging grade */ +int loggrade; /* Logging grade */ pid_t mypid; /* Original parent pid if child */ -unsigned long lcrc = 0, tcrc = 1; /* CRC value of logstring */ +unsigned int lcrc = 0, tcrc = 1; /* CRC value of logstring */ int lcnt = 0; /* Same message counter */ static char *pbuff = NULL; extern char cpath[108]; @@ -100,7 +100,7 @@ char *xstrcat(char *src, char *add) -void InitClient(char *user, char *myname, char *where, char *logfname, long loggr, char *err, char *mgr, char *debug) +void InitClient(char *user, char *myname, char *where, char *logfname, int loggr, char *err, char *mgr, char *debug) { if ((getenv("MBSE_ROOT")) == NULL) { printf("Could not get the MBSE_ROOT environment variable\n"); @@ -261,7 +261,7 @@ void Syslog(int level, const char *format, ...) */ void Syslogp(int level, char *outstr) { - long mask = 0; + int mask = 0; int i, upper, debug; debug = isalpha(level); @@ -412,7 +412,7 @@ void DoNop() -static time_t nop = 0; +static int32_t nop = 0; /* * This function can be called very often but will only send once a minute @@ -445,23 +445,23 @@ void Altime(int altime) -unsigned long sequencer() +unsigned int sequencer() { - char *buf, *res; - unsigned long seq = 0; + char *buf, *res; + unsigned int seq = 0; - buf = calloc(SS_BUFSIZE, sizeof(char)); - snprintf(buf, SS_BUFSIZE, "SSEQ:0;"); + buf = calloc(SS_BUFSIZE, sizeof(char)); + snprintf(buf, SS_BUFSIZE, "SSEQ:0;"); - if (socket_send(buf) == 0) { - free(buf); - buf = socket_receive(); - res = strtok(buf, ","); - res = strtok(NULL, ";"); - seq = atol(res); - } + if (socket_send(buf) == 0) { + free(buf); + buf = socket_receive(); + res = strtok(buf, ","); + res = strtok(NULL, ";"); + seq = atol(res); + } - return seq; + return seq; } @@ -470,14 +470,14 @@ unsigned long sequencer() * Check enough diskspace. * return 0=No, 1=Yes, 2=Unknown, 3=Error */ -int enoughspace(unsigned long needed) +int enoughspace(unsigned int needed) { char *buf, *res; int rc = 3, cnt; - unsigned long avail = 0L; + unsigned int avail = 0L; buf = calloc(SS_BUFSIZE, sizeof(char)); - snprintf(buf, SS_BUFSIZE, "DSPC:1,%ld;", needed); + snprintf(buf, SS_BUFSIZE, "DSPC:1,%d;", needed); if (socket_send(buf) == 0) { snprintf(buf, SS_BUFSIZE, "%s", socket_receive()); diff --git a/lib/crc.c b/lib/crc.c index d679db0a..e882bf31 100644 --- a/lib/crc.c +++ b/lib/crc.c @@ -4,7 +4,7 @@ * Purpose ...............: Crc32 and Crc16 calculations * ***************************************************************************** - * Copyright (C) 1993-2004 + * Copyright (C) 1993-2005 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -70,7 +70,7 @@ /* using byte-swap instructions. */ -unsigned long crc32tab[] = { /* CRC polynomial 0xedb88320 */ +unsigned int crc32tab[] = { /* CRC polynomial 0xedb88320 */ 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, @@ -181,14 +181,14 @@ unsigned short crc16ccitttab[256] = /* CRC polynomial 0x8408 */ -unsigned long crc32ccitt(char *str, int l) +unsigned int crc32ccitt(char *str, int l) { - unsigned long crc; + unsigned int crc; - for (crc = 0xffffffffL; l--; str++) - crc = crc32tab[((int) crc ^ (*str)) & 0xff] ^ ((crc >> 8) & 0x00ffffffL); + for (crc = 0xffffffffL; l--; str++) + crc = crc32tab[((int) crc ^ (*str)) & 0xff] ^ ((crc >> 8) & 0x00ffffffL); - return crc; + return crc; } @@ -209,24 +209,24 @@ unsigned short crc16ccitt(char *str, int l) /* * Calculate the CRC of a string. */ -unsigned long str_crc32(char *str) +unsigned int str_crc32(char *str) { - unsigned long crc; + unsigned int crc; - for (crc=0L; *str; str++) - crc = crc32tab[((int)crc^(*str)) & 0xff] ^ ((crc>>8) & 0x00ffffffL); - return crc; + for (crc=0L; *str; str++) + crc = crc32tab[((int)crc^(*str)) & 0xff] ^ ((crc>>8) & 0x00ffffffL); + return crc; } -unsigned long StringCRC32(char *str) +unsigned int StringCRC32(char *str) { - unsigned long crc; + unsigned int crc; - for (crc = 0xffffffffL; *str; str++) - crc = crc32tab[((int)crc^(*str)) & 0xff] ^ ((crc>>8) & 0x00ffffffL); - return crc; + for (crc = 0xffffffffL; *str; str++) + crc = crc32tab[((int)crc^(*str)) & 0xff] ^ ((crc>>8) & 0x00ffffffL); + return crc; } @@ -234,16 +234,16 @@ unsigned long StringCRC32(char *str) /* * Update CRC32, first initialize crc with 0xffffffff */ -unsigned long upd_crc32(char *buf, unsigned long crc, int len) +unsigned int upd_crc32(char *buf, unsigned int crc, int len) { - int i; - unsigned long cr; + int i; + unsigned int cr; - cr = crc; - for (i = 0; i < len; i++) { - cr = (crc32tab[((int)cr ^ ((long)buf[i])) & 0xff] ^ ((((unsigned long)cr) >> 8) & 0x00ffffffL)); - } - return cr; + cr = crc; + for (i = 0; i < len; i++) { + cr = (crc32tab[((int)cr ^ ((int)buf[i])) & 0xff] ^ ((((unsigned int)cr) >> 8) & 0x00ffffffL)); + } + return cr; } @@ -252,18 +252,18 @@ unsigned long upd_crc32(char *buf, unsigned long crc, int len) * return normalized CRC32 value, which means put al bytes in the * normal (not for comms) order. */ -unsigned long norm_crc32(unsigned long crc) +unsigned int norm_crc32(unsigned int crc) { - unsigned long L; + unsigned int L; - L = crc & 0x000000ffL; - L <<= 8; - L |= ((crc >> 8) & 0x000000ffL); - L <<= 8; - L |= ((crc >> 16) & 0x000000ffL); - L <<= 8; - L |= ((crc >> 24) & 0x000000ffL); - return L; + L = crc & 0x000000ffL; + L <<= 8; + L |= ((crc >> 8) & 0x000000ffL); + L <<= 8; + L |= ((crc >> 16) & 0x000000ffL); + L <<= 8; + L |= ((crc >> 24) & 0x000000ffL); + return L; } diff --git a/lib/dbdupe.c b/lib/dbdupe.c index 00e7cd60..9386df03 100644 --- a/lib/dbdupe.c +++ b/lib/dbdupe.c @@ -4,7 +4,7 @@ * Purpose ...............: Dupe checking. * ***************************************************************************** - * Copyright (C) 1997-2004 + * Copyright (C) 1997-2005 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -37,7 +37,7 @@ typedef struct _dupesrec { - unsigned long *crcs; + unsigned int *crcs; int loaded; int changed; int count; @@ -70,11 +70,11 @@ void InitDupes() -int CheckDupe(unsigned long crc, int idx, int max) +int CheckDupe(unsigned int crc, int idx, int max) { char *dfile; FILE *fil; - unsigned long test; + unsigned int test; int i, size = 0; if (!dupes[idx].loaded) { @@ -93,7 +93,7 @@ int CheckDupe(unsigned long crc, int idx, int max) fil = fopen(dfile, "r+"); } else { fseek(fil, 0L, SEEK_END); - size = ftell(fil) / sizeof(unsigned long); + size = ftell(fil) / sizeof(unsigned int); fseek(fil, 0L, SEEK_SET); } @@ -104,8 +104,8 @@ int CheckDupe(unsigned long crc, int idx, int max) dupes[idx].peak = size + 5000; else dupes[idx].peak = max + 5000; - dupes[idx].crcs = (unsigned long *)malloc(dupes[idx].peak * sizeof(unsigned long)); - memset(dupes[idx].crcs, 0, dupes[idx].peak * sizeof(unsigned long)); + dupes[idx].crcs = (unsigned int *)malloc(dupes[idx].peak * sizeof(unsigned int)); + memset(dupes[idx].crcs, 0, dupes[idx].peak * sizeof(unsigned int)); /* * Load dupe records @@ -158,7 +158,7 @@ void CloseDdb(int idx) snprintf(dfile, PATH_MAX -1, "%s/etc/%s.dupe", getenv("MBSE_ROOT"), files[idx]); if ((fil = fopen(dfile, "w"))) { for (j = start; j < dupes[idx].count; j++) - fwrite(&dupes[idx].crcs[j], sizeof(unsigned long), 1, fil); + fwrite(&dupes[idx].crcs[j], sizeof(unsigned int), 1, fil); fclose(fil); } else { WriteError("$Can't write %s", dfile); diff --git a/lib/dbfdb.c b/lib/dbfdb.c index cadc90c7..61276ec6 100644 --- a/lib/dbfdb.c +++ b/lib/dbfdb.c @@ -40,7 +40,7 @@ * Open files database Area number. Do some checks and abort * if they fail. */ -struct _fdbarea *mbsedb_OpenFDB(long Area, int Timeout) +struct _fdbarea *mbsedb_OpenFDB(int Area, int Timeout) { char *temp; struct _fdbarea *fdb_area = NULL; @@ -50,23 +50,23 @@ struct _fdbarea *mbsedb_OpenFDB(long Area, int Timeout) temp = calloc(PATH_MAX, sizeof(char)); fdb_area = malloc(sizeof(struct _fdbarea)); /* Will be freed by CloseFDB */ - snprintf(temp, PATH_MAX -1, "%s/var/fdb/file%ld.data", getenv("MBSE_ROOT"), Area); + snprintf(temp, PATH_MAX -1, "%s/var/fdb/file%d.data", getenv("MBSE_ROOT"), Area); /* * Open the file database, if it's locked, just wait. */ while (((fp = fopen(temp, "r+")) == NULL) && ((errno == EACCES) || (errno == EAGAIN))) { if (++Tries >= (Timeout * 4)) { - WriteError("Can't open file area %ld, timeout", Area); + WriteError("Can't open file area %d, timeout", Area); free(temp); return NULL; } msleep(250); - Syslog('f', "Open file area %ld, try %d", Area, Tries); + Syslog('f', "Open file area %d, try %d", Area, Tries); } if (fp == NULL) { if (errno == ENOENT) { - Syslog('+', "Create empty FDB for area %ld", Area); + Syslog('+', "Create empty FDB for area %d", Area); fdbhdr.hdrsize = sizeof(fdbhdr); fdbhdr.recsize = sizeof(fdb); if ((fp = fopen(temp, "w+"))) { @@ -100,7 +100,7 @@ struct _fdbarea *mbsedb_OpenFDB(long Area, int Timeout) fseek(fp, 0, SEEK_END); if ((ftell(fp) - fdbhdr.hdrsize) % fdbhdr.recsize) { - WriteError("Files database area %ld is corrupt, unalligned records", Area); + WriteError("Files database area %d is corrupt, unalligned records", Area); fclose(fp); return NULL; } @@ -146,7 +146,7 @@ int mbsedb_LockFDB(struct _fdbarea *fdb_area, int Timeout) while ((rc = fcntl(fileno(fdb_area->fp), F_SETLK, &fl)) && ((errno == EACCES) || (errno == EAGAIN))) { if (++Tries >= (Timeout * 4)) { fcntl(fileno(fdb_area->fp), F_GETLK, &fl); - WriteError("FDB %ld is locked by pid %d", fdb_area->area, fl.l_pid); + WriteError("FDB %d is locked by pid %d", fdb_area->area, fl.l_pid); return FALSE; } msleep(250); @@ -154,7 +154,7 @@ int mbsedb_LockFDB(struct _fdbarea *fdb_area, int Timeout) } if (rc) { - WriteError("$FDB %ld lock error", fdb_area->area); + WriteError("$FDB %d lock error", fdb_area->area); return FALSE; } @@ -187,8 +187,8 @@ int mbsedb_UnlockFDB(struct _fdbarea *fdb_area) -void mbsedb_Temp2Data(unsigned long); -void mbsedb_Temp2Data(unsigned long fdb_area) +void mbsedb_Temp2Data(unsigned int); +void mbsedb_Temp2Data(unsigned int fdb_area) { char *temp1, *temp2; @@ -200,12 +200,12 @@ void mbsedb_Temp2Data(unsigned long fdb_area) * we will give that a new name on disk. Then we move the temp in place. * Finaly remove the old (still locked) original file. */ - snprintf(temp2, PATH_MAX -1, "%s/var/fdb/file%ld.data", getenv("MBSE_ROOT"), fdb_area); - snprintf(temp1, PATH_MAX -1, "%s/var/fdb/file%ld.xxxx", getenv("MBSE_ROOT"), fdb_area); + snprintf(temp2, PATH_MAX -1, "%s/var/fdb/file%d.data", getenv("MBSE_ROOT"), fdb_area); + snprintf(temp1, PATH_MAX -1, "%s/var/fdb/file%d.xxxx", getenv("MBSE_ROOT"), fdb_area); rename(temp2, temp1); - snprintf(temp1, PATH_MAX -1, "%s/var/fdb/file%ld.temp", getenv("MBSE_ROOT"), fdb_area); + snprintf(temp1, PATH_MAX -1, "%s/var/fdb/file%d.temp", getenv("MBSE_ROOT"), fdb_area); rename(temp1, temp2); - snprintf(temp1, PATH_MAX -1, "%s/var/fdb/file%ld.xxxx", getenv("MBSE_ROOT"), fdb_area); + snprintf(temp1, PATH_MAX -1, "%s/var/fdb/file%d.xxxx", getenv("MBSE_ROOT"), fdb_area); unlink(temp1); free(temp1); @@ -241,7 +241,7 @@ int mbsedb_InsertFDB(struct _fdbarea *fdb_area, struct FILE_record frec, int Add * There are files, search the insert point. */ temp = calloc(PATH_MAX, sizeof(char)); - snprintf(temp, PATH_MAX -1, "%s/var/fdb/file%ld.temp", getenv("MBSE_ROOT"), fdb_area->area); + snprintf(temp, PATH_MAX -1, "%s/var/fdb/file%d.temp", getenv("MBSE_ROOT"), fdb_area->area); fseek(fdb_area->fp, fdbhdr.hdrsize, SEEK_SET); Insert = 0; do { @@ -356,7 +356,7 @@ int mbsedb_PackFDB(struct _fdbarea *fdb_area) * There are files, copy the remaining entries */ temp = calloc(PATH_MAX, sizeof(char)); - snprintf(temp, PATH_MAX -1, "%s/var/fdb/file%ld.temp", getenv("MBSE_ROOT"), fdb_area->area); + snprintf(temp, PATH_MAX -1, "%s/var/fdb/file%d.temp", getenv("MBSE_ROOT"), fdb_area->area); if ((fp = fopen(temp, "a+")) == NULL) { WriteError("$Can't create %s", temp); mbsedb_UnlockFDB(fdb_area); @@ -494,7 +494,7 @@ int mbsedb_SortFDB(struct _fdbarea *fdb_area) } temp = calloc(PATH_MAX, sizeof(char)); - snprintf(temp, PATH_MAX -1, "%s/var/fdb/file%ld.temp", getenv("MBSE_ROOT"), fdb_area->area); + snprintf(temp, PATH_MAX -1, "%s/var/fdb/file%d.temp", getenv("MBSE_ROOT"), fdb_area->area); if ((fp = fopen(temp, "a+")) == NULL) { WriteError("$Can't create %s", temp); mbsedb_UnlockFDB(fdb_area); diff --git a/lib/dbmsgs.c b/lib/dbmsgs.c index ff287456..770bf251 100644 --- a/lib/dbmsgs.c +++ b/lib/dbmsgs.c @@ -36,11 +36,11 @@ char msgs_fil[PATH_MAX]; /* Database filename */ char mgrp_fil[PATH_MAX]; /* Group database filename */ -long msgs_pos = -1; /* Current record position */ -long mgrp_pos = -1; /* Current group position */ -unsigned long msgs_crc = -1; /* CRC value of current record */ -unsigned long mgrp_crc = -1; /* CRC value of group record */ -static long sysstart, sysrecord; +int msgs_pos = -1; /* Current record position */ +int mgrp_pos = -1; /* Current group position */ +unsigned int msgs_crc = -1; /* CRC value of current record */ +unsigned int mgrp_crc = -1; /* CRC value of group record */ +static int sysstart, sysrecord; @@ -324,7 +324,7 @@ int SearchNetBoard(unsigned short zone, unsigned short net) void UpdateMsgs() { - unsigned long crc = 0xffffffff; + unsigned int crc = 0xffffffff; FILE *fil; if (msgs_pos == -1) diff --git a/lib/dbnode.c b/lib/dbnode.c index dc282307..3c0d62a4 100644 --- a/lib/dbnode.c +++ b/lib/dbnode.c @@ -36,10 +36,10 @@ char nodes_fil[PATH_MAX]; /* Nodes database filename */ -long nodes_pos = -1; /* Noderecord position */ -long nodes_fgp = -1; /* Nodes files group position */ -long nodes_mgp = -1; /* Nodes message group position */ -unsigned long nodes_crc = -1; /* Noderecord crc value */ +int nodes_pos = -1; /* Noderecord position */ +int nodes_fgp = -1; /* Nodes files group position */ +int nodes_mgp = -1; /* Nodes message group position */ +unsigned int nodes_crc = -1; /* Noderecord crc value */ @@ -130,7 +130,7 @@ int SearchNode(fidoaddr aka) */ int UpdateNode() { - unsigned long crc; + unsigned int crc; FILE *fil; if (nodes_pos == -1) diff --git a/lib/dbtic.c b/lib/dbtic.c index b0bda6ca..8213b4eb 100644 --- a/lib/dbtic.c +++ b/lib/dbtic.c @@ -37,11 +37,11 @@ char tic_fil[PATH_MAX]; /* Database filename */ char tgrp_fil[PATH_MAX]; /* Group database filename */ -long tic_pos = -1; /* Current record position */ -long tgrp_pos = -1; /* Current group position */ -unsigned long tic_crc = -1; /* CRC value of current record */ -unsigned long tgrp_crc = -1; /* CRC value of group record */ -static long sysstart, sysrecord; +int tic_pos = -1; /* Current record position */ +int tgrp_pos = -1; /* Current group position */ +unsigned int tic_crc = -1; /* CRC value of current record */ +unsigned int tgrp_crc = -1; /* CRC value of group record */ +static int sysstart, sysrecord; @@ -263,7 +263,7 @@ int GetTicSystem(sysconnect * Sys, int First) void UpdateTic() { - unsigned long crc = 0xffffffff; + unsigned int crc = 0xffffffff; FILE *fil; if (tic_pos == -1) diff --git a/lib/diesel.c b/lib/diesel.c index c0e8e716..5079deb0 100644 --- a/lib/diesel.c +++ b/lib/diesel.c @@ -1321,7 +1321,7 @@ Mfunc(f_time) { ArgCount(0, 0); - V snprintf(output, MAXSTR, "%ld", (long) time((time_t *) NULL)); + V snprintf(output, MAXSTR, "%d", (int32_t) time((time_t *) NULL)); return TRUE; } #endif /* UNIXTENSIONS */ diff --git a/lib/ftn.c b/lib/ftn.c index 914ecddb..a4f88bef 100644 --- a/lib/ftn.c +++ b/lib/ftn.c @@ -215,7 +215,7 @@ faddr *parsefaddr(char *s) int gotzone = 0, gotnet = 0, gotnode = 0, gotpoint = 0; int zone = 0, net = 0, noden = 0, point = 0; char *domain = NULL, *freename = NULL; - long num; + int num; char *p = NULL,*q = NULL,*t = NULL; int l, quoted; FILE *fp; diff --git a/lib/ftnmsg.c b/lib/ftnmsg.c index f2c40427..a2bff44e 100644 --- a/lib/ftnmsg.c +++ b/lib/ftnmsg.c @@ -44,17 +44,17 @@ static char *months[] = { char *ftndate(time_t t) { - static char buf[32]; - struct tm *ptm; + static char buf[32]; + struct tm *ptm; - ptm = localtime(&t); - if (ptm->tm_sec > 59) - ptm->tm_sec = 59; + ptm = localtime(&t); + if (ptm->tm_sec > 59) + ptm->tm_sec = 59; - snprintf(buf, 32, "%02d %s %02d %02d:%02d:%02d",ptm->tm_mday, + snprintf(buf, 32, "%02d %s %02d %02d:%02d:%02d",ptm->tm_mday, months[ptm->tm_mon], ptm->tm_year%100, ptm->tm_hour, ptm->tm_min, ptm->tm_sec); - return buf; + return buf; } @@ -120,14 +120,14 @@ FILE *ftnmsghdr(ftnmsg *fmsg, FILE *pkt, faddr *routeaddr, char flavor, char *Pi if (fmsg->msgid_s) fprintf(pkt, "\1MSGID: %s\r", fmsg->msgid_s); else if (fmsg->msgid_a) - fprintf(pkt, "\1MSGID: %s %08lx\r", + fprintf(pkt, "\1MSGID: %s %08x\r", fmsg->msgid_a, fmsg->msgid_n); if (fmsg->reply_s) fprintf(pkt, "\1REPLY: %s\r", fmsg->reply_s); else if (fmsg->reply_a) - fprintf(pkt, "\1REPLY: %s %08lx\r", + fprintf(pkt, "\1REPLY: %s %08x\r", fmsg->reply_a, fmsg->reply_n); diff --git a/lib/getheader.c b/lib/getheader.c index 4ec6ef02..63364575 100644 --- a/lib/getheader.c +++ b/lib/getheader.c @@ -54,7 +54,7 @@ int getheader(faddr *f, faddr *t, FILE *pkt, char *pname, int session) unsigned char buffer[0x3a]; int i, capword, prodx, major, minor = 0, tome = FALSE; char *p, *prodn = NULL, *fa, *ta, buf[5]; - long year, month, day, hour, min, sec; + int year, month, day, hour, min, sec; f->domain = NULL; f->name = NULL; diff --git a/lib/gmtoffset.c b/lib/gmtoffset.c index 5943b50c..9c559f38 100644 --- a/lib/gmtoffset.c +++ b/lib/gmtoffset.c @@ -38,40 +38,40 @@ * Returns the offset from your location to UTC. So in the MET timezone * this returns -60 (wintertime). People in the USA get positive results. */ -long gmt_offset(time_t now) +int gmt_offset(time_t now) { - struct tm ptm; - struct tm gtm; - long offset; + struct tm ptm; + struct tm gtm; + int offset; - if (!now) - now = time(NULL); - ptm = *localtime(&now); + if (!now) + now = time(NULL); + ptm = *localtime(&now); - /* - * To get the timezone, compare localtime with GMT. - */ - gtm = *gmtime(&now); + /* + * To get the timezone, compare localtime with GMT. + */ + gtm = *gmtime(&now); - /* - * Assume we are never more than 24 hours away. - */ - offset = gtm.tm_yday - ptm.tm_yday; - if (offset > 1) - offset = -24; - else if (offset < -1) - offset = 24; - else - offset *= 24; + /* + * Assume we are never more than 24 hours away. + */ + offset = gtm.tm_yday - ptm.tm_yday; + if (offset > 1) + offset = -24; + else if (offset < -1) + offset = 24; + else + offset *= 24; - /* - * Scale in the hours and minutes; ignore seconds. - */ - offset += gtm.tm_hour - ptm.tm_hour; - offset *= 60; - offset += gtm.tm_min - ptm.tm_min; + /* + * Scale in the hours and minutes; ignore seconds. + */ + offset += gtm.tm_hour - ptm.tm_hour; + offset *= 60; + offset += gtm.tm_min - ptm.tm_min; - return offset; + return offset; } @@ -85,7 +85,7 @@ char *gmtoffset(time_t now) static char buf[6]="+0000"; char sign; int hr, min; - long offset; + int offset; offset = gmt_offset(now); diff --git a/lib/jammsg.c b/lib/jammsg.c index ce893b26..8efa9ed1 100644 --- a/lib/jammsg.c +++ b/lib/jammsg.c @@ -55,15 +55,15 @@ char szBuff[MAX_LINE_LENGTH + 1]; char szLine[MAX_LINE_LENGTH + 1]; JAMHDRINFO jamHdrInfo; JAMHDR jamHdr; -unsigned long LastReadRec; +unsigned int LastReadRec; -unsigned long AddSubfield(unsigned int, char *); -unsigned long AddSubfield(unsigned int JamSFld, char *SubStr) +unsigned int AddSubfield(unsigned int, char *); +unsigned int AddSubfield(unsigned int JamSFld, char *SubStr) { JAMSUBFIELD jamSubfield; - unsigned long Len; + unsigned int Len; jamSubfield.HiID = 0; jamSubfield.LoID = JamSFld; @@ -127,7 +127,7 @@ void JAMset_flags() int JAM_AddMsg() { int i, RetVal = TRUE; - unsigned long ulMsg = JAM_Highest() + 1L; + unsigned int ulMsg = JAM_Highest() + 1L; char *pszText, *Sign= (char *)HEADERSIGNATURE; JAMIDXREC jamIdx; int Oke; @@ -286,7 +286,7 @@ void JAM_Close(void) /* * Delete message number */ -int JAM_Delete(unsigned long ulMsg) +int JAM_Delete(unsigned int ulMsg) { int RetVal = FALSE; JAMIDXREC jamIdx; @@ -362,9 +362,9 @@ int JAM_GetLastRead(lastread *LR) /* * Get highest message number */ -unsigned long JAM_Highest(void) +unsigned int JAM_Highest(void) { - unsigned long RetVal = 0L; + unsigned int RetVal = 0L; JAMIDXREC jamIdx; if (jamHdrInfo.ActiveMsgs > 0L) { @@ -383,7 +383,7 @@ unsigned long JAM_Highest(void) -int JAM_Lock(unsigned long ulTimeout) +int JAM_Lock(unsigned int ulTimeout) { int rc, Tries = 0; struct flock fl; @@ -416,9 +416,9 @@ int JAM_Lock(unsigned long ulTimeout) /* * Get lowest message number */ -unsigned long JAM_Lowest(void) +unsigned int JAM_Lowest(void) { - unsigned long RetVal = 0L; + unsigned int RetVal = 0L; JAMIDXREC jamIdx; if (jamHdrInfo.ActiveMsgs > 0L) { @@ -453,11 +453,11 @@ int JAM_NewLastRead(lastread LR) -int JAM_Next(unsigned long * ulMsg) +int JAM_Next(unsigned int * ulMsg) { int RetVal = FALSE, MayBeNext = FALSE; JAMIDXREC jamIdx; - unsigned long _Msg; + unsigned int _Msg; _Msg = *ulMsg; @@ -509,7 +509,7 @@ int JAM_Next(unsigned long * ulMsg) Msg.Id = _Msg; } - memcpy(ulMsg, &_Msg, sizeof(unsigned long)); + memcpy(ulMsg, &_Msg, sizeof(unsigned int)); return RetVal; } @@ -518,7 +518,7 @@ int JAM_Next(unsigned long * ulMsg) /* * Return number of messages */ -unsigned long JAM_Number(void) +unsigned int JAM_Number(void) { return jamHdrInfo.ActiveMsgs; } @@ -595,7 +595,7 @@ void JAM_Pack(void) int ToRead, Readed, i, count; char *File, *New, *Subfield, *Temp; JAMIDXREC jamIdx; - unsigned long NewNumber = 0, RefNumber = 0, Written = 0; + unsigned int NewNumber = 0, RefNumber = 0, Written = 0; lastread LR; File = calloc(PATH_MAX, sizeof(char)); @@ -784,12 +784,12 @@ void JAM_Pack(void) -int JAM_Previous (unsigned long *ulMsg) +int JAM_Previous (unsigned int *ulMsg) { int RetVal = FALSE, MayBeNext = FALSE; - long Pos; + int Pos; JAMIDXREC jamIdx; - unsigned long _Msg; + unsigned int _Msg; _Msg = *ulMsg; @@ -846,17 +846,17 @@ int JAM_Previous (unsigned long *ulMsg) Msg.Id = _Msg; } - memcpy(ulMsg, &_Msg, sizeof(unsigned long)); + memcpy(ulMsg, &_Msg, sizeof(unsigned int)); return (RetVal); } -int JAM_ReadHeader (unsigned long ulMsg) +int JAM_ReadHeader (unsigned int ulMsg) { int i, RetVal = FALSE; unsigned char *pPos; - unsigned long ulSubfieldLen, tmp; + unsigned int ulSubfieldLen, tmp; JAMIDXREC jamIdx; JAMBINSUBFIELD *jamSubField; @@ -1065,12 +1065,12 @@ int JAM_ReadHeader (unsigned long ulMsg) /* * Read message */ -int JAM_Read(unsigned long ulMsg, int nWidth) +int JAM_Read(unsigned int ulMsg, int nWidth) { int RetVal = FALSE, SkipNext; int i, nReaded, nCol, nRead; unsigned char *pPos; - unsigned long ulTxtLen, ulSubfieldLen; + unsigned int ulTxtLen, ulSubfieldLen; JAMIDXREC jamIdx; JAMBINSUBFIELD *jamSubField; LDATA *Bottom = NULL, *New; @@ -1230,7 +1230,7 @@ int JAM_Read(unsigned long ulMsg, int nWidth) SkipNext = FALSE; do { - if ((unsigned long)(nRead = sizeof (szBuff)) > ulTxtLen) + if ((unsigned int)(nRead = sizeof (szBuff)) > ulTxtLen) nRead = (int)ulTxtLen; nReaded = (int)read (fdJdt, szBuff, nRead); @@ -1346,7 +1346,7 @@ void JAM_UnLock(void) /* * Write message header */ -int JAM_WriteHeader (unsigned long ulMsg) +int JAM_WriteHeader (unsigned int ulMsg) { int RetVal = FALSE; JAMIDXREC jamIdx; diff --git a/lib/jammsg.h b/lib/jammsg.h index 53737fef..30bdaa60 100644 --- a/lib/jammsg.h +++ b/lib/jammsg.h @@ -6,24 +6,24 @@ int JAM_AddMsg(void); void JAM_Close(void); -int JAM_Delete(unsigned long); +int JAM_Delete(unsigned int); void JAM_DeleteJAM(char *); int JAM_GetLastRead(lastread *); -unsigned long JAM_Highest(void); -int JAM_Lock(unsigned long); -unsigned long JAM_Lowest(void); +unsigned int JAM_Highest(void); +int JAM_Lock(unsigned int); +unsigned int JAM_Lowest(void); void JAM_New(void); int JAM_NewLastRead(lastread); -int JAM_Next(unsigned long *); -unsigned long JAM_Number(void); +int JAM_Next(unsigned int *); +unsigned int JAM_Number(void); int JAM_Open(char *); void JAM_Pack(void); -int JAM_Previous(unsigned long *); -int JAM_ReadHeader(unsigned long); -int JAM_Read(unsigned long, int); +int JAM_Previous(unsigned int *); +int JAM_ReadHeader(unsigned int); +int JAM_Read(unsigned int, int); int JAM_SetLastRead(lastread); void JAM_UnLock(void); -int JAM_WriteHeader(unsigned long); +int JAM_WriteHeader(unsigned int); #endif diff --git a/lib/jamsys.h b/lib/jamsys.h index e8cb85c4..986f69cf 100644 --- a/lib/jamsys.h +++ b/lib/jamsys.h @@ -1,4 +1,6 @@ /* +** $Id$ +** ** JAM(mbp) - The Joaquim-Andrew-Mats Message Base Proposal ** ** C API @@ -44,8 +46,8 @@ ** _QC Microsoft Quick C */ -typedef long INT32; /* 32 bits signed integer */ -typedef unsigned long UINT32; /* 32 bits unsigned integer */ +typedef int INT32; /* 32 bits signed integer */ +typedef unsigned int UINT32; /* 32 bits unsigned integer */ typedef short int INT16; /* 16 bits signed integer */ typedef unsigned short int UINT16; /* 16 bits unsigned integer */ typedef char CHAR8; /* 8 bits signed integer */ diff --git a/lib/mbcharsetc.c b/lib/mbcharsetc.c index 757f3c73..65b7f00c 100644 --- a/lib/mbcharsetc.c +++ b/lib/mbcharsetc.c @@ -5,7 +5,7 @@ * Author ................: Martin Junius, for Fidogate * ***************************************************************************** - * Copyright (C) 1997-2004 + * Copyright (C) 1997-2005 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -123,17 +123,17 @@ int is_space(int c) * comments (starting with `#'), and empty lines. cf_getline() returns * a pointer to the first non-whitespace in buffer. */ -static long cf_lineno = 0; +static int cf_lineno = 0; -long cf_lineno_get(void) +int cf_lineno_get(void) { return cf_lineno; } -long cf_lineno_set(long n) +int cf_lineno_set(int n) { - long old; + int old; old = cf_lineno; cf_lineno = n; @@ -225,7 +225,7 @@ int charset_do_line(char *line) w1 = strtok(NULL, " \t"); w2 = strtok(NULL, " \t"); if(!w1 || !w2) { - fprintf(stderr, "%s:%ld: argument(s) for alias missing\n", PROGRAM, cf_lineno_get()); + fprintf(stderr, "%s:%d: argument(s) for alias missing\n", PROGRAM, cf_lineno_get()); return FALSE; } @@ -239,7 +239,7 @@ int charset_do_line(char *line) w1 = strtok(NULL, " \t"); w2 = strtok(NULL, " \t"); if(!w1 || !w2) { - fprintf(stderr, "%s:%ld: argument(s) for table missing\n", PROGRAM, cf_lineno_get()); + fprintf(stderr, "%s:%d: argument(s) for table missing\n", PROGRAM, cf_lineno_get()); return FALSE; } @@ -252,7 +252,7 @@ int charset_do_line(char *line) else if (strieq(key, "map")) { w1 = strtok(NULL, " \t"); if (!w1) { - fprintf(stderr, "%s:%ld: argument for map missing\n", PROGRAM, cf_lineno_get()); + fprintf(stderr, "%s:%d: argument for map missing\n", PROGRAM, cf_lineno_get()); return FALSE; } @@ -281,17 +281,17 @@ int charset_do_line(char *line) /* Normal mapping */ else { if ((c1 = charset_parse_c(w1)) == ERROR) { - fprintf(stderr, "%s:%ld: illegal char %s\n", PROGRAM, cf_lineno_get(), w1); + fprintf(stderr, "%s:%d: illegal char %s\n", PROGRAM, cf_lineno_get(), w1); return FALSE; } if (c1 < 0x80) { - fprintf(stderr, "%s:%ld: illegal char %s, must be >= 0x80\n", PROGRAM, cf_lineno_get(), w1); + fprintf(stderr, "%s:%d: illegal char %s, must be >= 0x80\n", PROGRAM, cf_lineno_get(), w1); return FALSE; } for (i=0; imap[c1 & 0x7f][i] = c2; @@ -302,7 +302,7 @@ int charset_do_line(char *line) } /* Error */ else { - fprintf(stderr, "%s:%ld: illegal key word %s\n", PROGRAM, cf_lineno_get(), key); + fprintf(stderr, "%s:%d: illegal key word %s\n", PROGRAM, cf_lineno_get(), key); return FALSE; } @@ -318,7 +318,7 @@ int charset_do_file(char *name) { FILE *fp; char *p; - long oldn; + int oldn; if(!name) return FALSE; diff --git a/lib/mbdiesel.c b/lib/mbdiesel.c index 85c99bd7..c9dc81bf 100644 --- a/lib/mbdiesel.c +++ b/lib/mbdiesel.c @@ -193,7 +193,7 @@ void Cookie(int HtmlMode) { FILE *olf; char *fname, outbuf[256]; - long recno, records; + int recno, records; MacroVars("F", "s", ""); fname = calloc(PATH_MAX, sizeof(char)); diff --git a/lib/mbfile.c b/lib/mbfile.c index 544b59cb..7d261650 100644 --- a/lib/mbfile.c +++ b/lib/mbfile.c @@ -4,7 +4,7 @@ * Purpose ...............: Basic File I/O * ***************************************************************************** - * Copyright (C) 1997-2004 + * Copyright (C) 1997-2005 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -159,7 +159,7 @@ int file_exist(char *path, int mode) /* * Return size of file, or -1 if file doesn't exist */ -long file_size(char *path) +int file_size(char *path) { static struct stat sb; @@ -172,30 +172,30 @@ long file_size(char *path) /* - * Claclulate the 32 bit CRC of a file. Return -1 if file not found. + * Calculate the 32 bit CRC of a file. Return -1 if file not found. */ -long file_crc(char *path, int slow) +int file_crc(char *path, int slow) { - static long crc; - int bread; - FILE *fp; - char *line; + static int crc; + int bread; + FILE *fp; + char *line; - if ((fp = fopen(path, "r")) == NULL) - return -1; + if ((fp = fopen(path, "r")) == NULL) + return -1; - line = malloc(32768); - crc = 0xffffffff; + line = malloc(32768); + crc = 0xffffffff; - do { - bread = fread(line, 1, 32768, fp); - crc = upd_crc32(line, crc, bread); - Nopper(); // For large files on slow systems. - } while (bread > 0); + do { + bread = fread(line, 1, 32768, fp); + crc = upd_crc32(line, crc, bread); + Nopper(); // For large files on slow systems. + } while (bread > 0); - free(line); - fclose(fp); - return crc ^ 0xffffffff; + free(line); + fclose(fp); + return crc ^ 0xffffffff; } @@ -207,12 +207,12 @@ long file_crc(char *path, int slow) */ time_t file_time(char *path) { - static struct stat sb; + static struct stat sb; - if (stat(path, &sb) == -1) - return -1; + if (stat(path, &sb) == -1) + return -1; - return sb.st_mtime; + return sb.st_mtime; } diff --git a/lib/mbse.h b/lib/mbse.h index 60989974..dd931a33 100644 --- a/lib/mbse.h +++ b/lib/mbse.h @@ -4,7 +4,7 @@ * Purpose ...............: Global variables for MBSE BBS * ***************************************************************************** - * Copyright (C) 1997-2001 + * Copyright (C) 1997-2005 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -36,7 +36,7 @@ typedef struct _TagRec { - long Area; /* File Area number */ + int Area; /* File Area number */ int Active; /* Not deleted from taglist */ int Cost; /* Free download */ off_t Size; /* File Size */ diff --git a/lib/mbsedb.h b/lib/mbsedb.h index 2c244c96..d77e7727 100644 --- a/lib/mbsedb.h +++ b/lib/mbsedb.h @@ -43,7 +43,7 @@ int IsOurAka(fidoaddr); /* Check if our aka */ typedef enum {D_ECHOMAIL, D_FILEECHO, D_NEWS} DUPETYPE; void InitDupes(void); -int CheckDupe(unsigned long, int, int); +int CheckDupe(unsigned int, int, int); void CloseDupes(void); @@ -138,13 +138,13 @@ void UpdateMsgs(void); /* Update current messages record */ * Structure of current open file area */ struct _fdbarea { - long area; /* Area number */ + int area; /* Area number */ int locked; /* Is area locked */ FILE *fp; /* File pointer */ }; -struct _fdbarea *mbsedb_OpenFDB(long, int); +struct _fdbarea *mbsedb_OpenFDB(int, int); int mbsedb_CloseFDB(struct _fdbarea *); int mbsedb_LockFDB(struct _fdbarea *, int); int mbsedb_UnlockFDB(struct _fdbarea *); diff --git a/lib/mbselib.h b/lib/mbselib.h index c447a35c..59e17b2e 100644 --- a/lib/mbselib.h +++ b/lib/mbselib.h @@ -123,8 +123,8 @@ struct termios; # include # define USE_SGTTY # ifdef LLITOUT - extern long Locmode; /* Saved "local mode" for 4.x BSD "new driver" */ - extern long Locbit; /* Bit SUPPOSED to disable output translations */ + extern int Locmode; /* Saved "local mode" for 4.x BSD "new driver" */ + extern int Locbit; /* Bit SUPPOSED to disable output translations */ # endif # else # error neither termio.h nor sgtty.h found. Cannot continue. @@ -513,7 +513,7 @@ typedef struct _nlidx { unsigned char type; /* Node type */ unsigned char pflag; /* Node status */ unsigned short fileno; /* Nodelist number */ - long offset; /* Offset in nodelist */ + int offset; /* Offset in nodelist */ } nlidx; @@ -569,8 +569,8 @@ typedef struct _nlusr { */ typedef struct _security { unsigned int level; /* Security level */ - unsigned long flags; /* Access flags */ - unsigned long notflags; /* No Access flags */ + unsigned int flags; /* Access flags */ + unsigned int notflags; /* No Access flags */ } securityrec; #endif @@ -616,12 +616,12 @@ typedef struct _sysconnect { * Statistic counters structure */ typedef struct _statcnt { - unsigned long tdow[7]; /* Days of current week */ - unsigned long ldow[7]; /* Days of previous week */ - unsigned long tweek; /* Week total counters */ - unsigned long lweek; /* Last week counters */ - unsigned long month[12]; /* Monthly total counters */ - unsigned long total; /* The ever growing total */ + unsigned int tdow[7]; /* Days of current week */ + unsigned int ldow[7]; /* Days of previous week */ + unsigned int tweek; /* Week total counters */ + unsigned int lweek; /* Last week counters */ + unsigned int month[12]; /* Monthly total counters */ + unsigned int total; /* The ever growing total */ } statcnt; @@ -680,9 +680,9 @@ struct taskrec { * Special mail services (service.data) */ struct servicehdr { - long hdrsize; /* Size of header */ - long recsize; /* Size of records */ - time_t lastupd; /* Last updated at */ + int hdrsize; /* Size of header */ + int recsize; /* Size of records */ + int32_t lastupd; /* Last updated at */ }; struct servicerec { @@ -698,9 +698,9 @@ struct servicerec { * Domain translation (domain.data) */ struct domhdr { - long hdrsize; /* Size of header */ - long recsize; /* Size of records */ - time_t lastupd; /* Last updated at */ + int hdrsize; /* Size of header */ + int recsize; /* Size of records */ + int32_t lastupd; /* Last updated at */ }; struct domrec { @@ -716,15 +716,15 @@ struct domrec { * System Control Structures (sysinfo.data) */ struct sysrec { - unsigned long SystemCalls; /* Total # of system calls */ - unsigned long Pots; /* POTS calls */ - unsigned long ISDN; /* ISDN calls */ - unsigned long Network; /* Network (internet) calls*/ - unsigned long Local; /* Local calls */ - unsigned long xADSL; /* */ - time_t StartDate; /* Start Date of BBS */ + unsigned int SystemCalls; /* Total # of system calls */ + unsigned int Pots; /* POTS calls */ + unsigned int ISDN; /* ISDN calls */ + unsigned int Network; /* Network (internet) calls*/ + unsigned int Local; /* Local calls */ + unsigned int xADSL; /* */ + int32_t StartDate; /* Start Date of BBS */ char LastCaller[37]; /* Last Caller to BBS */ - time_t LastTime; /* Time of last caller */ + int32_t LastTime; /* Time of last caller */ }; @@ -733,8 +733,8 @@ struct sysrec { * Protocol Control Structure (protocol.data) */ struct prothdr { - long hdrsize; /* Size of header */ - long recsize; /* Size of records */ + int hdrsize; /* Size of header */ + int recsize; /* Size of records */ }; struct prot { @@ -758,8 +758,8 @@ struct prot { * Oneliners Control Structure (oneline.data) */ struct onelinehdr { - long hdrsize; /* Size of header */ - long recsize; /* Size of record */ + int hdrsize; /* Size of header */ + int recsize; /* Size of record */ }; struct oneline { @@ -775,8 +775,8 @@ struct oneline { * File Areas Control Structure (fareas.data) */ struct fileareashdr { - long hdrsize; /* Size of header */ - long recsize; /* Size of records */ + int hdrsize; /* Size of header */ + int recsize; /* Size of records */ }; struct fileareas { @@ -816,8 +816,8 @@ struct fileareas { struct FILEIndex { char Name[13]; /* Short DOS name */ char LName[81]; /* Long filename */ - long AreaNum; /* File area number */ - long Record; /* Record in database */ + int AreaNum; /* File area number */ + int Record; /* Record in database */ }; @@ -826,8 +826,8 @@ struct FILEIndex { * Files database (file#.data) */ struct FILE_recordhdr { - long hdrsize; /* Size of header */ - long recsize; /* Record size */ + int hdrsize; /* Size of header */ + int recsize; /* Record size */ }; @@ -836,12 +836,12 @@ struct FILE_record { char LName[81]; /* Long filename */ char TicArea[21]; /* Tic area file came in */ off_t Size; /* File Size */ - unsigned long Crc32; /* File CRC-32 */ + unsigned int Crc32; /* File CRC-32 */ char Uploader[36]; /* Uploader name */ - time_t UploadDate; /* Date/Time uploaded */ - time_t FileDate; /* Real file date */ - time_t LastDL; /* Last Download date */ - unsigned long TimesDL; /* Times file was dl'ed */ + int32_t UploadDate; /* Date/Time uploaded */ + int32_t FileDate; /* Real file date */ + int32_t LastDL; /* Last Download date */ + unsigned int TimesDL; /* Times file was dl'ed */ char Password[16]; /* File password */ char Desc[25][49]; /* file description */ char Magic[21]; /* Magic request name */ @@ -860,16 +860,16 @@ struct OldFILERecord { char Name[13]; /* DOS style filename */ char LName[81]; /* Long filename */ char xTicArea[9]; /* Tic area file came in */ - unsigned long TicAreaCRC; /* CRC of TIC area name */ + unsigned int TicAreaCRC; /* CRC of TIC area name */ off_t Size; /* File Size */ - unsigned long Crc32; /* File CRC-32 */ + unsigned int Crc32; /* File CRC-32 */ char Uploader[36]; /* Uploader name */ - time_t UploadDate; /* Date/Time uploaded */ - time_t FileDate; /* Real file date */ - time_t LastDL; /* Last Download date */ - unsigned long TimesDL; /* Times file was dl'ed */ - unsigned long TimesFTP; /* Times file was FTP'ed */ - unsigned long TimesReq; /* Times file was frequed */ + int32_t UploadDate; /* Date/Time uploaded */ + int32_t FileDate; /* Real file date */ + int32_t LastDL; /* Last Download date */ + unsigned int TimesDL; /* Times file was dl'ed */ + unsigned int TimesFTP; /* Times file was FTP'ed */ + unsigned int TimesReq; /* Times file was frequed */ char Password[16]; /* File password */ char Desc[25][49]; /* file description */ int Cost; /* File cost */ @@ -887,8 +887,8 @@ struct OldFILERecord { * BBS List Control Structure (bbslist.data) */ struct bbslisthdr { - long hdrsize; /* Size of header */ - long recsize; /* Size of records */ + int hdrsize; /* Size of header */ + int recsize; /* Size of records */ }; struct bbslist { @@ -915,8 +915,8 @@ struct bbslist { * Last Callers Control Structure (lastcall.data) */ struct lastcallershdr { - long hdrsize; /* Size of header */ - long recsize; /* Size of records */ + int hdrsize; /* Size of header */ + int recsize; /* Size of records */ }; struct lastcallers { @@ -1002,7 +1002,7 @@ struct sysconfig { /* before every d/l or u/l */ unsigned sysop_access; /* Sysop Access Security */ int password_length; /* Minimum Password Length */ - long bbs_loglevel; /* Logging level for BBS */ + int bbs_loglevel; /* Logging level for BBS */ int iPasswd_Char; /* Password Character */ int iQuota; /* User homedir quota in MB */ int idleout; /* Idleout Value */ @@ -1097,7 +1097,7 @@ struct sysconfig { char xTimeRatio[7]; char xByteRatio[7]; - long new_groups; /* Maximum newfiles groups */ + int new_groups; /* Maximum newfiles groups */ int new_split; /* Split reports at KB. */ int new_force; /* Force split at KB. */ char startname[9]; /* BBS startup name */ @@ -1119,11 +1119,11 @@ struct sysconfig { int OLR_MaxReq; /* Max nr of Freq's */ int tic_days; /* Keep on hold for n days */ char hatchpasswd[21]; /* Internal Hatch Passwd */ - unsigned long xdrspace; + unsigned int xdrspace; char xmgrname[5][21]; /* Areamgr names */ - long tic_systems; /* Systems in database */ - long tic_groups; /* Groups in database */ - long tic_dupes; /* TIC dupes dabase size */ + int tic_systems; /* Systems in database */ + int tic_groups; /* Groups in database */ + int tic_dupes; /* TIC dupes dabase size */ char badtic[65]; /* Bad TIC's path */ char ticout[65]; /* TIC queue */ @@ -1133,7 +1133,7 @@ struct sysconfig { int maxarcsize; /* Maximum archive size */ int toss_old; /* Reject older then days */ char xtoss_log[11]; - long util_loglevel; /* Logging level for utils */ + int util_loglevel; /* Logging level for utils */ char badboard[65]; /* Bad Mail board */ char dupboard[65]; /* Dupe Mail board */ char popnode[65]; /* Node with pop3 boxes */ @@ -1143,8 +1143,8 @@ struct sysconfig { int defmsgs; /* Default purge messages */ int defdays; /* Default purge days */ int freespace; /* Free diskspace in MBytes */ - long toss_systems; /* Systems in database */ - long toss_groups; /* Groups in database */ + int toss_systems; /* Systems in database */ + int toss_groups; /* Groups in database */ char xareamgr[5][21]; /* Areamgr names */ /* Flags */ @@ -1152,10 +1152,10 @@ struct sysconfig { fidoaddr aka[40]; /* Fidonet AKA's */ unsigned short akavalid[40]; /* Fidonet AKA valid/not */ - long cico_loglevel; /* Mailer loglevel */ - long timeoutreset; /* Reset timeout */ - long timeoutconnect; /* Connect timeout */ - long dialdelay; /* Delay between calls */ + int cico_loglevel; /* Mailer loglevel */ + int timeoutreset; /* Reset timeout */ + int timeoutconnect; /* Connect timeout */ + int dialdelay; /* Delay between calls */ unsigned NoFreqs : 1; /* Don't allow requests */ unsigned NoCall : 1; /* Don't call */ unsigned NoMD5 : 1; /* Don't do MD5 */ @@ -1172,7 +1172,7 @@ struct sysconfig { unsigned xNoIFC : 1; char IP_Phone[21]; /* TCP/IP phonenumber */ - unsigned long IP_Speed; /* TCP/IP linespeed */ + unsigned int IP_Speed; /* TCP/IP linespeed */ char IP_Flags[31]; /* TCP/IP EMSI flags */ int Req_Files; /* Maximum files request */ int Req_MBytes; /* Maximum MBytes request */ @@ -1232,7 +1232,7 @@ struct sysconfig { unsigned dontregate : 1; /* Don't regate gated msgs */ char nntpuser[16]; /* NNTP username */ char nntppass[16]; /* NNTP password */ - long nntpdupes; /* NNTP dupes database size */ + int nntpdupes; /* NNTP dupes database size */ int newsfeed; /* Newsfeed mode */ int maxarticles; /* Default max articles */ char bbs_macros[65]; /* Default macros path */ @@ -1266,14 +1266,14 @@ struct sysconfig { * Limits Control Structure (limits.data) */ struct limitshdr { - long hdrsize; /* Size of header */ - long recsize; /* Size of records */ + int hdrsize; /* Size of header */ + int recsize; /* Size of records */ }; struct limits { - unsigned long Security; /* Security Level */ - long Time; /* Amount of time per call */ - unsigned long DownK; /* Download KB per call */ + unsigned int Security; /* Security Level */ + int Time; /* Amount of time per call */ + unsigned int DownK; /* Download KB per call */ unsigned int DownF; /* Download files per call */ char Description[41]; /* Description for level */ unsigned Available : 1; /* Is this limit available */ @@ -1315,7 +1315,7 @@ struct menufile { unsigned SingleUser : 1; /* Single user door */ unsigned HideDoor : 1; /* Hide door from lists */ #endif - long xUnused; + int xUnused; int HiForeGnd; /* High ForeGround color */ int HiBackGnd; /* High ForeGround color */ int ForeGnd; /* Normal ForeGround color */ @@ -1329,7 +1329,7 @@ struct menufile { */ struct newsdupes { char NewsGroup[65]; /* Name of the group */ - unsigned long Crc; /* CRC32 of msgid */ + unsigned int Crc; /* CRC32 of msgid */ }; @@ -1339,10 +1339,10 @@ struct newsdupes { * This is also used for echomail, netmail and news */ struct msgareashdr { - long hdrsize; /* Size of header */ - long recsize; /* Size of records */ - long syssize; /* Size for systems */ - time_t lastupd; /* Last date stats updated */ + int hdrsize; /* Size of header */ + int recsize; /* Size of records */ + int syssize; /* Size for systems */ + int32_t lastupd; /* Last date stats updated */ }; struct msgareas { @@ -1384,8 +1384,8 @@ struct msgareas { unsigned xUplDisc : 1; statcnt Received; /* Received messages */ statcnt Posted; /* Posted messages */ - time_t LastRcvd; /* Last time msg received */ - time_t LastPosted; /* Last time msg posted */ + int32_t LastRcvd; /* Last time msg received */ + int32_t LastPosted; /* Last time msg posted */ char Newsgroup[81]; /* Newsgroup/Mailinglist */ char xDistribution[17]; /* Ng distribution */ char xModerator[65]; @@ -1393,7 +1393,7 @@ struct msgareas { int Charset; /* FTN characterset */ int MaxArticles; /* Max. newsarticles to get */ securityrec LinkSec; /* Link security flags */ - time_t Created; /* Area creation date */ + int32_t Created; /* Area creation date */ }; @@ -1402,8 +1402,8 @@ struct msgareas { * Structure for Language file (language.data) */ struct languagehdr { - long hdrsize; /* Size of header */ - long recsize; /* Size of records */ + int hdrsize; /* Size of header */ + int recsize; /* Size of records */ }; struct language { @@ -1434,8 +1434,8 @@ struct langdata { * Fidonet Networks (fidonet.data) */ struct _fidonethdr { - long hdrsize; /* Size of header record */ - long recsize; /* Size of records */ + int hdrsize; /* Size of header record */ + int recsize; /* Size of records */ }; typedef struct _seclist { @@ -1461,8 +1461,8 @@ struct _fidonet { * Archiver programs (archiver.data) */ struct _archiverhdr { - long hdrsize; /* Size of header record */ - long recsize; /* Size of records */ + int hdrsize; /* Size of header record */ + int recsize; /* Size of records */ }; struct _archiver { @@ -1486,8 +1486,8 @@ struct _archiver { * Virus scanners (virscan.data) */ struct _virscanhdr { - long hdrsize; /* Size of header record */ - long recsize; /* Size of records */ + int hdrsize; /* Size of header record */ + int recsize; /* Size of records */ }; struct _virscan { @@ -1505,8 +1505,8 @@ struct _virscan { * TTY information */ struct _ttyinfohdr { - long hdrsize; /* Size of header record */ - long recsize; /* Size of records */ + int hdrsize; /* Size of header record */ + int recsize; /* Size of records */ }; struct _ttyinfo { @@ -1523,7 +1523,7 @@ struct _ttyinfo { unsigned callout : 1; /* Callout allowed */ char modem[31]; /* Modem type */ char name[36]; /* EMSI line name */ - long portspeed; /* Locked portspeed */ + int portspeed; /* Locked portspeed */ }; @@ -1532,8 +1532,8 @@ struct _ttyinfo { * Modem definitions. */ struct _modemhdr { - long hdrsize; /* Size of header record */ - long recsize; /* Size of records */ + int hdrsize; /* Size of header record */ + int recsize; /* Size of records */ }; struct _modem { @@ -1559,28 +1559,28 @@ struct _modem { * Structure for TIC areas (tic.data) */ struct _tichdr { - long hdrsize; /* Size of header */ - long recsize; /* Size of records */ - long syssize; /* Size for systems */ - time_t lastupd; /* Last statistic update */ + int hdrsize; /* Size of header */ + int recsize; /* Size of records */ + int syssize; /* Size for systems */ + int lastupd; /* Last statistic update */ }; struct _tic { char Name[21]; /* Area name */ char Comment[56]; /* Area comment */ - long FileArea; /* The BBS filearea */ + int FileArea; /* The BBS filearea */ char Message[15]; /* Message file */ char Group[13]; /* FDN group */ int KeepLatest; /* Keep latest n files */ - long xOld[6]; - time_t AreaStart; /* Startdate */ + int xOld[6]; + int32_t AreaStart; /* Startdate */ fidoaddr Aka; /* Fidonet address */ char Convert[6]; /* Archiver to convert */ - time_t LastAction; /* Last Action in this area*/ + int32_t LastAction; /* Last Action in this area*/ char Banner[15]; /* Banner file */ - long xUnitCost; - long xUnitSize; - long xAddPerc; + int xUnitCost; + int xUnitSize; + int xAddPerc; unsigned Replace : 1; /* Allow Replace */ unsigned DupCheck : 1; /* Dupe Check */ unsigned Secure : 1; /* Check for secure system */ @@ -1608,11 +1608,11 @@ struct _tic { * Nodes, up- and downlinks. (nodes.data) */ struct _nodeshdr { - long hdrsize; /* Size of header */ - long recsize; /* Size of records */ - long filegrp; /* Size for file groups */ - long mailgrp; /* Size for mail groups */ - time_t lastupd; /* Last statistic update */ + int hdrsize; /* Size of header */ + int recsize; /* Size of records */ + int filegrp; /* Size for file groups */ + int mailgrp; /* Size for mail groups */ + int lastupd; /* Last statistic update */ }; struct _nodes { @@ -1663,13 +1663,13 @@ struct _nodes { unsigned IgnHold : 1; /* Ignore Hold/Down status */ char xExtra[94]; - time_t StartDate; /* Node start date */ - time_t LastDate; /* Last action date */ - long xCredit; /* Node's credit */ - long xDebet; /* Node's debet */ - long xAddPerc; /* Add Percentage */ - long xWarnLevel; /* Warning level */ - long xStopLevel; /* Stop level */ + int32_t StartDate; /* Node start date */ + int32_t LastDate; /* Last action date */ + int xCredit; /* Node's credit */ + int xDebet; /* Node's debet */ + int xAddPerc; /* Add Percentage */ + int xWarnLevel; /* Warning level */ + int xStopLevel; /* Stop level */ fidoaddr RouteVia; /* Routing address */ int Language; /* Language for netmail */ statcnt FilesSent; /* Files sent to node */ @@ -1743,9 +1743,9 @@ struct _nodes { * Groups for file areas. (fgroups.data) */ struct _fgrouphdr { - long hdrsize; /* Size of header */ - long recsize; /* Size of records */ - time_t lastupd; /* Last statistics update */ + int hdrsize; /* Size of header */ + int recsize; /* Size of records */ + int lastupd; /* Last statistics update */ }; struct _fgroup { @@ -1756,16 +1756,16 @@ struct _fgroup { unsigned xDivideCost : 1; /* Divide cost over links */ fidoaddr UseAka; /* Aka to use */ fidoaddr UpLink; /* Uplink address */ - long xUnitCost; /* Cost per unit */ - long xUnitSize; /* Size per unit */ - long xAddProm; /* Promillage to add */ - time_t StartDate; /* Start Date */ - time_t LastDate; /* Last active date */ + int xUnitCost; /* Cost per unit */ + int xUnitSize; /* Size per unit */ + int xAddProm; /* Promillage to add */ + int StartDate; /* Start Date */ + int LastDate; /* Last active date */ char AreaFile[13]; /* Areas filename */ statcnt Files; /* Files processed */ statcnt KBytes; /* KBytes msgs or files */ /* Auto add area options */ - long StartArea; /* Lowest filearea nr. */ + int StartArea; /* Lowest filearea nr. */ char Banner[15]; /* Banner to add */ char Convert[6]; /* Archiver to convert */ unsigned FileGate : 1; /* List is in filegate fmt */ @@ -1800,9 +1800,9 @@ struct _fgroup { * Groups for message areas. (mgroups.data) */ struct _mgrouphdr { - long hdrsize; /* Size of header */ - long recsize; /* Size of records */ - time_t lastupd; /* Last statistics update */ + int hdrsize; /* Size of header */ + int recsize; /* Size of records */ + int lastupd; /* Last statistics update */ }; struct _mgroup { @@ -1812,9 +1812,9 @@ struct _mgroup { unsigned Deleted : 1; /* Group is deleted */ fidoaddr UseAka; /* Aka to use */ fidoaddr UpLink; /* Uplink address */ - long xOld[6]; - time_t StartDate; /* Start Date */ - time_t LastDate; /* Last active date */ + int xOld[6]; + int StartDate; /* Start Date */ + int LastDate; /* Last active date */ char AreaFile[13]; /* Areas filename */ statcnt MsgsRcvd; /* Received messages */ statcnt MsgsSent; /* Sent messages */ @@ -1843,8 +1843,8 @@ struct _mgroup { * Groups for newfiles announce. (ngroups.data) */ struct _ngrouphdr { - long hdrsize; /* Size of header */ - long recsize; /* Size of records */ + int hdrsize; /* Size of header */ + int recsize; /* Size of records */ }; struct _ngroup { @@ -1860,9 +1860,9 @@ struct _ngroup { * Hatch manager (hatch.data) */ struct _hatchhdr { - long hdrsize; /* Size of header */ - long recsize; /* Size of records */ - time_t lastupd; /* Last stats update */ + int hdrsize; /* Size of header */ + int recsize; /* Size of records */ + int lastupd; /* Last stats update */ }; struct _hatch { @@ -1896,8 +1896,8 @@ typedef enum { } MAGICTYPE; struct _magichdr { - long hdrsize; /* Size of header */ - long recsize; /* Size of records */ + int hdrsize; /* Size of header */ + int recsize; /* Size of records */ }; struct _magic { @@ -1919,9 +1919,9 @@ struct _magic { * Newfile reports (newfiles.data) */ struct _newfileshdr { - long hdrsize; /* Size of header */ - long recsize; /* Size of records */ - long grpsize; /* Size of groups */ + int hdrsize; /* Size of header */ + int recsize; /* Size of records */ + int grpsize; /* Size of groups */ }; struct _newfiles { @@ -1945,8 +1945,8 @@ struct _newfiles { * Scanmanager (scanmgr.data) */ struct _scanmgrhdr { - long hdrsize; /* Size of header */ - long recsize; /* Size of records */ + int hdrsize; /* Size of header */ + int recsize; /* Size of records */ }; struct _scanmgr { @@ -1976,8 +1976,8 @@ struct _filerecord { char Name[13]; /* File Name */ char LName[81]; /* Long FileName */ off_t Size; /* File Size */ - unsigned long SizeKb; /* File Size in Kb */ - time_t Fdate; /* File Date */ + unsigned int SizeKb; /* File Size in Kb */ + int32_t Fdate; /* File Date */ char Origin[24]; /* Origin system */ char From[24]; /* From system */ char Crc[9]; /* CRC 32 */ @@ -2003,10 +2003,10 @@ struct _history { char sysop[36]; /* Sysop name */ char location[36]; /* System location */ char tty[7]; /* Tty of connection */ - time_t online; /* Starttime of session */ - time_t offline; /* Endtime of session */ - unsigned long sent_bytes; /* Bytes sent */ - unsigned long rcvd_bytes; /* Bytes received */ + int online; /* Starttime of session */ + int offline; /* Endtime of session */ + unsigned int sent_bytes; /* Bytes sent */ + unsigned int rcvd_bytes; /* Bytes received */ int cost; /* Session cost */ unsigned inbound : 1; /* Inbound session */ }; @@ -2023,8 +2023,8 @@ struct _history { * extra things can be done for netmail to a specific person. */ struct _routehdr { - long hdrsize; /* Size of header */ - long recsize; /* Size of records */ + int hdrsize; /* Size of header */ + int recsize; /* Size of records */ }; @@ -2044,8 +2044,8 @@ struct _route { * IBC servers to connect to. */ struct _ibcsrvhdr { - long hdrsize; /* Size of header */ - long recsize; /* Size of record */ + int hdrsize; /* Size of header */ + int recsize; /* Size of record */ }; @@ -2067,7 +2067,7 @@ struct _ibcsrv { char *xmalloc(size_t); char *xstrcpy(char *); char *xstrcat(char *, char *); -void InitClient(char *, char *, char *, char *, long, char *, char *, char *); +void InitClient(char *, char *, char *, char *, int, char *, char *, char *); void ExitClient(int); void SockS(const char *, ...); char *SockR(const char *, ...); @@ -2082,8 +2082,8 @@ void UserCity(pid_t, char *, char *); void DoNop(void); void Nopper(void); void Altime(int); -int enoughspace(unsigned long); -unsigned long sequencer(void); +int enoughspace(unsigned int); +unsigned int sequencer(void); char *printable(char *, int); char *printablec(char); @@ -2103,12 +2103,12 @@ int socket_shutdown(pid_t); /* * From crc.c */ -unsigned long crc32ccitt(char *, int); +unsigned int crc32ccitt(char *, int); unsigned short crc16ccitt(char *, int); -unsigned long str_crc32(char *str); -unsigned long StringCRC32(char *); -unsigned long upd_crc32(char *buf, unsigned long crc, int len); -unsigned long norm_crc32(unsigned long crc); +unsigned int str_crc32(char *str); +unsigned int StringCRC32(char *); +unsigned int upd_crc32(char *buf, unsigned int crc, int len); +unsigned int norm_crc32(unsigned int crc); unsigned short crc16xmodem(char *, int); unsigned char checksum(char *, int); @@ -2163,14 +2163,14 @@ typedef struct _ftnmsg { int ftnorigin; faddr *to; faddr *from; - time_t date; + int date; char *subj; char *msgid_s; char *msgid_a; - unsigned long msgid_n; + unsigned int msgid_n; char *reply_s; char *reply_a; - unsigned long reply_n; + unsigned int reply_n; char *origin; char *area; } ftnmsg; @@ -2281,7 +2281,7 @@ int getheader(faddr *, faddr *, FILE *, char *, int); /* * From gmtoffset.c */ -long gmt_offset(time_t); +int gmt_offset(time_t); char *gmtoffset(time_t); char *str_time(time_t); char *t_elapsed(time_t, time_t); @@ -2294,8 +2294,8 @@ int file_cp(char *from, char *to); int file_rm(char *path); int file_mv(char *oldpath, char *newpath); int file_exist(char *path, int mode); -long file_size(char *path); -long file_crc(char *path, int); +int file_size(char *path); +int file_crc(char *path, int); time_t file_time(char *path); int mkdirs(char *name, mode_t); int getfilecase(char *, char *); @@ -2337,7 +2337,7 @@ char *arcname(faddr *, unsigned short, int); void mbse_Setraw(void); /* Set raw mode */ void mbse_Unsetraw(void); /* Unset raw mode */ unsigned char mbse_Getone(void); /* Get one raw character */ -long mbse_Speed(void); /* Get (locked) tty speed */ +int mbse_Speed(void); /* Get (locked) tty speed */ int mbse_Waitchar(unsigned char *, int); /* Wait n * 10mSec for char */ int mbse_Escapechar(unsigned char *); /* Escape sequence test */ unsigned char mbse_Readkey(void); /* Read a translated key */ @@ -2448,8 +2448,8 @@ char *bgets(char *, int, FILE *); */ typedef struct _TIMEINFO { time_t time; - long usec; - long tzone; + int usec; + int tzone; } TIMEINFO; /* @@ -2461,7 +2461,7 @@ typedef enum _MERIDIAN { typedef union { - time_t Number; + int32_t Number; enum _MERIDIAN Meridian; } CYYSTYPE; diff --git a/lib/msg.c b/lib/msg.c index f61fadc5..b830cecf 100644 --- a/lib/msg.c +++ b/lib/msg.c @@ -64,24 +64,24 @@ char *strupr (char *s) -long filelength(int fd) +int filelength(int fd) { - long retval = -1L; - struct stat buf; + int retval = -1L; + struct stat buf; - if (fd != -1) { - fstat(fd, &buf); - retval = buf.st_size; - } + if (fd != -1) { + fstat(fd, &buf); + retval = buf.st_size; + } - return (retval); + return (retval); } -long tell(int fd) +int tell(int fd) { - long retval = -1L; + int retval = -1L; if (fd != -1) retval = lseek(fd, 0L, SEEK_CUR); @@ -122,7 +122,7 @@ void Msg_Close(void) /* * Delete message number */ -int Msg_Delete(unsigned long ulMsg) +int Msg_Delete(unsigned int ulMsg) { if (!MsgBase.Locked) return FALSE; @@ -152,14 +152,14 @@ int Msg_GetLastRead(lastread *LR) /* * Get highest message number */ -unsigned long Msg_Highest(void) +unsigned int Msg_Highest(void) { return MsgBase.Highest = JAM_Highest(); } -int Msg_Lock(unsigned long ulTimeout) +int Msg_Lock(unsigned int ulTimeout) { return MsgBase.Locked = JAM_Lock(ulTimeout); } @@ -169,7 +169,7 @@ int Msg_Lock(unsigned long ulTimeout) /* * Get lowest message number */ -unsigned long Msg_Lowest(void) +unsigned int Msg_Lowest(void) { return MsgBase.Lowest = JAM_Lowest(); } @@ -190,7 +190,7 @@ int Msg_NewLastRead(lastread LR) -int Msg_Next(unsigned long * ulMsg) +int Msg_Next(unsigned int * ulMsg) { return JAM_Next(ulMsg); } @@ -200,7 +200,7 @@ int Msg_Next(unsigned long * ulMsg) /* * Return number of messages */ -unsigned long Msg_Number(void) +unsigned int Msg_Number(void) { return MsgBase.Total = JAM_Number(); } @@ -244,14 +244,14 @@ void Msg_Pack(void) -int Msg_Previous (unsigned long * ulMsg) +int Msg_Previous (unsigned int * ulMsg) { return JAM_Previous(ulMsg); } -int Msg_ReadHeader (unsigned long ulMsg) +int Msg_ReadHeader (unsigned int ulMsg) { return JAM_ReadHeader(ulMsg); } @@ -261,7 +261,7 @@ int Msg_ReadHeader (unsigned long ulMsg) /* * Read message */ -int Msg_Read(unsigned long ulMsg, int nWidth) +int Msg_Read(unsigned int ulMsg, int nWidth) { return JAM_Read(ulMsg, nWidth); } @@ -292,7 +292,7 @@ void Msg_UnLock(void) /* * Write message header */ -int Msg_WriteHeader (unsigned long ulMsg) +int Msg_WriteHeader (unsigned int ulMsg) { if (!MsgBase.Locked) return FALSE; @@ -318,8 +318,8 @@ void Msg_Write(FILE *fp) typedef struct { - unsigned long Subject; - unsigned long Number; + unsigned int Subject; + unsigned int Number; } MSGLINK; @@ -380,7 +380,7 @@ void msg_colour(int fg, int bg) int Msg_Link(char *Path, int do_quiet, int slow_util) { int i, m, msg_link = 0; - unsigned long Number, Prev, Next, Crc, Total; + unsigned int Number, Prev, Next, Crc, Total; char Temp[128], *p; MSGLINK *Link; @@ -415,13 +415,13 @@ int Msg_Link(char *Path, int do_quiet, int slow_util) i++; if (((i % 10) == 0) && (!do_quiet)) { - printf("%6d / %6lu\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b", i, Total); + printf("%6d / %6u\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b", i, Total); fflush(stdout); } } while(Msg_Next(&Number) == TRUE); if (!do_quiet) { - printf("%6d / %6lu\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b", i, Total); + printf("%6d / %6u\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b", i, Total); fflush(stdout); } Number = Msg_Lowest(); @@ -445,7 +445,7 @@ int Msg_Link(char *Path, int do_quiet, int slow_util) } if (((i % 10) == 0) && (!do_quiet)) { - printf("%6d / %6lu\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b", i, Total); + printf("%6d / %6u\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b", i, Total); fflush(stdout); } @@ -461,7 +461,7 @@ int Msg_Link(char *Path, int do_quiet, int slow_util) } while(Msg_Next(&Number) == TRUE); if (!do_quiet) { - printf("%6d / %6lu\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b", i, Total); + printf("%6d / %6u\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b", i, Total); fflush(stdout); } diff --git a/lib/msg.h b/lib/msg.h index 098310eb..58649fa7 100644 --- a/lib/msg.h +++ b/lib/msg.h @@ -14,8 +14,8 @@ * Global message buffer */ typedef struct _msgbuf { - unsigned long Id; - unsigned long Current; + unsigned int Id; + unsigned int Current; char From[101]; /* From name */ char To[101]; /* To name */ char Subject[101]; /* Message subject */ @@ -56,15 +56,15 @@ typedef struct _msgbuf { time_t Read; /* Date message is received */ char FromAddress[101]; /* From address */ char ToAddress[101]; /* To address */ - unsigned long Reply; /* Message is reply to */ - unsigned long Original; /* Original message */ - unsigned long MsgIdCRC; /* Message Id CRC */ - unsigned long ReplyCRC; /* Reply CRC */ + unsigned int Reply; /* Message is reply to */ + unsigned int Original; /* Original message */ + unsigned int MsgIdCRC; /* Message Id CRC */ + unsigned int ReplyCRC; /* Reply CRC */ char Msgid[81]; /* Msgid string */ char Replyid[81]; /* Replyid string */ char ReplyAddr[81]; /* Gated Reply Address */ char ReplyTo[81]; /* Gated Reply To */ - long Size; /* Message size during write*/ + int Size; /* Message size during write*/ } msgbuf; @@ -76,10 +76,10 @@ typedef struct _msgbase { char Path[PATH_MAX]; /* Path to message base */ unsigned Open : 1; /* If base is open */ unsigned Locked : 1; /* If base is locked */ - unsigned long LastNum; /* Lastread message number */ - unsigned long Lowest; /* Lowest message number */ - unsigned long Highest; /* Highest message number */ - unsigned long Total; /* Total number of msgs */ + unsigned int LastNum; /* Lastread message number */ + unsigned int Lowest; /* Lowest message number */ + unsigned int Highest; /* Highest message number */ + unsigned int Total; /* Total number of msgs */ } msgbase; @@ -88,10 +88,10 @@ typedef struct _msgbase { * LastRead structure */ typedef struct _lastread { - unsigned long UserCRC; /* CRC32 lowercase username */ - unsigned long UserID; /* Unique user-id */ - unsigned long LastReadMsg; /* Last Read message number */ - unsigned long HighReadMsg; /* Highes read message */ + unsigned int UserCRC; /* CRC32 lowercase username */ + unsigned int UserID; /* Unique user-id */ + unsigned int LastReadMsg; /* Last Read message number */ + unsigned int HighReadMsg; /* Highes read message */ } lastread; @@ -112,8 +112,8 @@ char szWrp[MAX_LINE_LENGTH + 1]; */ char *strlwr(char *); char *strupr(char *); -long filelength(int); -long tell(int); +int filelength(int); +int tell(int); char *Fgets(char *, int, FILE *); @@ -123,24 +123,24 @@ char *Fgets(char *, int, FILE *); */ int Msg_AddMsg(void); void Msg_Close(void); -int Msg_Delete(unsigned long); +int Msg_Delete(unsigned int); void Msg_DeleteMsgBase(char *); int Msg_GetLastRead(lastread *); -unsigned long Msg_Highest(void); -int Msg_Lock(unsigned long); -unsigned long Msg_Lowest(void); +unsigned int Msg_Highest(void); +int Msg_Lock(unsigned int); +unsigned int Msg_Lowest(void); void Msg_New(void); int Msg_NewLastRead(lastread); -int Msg_Next(unsigned long *); -unsigned long Msg_Number(void); +int Msg_Next(unsigned int *); +unsigned int Msg_Number(void); int Msg_Open(char *); void Msg_Pack(void); -int Msg_Previous(unsigned long *); -int Msg_ReadHeader(unsigned long); -int Msg_Read(unsigned long, int); +int Msg_Previous(unsigned int *); +int Msg_ReadHeader(unsigned int); +int Msg_Read(unsigned int, int); int Msg_SetLastRead(lastread); void Msg_UnLock(void); -int Msg_WriteHeader(unsigned long); +int Msg_WriteHeader(unsigned int); void Msg_Write(FILE *); int Msg_Link(char *, int, int); diff --git a/lib/nodelist.c b/lib/nodelist.c index 352737d1..e00e75f9 100644 --- a/lib/nodelist.c +++ b/lib/nodelist.c @@ -40,7 +40,7 @@ static char *k, *v; static char *nlpath = NULL; static int nlinitdone = FALSE; static int linecnt = 0; -static unsigned long mypots = 0, myisdn = 0, mytcpip =0; +static unsigned int mypots = 0, myisdn = 0, mytcpip =0; static int getkwd(char**); @@ -76,12 +76,12 @@ static struct _keytab { /* - * Get a keyword, string, unsigned long + * Get a keyword, string, unsigned int */ static int getkwd(char **dest) { char *p; - unsigned long tmp; + unsigned int tmp; nodelist_flag **tmpm; for (p = v; *p && !isspace(*p); p++); @@ -107,12 +107,12 @@ static int getkwd(char **dest) /* - * Get a keyword, string, unsigned long, unsigned long + * Get a keyword, string, unsigned int, unsigned int */ static int getmdm(char **dest) { char *p, *q; - unsigned long tmp1, tmp2; + unsigned int tmp1, tmp2; nodelist_modem **tmpm; for (p = v; *p && !isspace(*p); p++); @@ -202,12 +202,12 @@ static int getdom(char **dest) /* - * Get a keyword, string, string, unsigned long + * Get a keyword, string, string, unsigned int */ static int getsrv(char **dest) { char *p, *q; - unsigned long tmp; + unsigned int tmp; nodelist_service **tmpm; for (p = v; *p && !isspace(*p); p++); @@ -540,7 +540,7 @@ node *getnlent(faddr *addr) char *mydomain, *path, *r; struct _nlfil fdx; struct _nlidx ndx; - long lowest, highest, current; + int lowest, highest, current; struct _nodeshdr ndhdr; static struct _nodes nd; nodelist_modem **tmpm; @@ -548,7 +548,7 @@ node *getnlent(faddr *addr) nodelist_service **tmps; nodelist_array **tmpa, **tmpaa; nodelist_domsuf **tmpd; - unsigned long tport = 0; + unsigned int tport = 0; Syslog('n', "getnlent: %s", ascfnode(addr,0xff)); @@ -1090,7 +1090,7 @@ node *getnlent(faddr *addr) * No optional port number, add one from the default * for this protocol. */ - snprintf(tbuf, 256, ":%lu", tport); + snprintf(tbuf, 256, ":%u", tport); nodebuf.url = xstrcat(nodebuf.url, tbuf); } @@ -1146,7 +1146,7 @@ node *getnlent(faddr *addr) return &nodebuf; badsyntax: - WriteError("nodelist %d offset +%lu: bad syntax in line \"%s\"", ndx.fileno, (unsigned long)ndx.offset, buf); + WriteError("nodelist %d offset +%lu: bad syntax in line \"%s\"", ndx.fileno, (unsigned int)ndx.offset, buf); /* fallthrough */ retdummy: @@ -1165,7 +1165,7 @@ retdummy: -void olflags(unsigned long flags) +void olflags(unsigned int flags) { char *t; nodelist_flag **tmpm; @@ -1183,7 +1183,7 @@ void olflags(unsigned long flags) -void rqflags(unsigned long flags) +void rqflags(unsigned int flags) { char *t; nodelist_flag **tmpm; @@ -1208,7 +1208,7 @@ void rqflags(unsigned long flags) -void moflags(unsigned long flags) +void moflags(unsigned int flags) { char *t; nodelist_modem **tmpm; @@ -1228,7 +1228,7 @@ void moflags(unsigned long flags) -void diflags(unsigned long flags) +void diflags(unsigned int flags) { char *t; nodelist_modem **tmpm; @@ -1248,7 +1248,7 @@ void diflags(unsigned long flags) -void ipflags(unsigned long flags) +void ipflags(unsigned int flags) { char *t; nodelist_modem **tmpm; diff --git a/lib/nodelist.h b/lib/nodelist.h index dcd61546..7b5d44e5 100644 --- a/lib/nodelist.h +++ b/lib/nodelist.h @@ -24,11 +24,11 @@ typedef struct _node { char *sysop; /* Sysop name */ char *phone; /* Phone number */ unsigned speed; /* Baudrate */ - unsigned long mflags; /* Modem flags */ - unsigned long dflags; /* ISDN flags */ - unsigned long iflags; /* TCP-IP flags */ - unsigned long oflags; /* Online flags */ - unsigned long xflags; /* Request flags */ + unsigned int mflags; /* Modem flags */ + unsigned int dflags; /* ISDN flags */ + unsigned int iflags; /* TCP-IP flags */ + unsigned int oflags; /* Online flags */ + unsigned int xflags; /* Request flags */ char *uflags[MAXUFLAGS]; /* User flags */ int t1; /* T flag, first char */ int t2; /* T flag, second char */ @@ -47,15 +47,15 @@ typedef struct _node { typedef struct _nodelist_flag { struct _nodelist_flag *next; char *name; - unsigned long value; + unsigned int value; } nodelist_flag; typedef struct _nodelist_modem { struct _nodelist_modem *next; char *name; - unsigned long mask; - unsigned long value; + unsigned int mask; + unsigned int value; } nodelist_modem; @@ -76,8 +76,8 @@ typedef struct _nodelist_service { struct _nodelist_service *next; char *flag; char *service; - unsigned long defport; /* Configured default port */ - unsigned long tmpport; /* Override port for call */ + unsigned int defport; /* Configured default port */ + unsigned int tmpport; /* Override port for call */ } nodelist_service; @@ -122,11 +122,11 @@ nodelist_service *nl_service; int initnl(void); void deinitnl(void); node *getnlent(faddr *); -void olflags(unsigned long); -void rqflags(unsigned long); -void moflags(unsigned long); -void diflags(unsigned long); -void ipflags(unsigned long); +void olflags(unsigned int); +void rqflags(unsigned int); +void moflags(unsigned int); +void diflags(unsigned int); +void ipflags(unsigned int); #endif diff --git a/lib/nodelock.c b/lib/nodelock.c index 777afc8f..2ae34beb 100644 --- a/lib/nodelock.c +++ b/lib/nodelock.c @@ -104,7 +104,7 @@ int nodelock(faddr *addr, pid_t mypid) */ ltime = file_time(fn); now = time(NULL); - if (CFG.ZeroLocks && (rc != 1) && (((unsigned long)now - (unsigned long)ltime) > 21600)) { + if (CFG.ZeroLocks && (rc != 1) && (((unsigned int)now - (unsigned int)ltime) > 21600)) { Syslog('+', "Found zero byte lock older then 6 hours for %s, unlink", ascfnode(addr,0x1f)); unlink(fn); } else if (CFG.ZeroLocks && (rc != 1)) { @@ -115,7 +115,7 @@ int nodelock(faddr *addr, pid_t mypid) } else if (kill(pid, 0) && (errno == ESRCH)) { Syslog('+', "Found stale bsy file for %s, unlink", ascfnode(addr,0x1f)); unlink(fn); - } else if (((unsigned long)now - (unsigned long)ltime) > 21600) { + } else if (((unsigned int)now - (unsigned int)ltime) > 21600) { Syslog('+', "Found lock older then 6 hours for %s, unlink", ascfnode(addr,0x1f)); unlink(fn); } else { diff --git a/lib/parsedate.c b/lib/parsedate.c index 49aa258a..66718619 100644 --- a/lib/parsedate.c +++ b/lib/parsedate.c @@ -1408,8 +1408,8 @@ date_error(s) int GetTimeInfo(TIMEINFO *Now) { - static time_t NextHour; - static long LastTzone; + static int32_t NextHour; + static int LastTzone; struct tm *tm; int secondsUntilNextHour; #if defined(HAVE_GETTIMEOFDAY) diff --git a/lib/pktname.c b/lib/pktname.c index 96132f47..d0e6a829 100644 --- a/lib/pktname.c +++ b/lib/pktname.c @@ -257,7 +257,7 @@ char *arcname(faddr *addr, unsigned short Zone, int ARCmailCompat) * Generate ARCfile name from the CRC of the ASCII string * of the node address. */ - snprintf(p, PATH_MAX -1, "/%08lx.%s0", StringCRC32(ascfnode(addr, 0x1f)), ext); + snprintf(p, PATH_MAX -1, "/%08x.%s0", StringCRC32(ascfnode(addr, 0x1f)), ext); } else { if (addr->point) { snprintf(p, PATH_MAX -1, "/%04x%04x.%s0", diff --git a/lib/rawio.c b/lib/rawio.c index 28f616d5..9df54584 100644 --- a/lib/rawio.c +++ b/lib/rawio.c @@ -4,7 +4,7 @@ * Purpose ...............: Raw I/O routines. * ***************************************************************************** - * Copyright (C) 1997-2004 + * Copyright (C) 1997-2005 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -117,7 +117,7 @@ unsigned char mbse_Getone() /* * Read the (locked) speed from the tty */ -long mbse_Speed(void) +int mbse_Speed(void) { speed_t mspeed; diff --git a/lib/rfcdate.c b/lib/rfcdate.c index 3a545e8b..e2bfe3bb 100644 --- a/lib/rfcdate.c +++ b/lib/rfcdate.c @@ -143,7 +143,7 @@ char *rfcdate(time_t now) struct tm ptm, gtm; char sign; int hr, min; - long offset; + int offset; if (!now) now = time(NULL); diff --git a/lib/strutil.c b/lib/strutil.c index 7f19f737..79b761ae 100644 --- a/lib/strutil.c +++ b/lib/strutil.c @@ -4,7 +4,7 @@ * Purpose ...............: Common string functions * ***************************************************************************** - * Copyright (C) 1997-2004 + * Copyright (C) 1997-2005 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -40,12 +40,12 @@ char *padleft(char *str, int size, char pad) static char temp[256]; strcpy(stri, str); - memset(temp, pad, (long)size); + memset(temp, pad, (size_t)size); temp[size] = '\0'; if (strlen(stri) <= size) - memmove(temp, stri, (long)strlen(stri)); + memmove(temp, stri, (size_t)strlen(stri)); else - memmove(temp, stri, (long)size); + memmove(temp, stri, (size_t)size); return temp; } @@ -258,12 +258,12 @@ void strreplace(char *sStr, char *sFind, char *sReplace) */ char *StrTimeHM(time_t date) { - static char ttime[6]; - struct tm *l_d; + static char ttime[6]; + struct tm *l_d; - l_d = localtime(&date); - snprintf(ttime, 6, "%02d:%02d", l_d->tm_hour, l_d->tm_min); - return ttime; + l_d = localtime(&date); + snprintf(ttime, 6, "%02d:%02d", l_d->tm_hour, l_d->tm_min); + return ttime; } diff --git a/lib/users.h b/lib/users.h index fba29740..8e3e7148 100644 --- a/lib/users.h +++ b/lib/users.h @@ -54,8 +54,8 @@ typedef enum {LINEEDIT, FSEDIT, EXTEDIT} MSGEDITOR; */ typedef struct _security { unsigned int level; /* Security level */ - unsigned long flags; /* Access flags */ - unsigned long notflags; /* No Access flags */ + unsigned int flags; /* Access flags */ + unsigned int notflags; /* No Access flags */ } securityrec; #endif @@ -73,21 +73,21 @@ typedef struct _security { * Users Control Structures (users.data) */ struct userhdr { - long hdrsize; /* Size of header */ - long recsize; /* Size of records */ + int hdrsize; /* Size of header */ + int recsize; /* Size of records */ }; struct userrec { char sUserName[36]; /* User First and Last Name */ char Name[9]; /* Unix name */ - unsigned long xPassword; + unsigned int xPassword; char sVoicePhone[20]; /* Voice Number */ char sDataPhone[20]; /* Data/Business Number */ char sLocation[28]; /* Users Location */ char address[3][41]; /* Users address */ char sDateOfBirth[12]; /* Date of Birth */ - time_t tFirstLoginDate; /* Date of First Login */ - time_t tLastLoginDate; /* Date of Last Login */ + int32_t tFirstLoginDate; /* Date of First Login */ + int32_t tLastLoginDate; /* Date of Last Login */ securityrec Security; /* User Security Level */ char sComment[81]; /* User Comment */ char sExpiryDate[12]; /* User Expiry Date */ @@ -113,9 +113,9 @@ struct userrec { int iConnectTime; /* Connect time this call */ int iTimeUsed; /* Time used today */ int xScreenLen; - time_t tLastPwdChange; /* Date last password chg */ + int32_t tLastPwdChange; /* Date last password chg */ unsigned xHangUps; - long Credit; /* Users credit */ + int Credit; /* Users credit */ int Paged; /* Times paged today */ int MsgEditor; /* Message Editor to use */ int LastPktNum; /* Todays Last packet number*/ @@ -124,12 +124,12 @@ struct userrec { int iLastFileArea; /* Number of last file area */ int iLastFileGroup; /* Number of last file group*/ char sProtocol[21]; /* Users default protocol */ - unsigned long Downloads; /* Total number of d/l's */ - unsigned long Uploads; /* Total number of uploads */ - unsigned long UploadK; /* Upload KiloBytes */ - unsigned long DownloadK; /* Download KiloBytes */ - long DownloadKToday; /* KB Downloaded today */ - long UploadKToday; /* KB Uploaded today */ + unsigned int Downloads; /* Total number of d/l's */ + unsigned int Uploads; /* Total number of uploads */ + unsigned int UploadK; /* Upload KiloBytes */ + unsigned int DownloadK; /* Download KiloBytes */ + int DownloadKToday; /* KB Downloaded today */ + int UploadKToday; /* KB Uploaded today */ int iTransferTime; /* Last file transfer time */ int iLastMsgArea; /* Number of last msg area */ int iLastMsgGroup; /* Number of last msg group */ diff --git a/mbcico/answer.c b/mbcico/answer.c index 81c56cef..e0e837f6 100644 --- a/mbcico/answer.c +++ b/mbcico/answer.c @@ -46,8 +46,8 @@ extern int carrier, online; extern time_t c_start, c_end; -extern unsigned long sentbytes; -extern unsigned long rcvdbytes; +extern unsigned int sentbytes; +extern unsigned int rcvdbytes; extern int Loaded; int answer(char *stype) diff --git a/mbcico/atoul.c b/mbcico/atoul.c index 924aa5ad..5560c687 100644 --- a/mbcico/atoul.c +++ b/mbcico/atoul.c @@ -4,7 +4,7 @@ * Purpose ...............: Fidonet mailer * ***************************************************************************** - * Copyright (C) 1997-2004 + * Copyright (C) 1997-2005 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -33,11 +33,11 @@ #include "atoul.h" -unsigned long atoul(char *str) +unsigned int atoul(char *str) { - unsigned long x; + unsigned int x; - if (sscanf(str,"%lu",&x) == 1) + if (sscanf(str,"%u",&x) == 1) return x; else return 0xffffffff; } diff --git a/mbcico/atoul.h b/mbcico/atoul.h index 50f62b1d..8332b3a8 100644 --- a/mbcico/atoul.h +++ b/mbcico/atoul.h @@ -1,8 +1,9 @@ #ifndef _ATOUL_H #define _ATOUL_H +/* $Id$ */ -unsigned long atoul(char *); +unsigned int atoul(char *); #endif diff --git a/mbcico/binkp.c b/mbcico/binkp.c index 677d25a3..43a759e2 100644 --- a/mbcico/binkp.c +++ b/mbcico/binkp.c @@ -80,8 +80,8 @@ extern int crashme; int gotblock = 0; -extern unsigned long sentbytes; -extern unsigned long rcvdbytes; +extern unsigned int sentbytes; +extern unsigned int rcvdbytes; typedef enum {RxWaitF, RxAccF, RxReceD, RxWriteD, RxEOB, RxDone} RxType; typedef enum {TxGNF, TxTryR, TxReadS, TxWLA, TxDone} TxType; @@ -154,8 +154,8 @@ struct binkprec { unsigned short header; /* Frame header */ int rc; /* General return code */ - long rsize; /* Receiver filesize */ - long roffs; /* Receiver offset */ + int rsize; /* Receiver filesize */ + int roffs; /* Receiver offset */ char *rname; /* Receiver filename */ time_t rtime; /* Receiver filetime */ FILE *rxfp; /* Receiver file */ @@ -174,13 +174,13 @@ struct binkprec { int stxpos; /* Transmitter start position */ int txcompressed; /* Transmitter compressed bytes */ int tmode; /* Transmitter compression mode */ - long tfsize; /* Transmitter filesize */ + int tfsize; /* Transmitter filesize */ int local_EOB; /* Local EOB sent */ int remote_EOB; /* Got EOB from remote */ int messages; /* Messages sent + rcvd */ - unsigned long nethold; /* Netmail on hold */ - unsigned long mailhold; /* Packed mail on hold */ + unsigned int nethold; /* Netmail on hold */ + unsigned int mailhold; /* Packed mail on hold */ int batchnr; int msgs_on_queue; /* Messages on the queue */ @@ -229,7 +229,7 @@ int binkp_expired(void); /* Timer expired? */ int binkp_banner(int); /* Send system banner */ int binkp_send_comp_opts(void); /* Send compression options */ void binkp_set_comp_state(void); /* Set compression state */ -int binkp_recv_command(char *, unsigned long *, int *); /* Receive command frame */ +int binkp_recv_command(char *, unsigned int *, int *); /* Receive command frame */ void parse_m_nul(char *); /* Parse M_NUL message */ int binkp_poll_frame(void); /* Poll for a frame */ void binkp_add_message(char *frame); /* Add cmd frame to queue */ @@ -390,7 +390,7 @@ SM_EDECL faddr *primary; char *p, *q, *pwd; int i, rc = 0, cmd, dupe, SendPass = FALSE, akas = 0; - unsigned long bufl; + unsigned int bufl; fa_list **tmp, *tmpa; faddr *fa, ra; callstat *cst; @@ -664,7 +664,7 @@ SM_NAMES SM_EDECL char *p, *q, *pw; int i, rc, cmd, dupe, we_have_pwd = FALSE, akas = 0; - unsigned long bufl; + unsigned int bufl; fa_list **tmp, *tmpa; faddr *fa; callstat *cst; @@ -1041,7 +1041,7 @@ int file_transfer(void) TrType binkp_receiver(void) { struct statfs sfs; - long written; + int written; off_t rxbytes; int bcmd, rc = 0; int rc1 = 0, nget = bp.blklen, zavail, nput; @@ -1181,8 +1181,8 @@ TrType binkp_receiver(void) if (statfs(tempinbound, &sfs) == 0) { if ((bp.rsize / (sfs.f_bsize + 1)) >= sfs.f_bfree) { - Syslog('!', "Binkp: only %lu blocks free (need %lu) in %s for this file", sfs.f_bfree, - (unsigned long)(bp.rsize / (sfs.f_bsize + 1)), tempinbound); + Syslog('!', "Binkp: only %u blocks free (need %u) in %s for this file", sfs.f_bfree, + (unsigned int)(bp.rsize / (sfs.f_bsize + 1)), tempinbound); bclosefile(FALSE); bp.rxfp = NULL; /* Force SKIP command */ } @@ -1521,10 +1521,10 @@ TrType binkp_transmitter(void) bp.txcompressed = 0; bp.tfsize = tmp->size; Syslog('+', "Binkp: send \"%s\" as \"%s\"", MBSE_SS(tmp->local), MBSE_SS(tmp->remote)); - Syslog('+', "Binkp: size %lu bytes, dated %s, comp %s", - (unsigned long)tmp->size, date(tmp->date), cpstate[bp.tmode]); - rc = binkp_send_command(MM_FILE, "%s %lu %ld %ld%s", MBSE_SS(tmp->remote), - (unsigned long)tmp->size, (long)tmp->date, (unsigned long)tmp->offset, extra); + Syslog('+', "Binkp: size %u bytes, dated %s, comp %s", + (unsigned int)tmp->size, date(tmp->date), cpstate[bp.tmode]); + rc = binkp_send_command(MM_FILE, "%s %u %d %d%s", MBSE_SS(tmp->remote), + (unsigned int)tmp->size, (int)tmp->date, (unsigned int)tmp->offset, extra); if (rc) { bp.TxState = TxDone; return Failure; @@ -1772,7 +1772,7 @@ int binkp_send_frame(int cmd, char *buf, int len) int rc, id; #ifdef HAVE_ZLIB_H int rcz, last; - unsigned long zlen; + uLongf zlen; char *zbuf; if ((len >= BINKP_PLZ_BLOCK) && (bp.PLZwe == Active)) { @@ -2077,7 +2077,7 @@ void binkp_set_comp_state(void) /* * Receive command frame */ -int binkp_recv_command(char *buf, unsigned long *len, int *cmd) +int binkp_recv_command(char *buf, unsigned int *len, int *cmd) { int b0, b1; @@ -2244,7 +2244,7 @@ int binkp_poll_frame(void) { int c, rc = 0, bcmd; #ifdef HAVE_ZLIB_H - unsigned long zlen; + uLongf zlen; char *zbuf; #endif @@ -2380,7 +2380,7 @@ int binkp_process_messages(void) int Found, rmode; char *lname, *ropts; time_t ltime; - long lsize, loffs; + int lsize, loffs; Syslog('b', "Binkp: Process The Messages Queue Start"); diff --git a/mbcico/bopenfile.c b/mbcico/bopenfile.c index f301cb74..c38b6342 100644 --- a/mbcico/bopenfile.c +++ b/mbcico/bopenfile.c @@ -55,7 +55,7 @@ FILE *bopenfile(char *fname, time_t remtime, off_t remsize, off_t *resofs) strcpy(ctt,date(remtime)); - Syslog('b', "Binkp: bopenfile(\"%s\",%s,%lu)", MBSE_SS(fname), MBSE_SS(ctt), (unsigned long)remsize); + Syslog('b', "Binkp: bopenfile(\"%s\",%s,%u)", MBSE_SS(fname), MBSE_SS(ctt), (unsigned int)remsize); if ((fname == NULL) || (fname[0] == '\0')) { Syslog('+', "Binkp: bopenfile fname=NULL"); @@ -100,8 +100,8 @@ FILE *bopenfile(char *fname, time_t remtime, off_t remsize, off_t *resofs) temp = calloc(PATH_MAX, sizeof(char)); snprintf(temp, PATH_MAX, "%s.state", infpath); if ((fp = fopen(temp, "w"))) { - fprintf(fp, "%lu\n", (unsigned long)remtime); - fprintf(fp, "%lu\n", (unsigned long)remsize); + fprintf(fp, "%u\n", (unsigned int)remtime); + fprintf(fp, "%u\n", (unsigned int)remsize); fclose(fp); } free(temp); @@ -116,7 +116,7 @@ FILE *bopenfile(char *fname, time_t remtime, off_t remsize, off_t *resofs) freqname = xstrcat(freqname, fname); } - Syslog('b', "Binkp: opened file \"%s\", restart at %lu", infpath, (unsigned long)*resofs); + Syslog('b', "Binkp: opened file \"%s\", restart at %u", infpath, (unsigned int)*resofs); return infp; } diff --git a/mbcico/config.h b/mbcico/config.h index 5425eb27..e76795a9 100644 --- a/mbcico/config.h +++ b/mbcico/config.h @@ -3,9 +3,9 @@ /* $Id$ */ -extern long configtime; -extern long maxfsize; -extern long maxmsize; +extern int configtime; +extern int maxfsize; +extern int maxmsize; extern char *name; diff --git a/mbcico/dial.c b/mbcico/dial.c index d8b41a52..3e79d4ad 100644 --- a/mbcico/dial.c +++ b/mbcico/dial.c @@ -45,8 +45,8 @@ extern time_t c_end; extern int online; extern int master; int carrier; -extern long sentbytes; -extern long rcvdbytes; +extern int sentbytes; +extern int rcvdbytes; extern int Loaded; diff --git a/mbcico/emsidat.c b/mbcico/emsidat.c index 6650de93..f6dc8b18 100644 --- a/mbcico/emsidat.c +++ b/mbcico/emsidat.c @@ -220,7 +220,7 @@ char *mkemsidat(int caller) p=xstrcat(p,phone?emsiencode(phone):(char *)"-Unpublished-"); p=xstrcat(p,(char *)"]["); if ((CFG.IP_Speed) && (emsi_local_protos & PROT_TCP)) - snprintf(cbuf,16,"%ld",CFG.IP_Speed); + snprintf(cbuf,16,"%d",CFG.IP_Speed); else strcpy(cbuf,"9600"); p=xstrcat(p,cbuf); @@ -228,7 +228,7 @@ char *mkemsidat(int caller) p=xstrcat(p,flags?emsiencode(flags):(char *)""); p=xstrcat(p,(char *)"]}{TRX#}{["); tt = time(NULL); - snprintf(cbuf,16,"%08lX", (unsigned long)mtime2sl(tt)); + snprintf(cbuf,16,"%08X", (unsigned int)mtime2sl(tt)); p=xstrcat(p,cbuf); p=xstrcat(p,(char *)"]}{TZUTC}{["); p=xstrcat(p,gmtoffset(tt)); @@ -489,21 +489,21 @@ int scanemsidat(char *buf) } else Syslog('+', "remote TRX#: %s",p); } else if (strcasecmp(p, "TRAF") == 0) { - unsigned long tt, tt1; + unsigned int tt, tt1; p = sel_brace(NULL); - if (sscanf(p, "%08lx %08lx", &tt, &tt1) == 2) { + if (sscanf(p, "%08x %08x", &tt, &tt1) == 2) { Syslog('+', "netmail : %u byte(s)", tt); Syslog('+', "echomail: %u byte(s)", tt1); } else { Syslog('+', "TRAF : %s", p); } } else if (strcasecmp(p, "MOH#") == 0) { - unsigned long tt; + unsigned int tt; p = sel_brace(NULL); p = sel_bracket(p); - if (sscanf(p, "%08lx", &tt) == 1) + if (sscanf(p, "%08x", &tt) == 1) Syslog('+', "on hold : %u byte(s)", tt); else Syslog('+', "MOH# : %s", p); diff --git a/mbcico/filelist.c b/mbcico/filelist.c index 8df11a66..c896bed5 100644 --- a/mbcico/filelist.c +++ b/mbcico/filelist.c @@ -53,7 +53,7 @@ static char *tmpkname(void) { static char buf[16]; - snprintf(buf,16,"%08lx.pkt", sequencer()); + snprintf(buf,16,"%08x.pkt", sequencer()); return buf; } @@ -490,9 +490,9 @@ file_list *create_filelist(fa_list *al, char *fl, int create) } for (tmpf = st; tmpf; tmpf = tmpf->next) - Syslog('o',"flist: \"%s\" -> \"%s\" dsp:%d flofp:%lu floff:%lu", + Syslog('o',"flist: \"%s\" -> \"%s\" dsp:%d flofp:%u floff:%u", MBSE_SS(tmpf->local), MBSE_SS(tmpf->remote), tmpf->disposition, - (unsigned long)tmpf->flofp, (unsigned long)tmpf->floff); + (unsigned int)tmpf->flofp, (unsigned int)tmpf->floff); return st; } @@ -612,7 +612,7 @@ void execute_disposition(file_list *fl) */ if (fseek(fl->flofp, fl->floff, 0) == 0) { if (fwrite(&tpl,1,1,fl->flofp) != 1) { - WriteError("$Error writing '~' to .flo at %lu", (unsigned long)fl->floff); + WriteError("$Error writing '~' to .flo at %u", (unsigned int)fl->floff); } else { Syslog('o', "Marked file \"%s\" as sent", MBSE_SS(nm)); } @@ -625,7 +625,7 @@ void execute_disposition(file_list *fl) #endif #endif } else - WriteError("$error seeking in .flo to %lu", (unsigned long)fl->floff); + WriteError("$error seeking in .flo to %u", (unsigned int)fl->floff); } } @@ -658,7 +658,7 @@ void execute_disposition(file_list *fl) -char *transfertime(struct timeval start, struct timeval end, long bytes, int sent) +char *transfertime(struct timeval start, struct timeval end, int bytes, int sent) { static char resp[81]; double long startms, endms, elapsed; @@ -670,21 +670,21 @@ char *transfertime(struct timeval start, struct timeval end, long bytes, int sen if (!elapsed) elapsed = 1L; if (bytes > 1000000) - snprintf(resp, 81, "%ld bytes %s in %0.3Lf seconds (%0.3Lf Kb/s)", + snprintf(resp, 81, "%d bytes %s in %0.3Lf seconds (%0.3Lf Kb/s)", bytes, sent?"sent":"received", elapsed / 1000.000, ((bytes / elapsed) * 1000) / 1024); else - snprintf(resp, 81, "%ld bytes %s in %0.3Lf seconds (%0.3Lf Kb/s)", + snprintf(resp, 81, "%d bytes %s in %0.3Lf seconds (%0.3Lf Kb/s)", bytes, sent?"sent":"received", elapsed / 1000.000, ((bytes * 1000) / elapsed) / 1024); return resp; } -char *compress_stat(long original, long saved) +char *compress_stat(int original, int saved) { static char resp[81]; - snprintf(resp, 81, "compressed %ld bytes, compression %0.1f%%", saved, ((saved * 100.0) / original)); + snprintf(resp, 81, "compressed %d bytes, compression %0.1f%%", saved, ((saved * 100.0) / original)); return resp; } diff --git a/mbcico/filelist.h b/mbcico/filelist.h index 0f7d25b4..62581e8b 100644 --- a/mbcico/filelist.h +++ b/mbcico/filelist.h @@ -9,8 +9,8 @@ file_list *create_filelist(fa_list *, char *, int); file_list *create_freqlist(fa_list *); void tidy_filelist(file_list *, int); void execute_disposition(file_list *); -char *transfertime(struct timeval, struct timeval, long, int); -char *compress_stat(long, long); +char *transfertime(struct timeval, struct timeval, int, int); +char *compress_stat(int, int); #endif diff --git a/mbcico/ftsc.c b/mbcico/ftsc.c index aae978ad..9d42b327 100644 --- a/mbcico/ftsc.c +++ b/mbcico/ftsc.c @@ -368,7 +368,7 @@ SM_START(recv_packet) SM_STATE(recv_packet) - snprintf(recvpktname,16, "%08lx.pkt",(unsigned long)sequencer()); + snprintf(recvpktname,16, "%08x.pkt", sequencer()); if ((rc = xmrecv(recvpktname)) == 1) { SM_SUCCESS; } else if (rc == 0) { diff --git a/mbcico/hydra.c b/mbcico/hydra.c index 6a632c61..7ea0cf67 100644 --- a/mbcico/hydra.c +++ b/mbcico/hydra.c @@ -68,19 +68,19 @@ static int put_binbyte(char *outbuf, char c); static int put_hexbyte(char *outbuf, char c); static enum HyPktTypes hyrxpkt(char *rxbuf, int *rxlen, int tot); static void hytxpkt(enum HyPktTypes pkttype, char *txbuf, int txlen); -static int put_flags(char *buf, unsigned long Flags); -static unsigned long get_flags(char *buf); +static int put_flags(char *buf, unsigned int Flags); +static unsigned int get_flags(char *buf); static int resync(off_t off); static int hydra_batch(int role, file_list *to_send); -extern unsigned long sentbytes; -extern unsigned long rcvdbytes; +extern unsigned int sentbytes; +extern unsigned int rcvdbytes; static struct h_flags_struct { char *str; - unsigned long val; + unsigned int val; } h_flags[] = { { (char *)"XON", HOPT_XONXOFF }, @@ -103,28 +103,28 @@ static struct h_flags_struct { static int txoptions, rxoptions; -static char *put_long(char *buffer, long val) +static char *put_long(char *buffer, int val) { #ifdef WORDS_BIGENDIAN - buffer[0] = (unsigned long) val & 0xff; - buffer[1] = ((unsigned long) val >> 8) & 0xff; - buffer[2] = ((unsigned long) val >> 16) & 0xff; - buffer[3] = ((unsigned long) val >> 24) & 0xff; + buffer[0] = (unsigned int) val & 0xff; + buffer[1] = ((unsigned int) val >> 8) & 0xff; + buffer[2] = ((unsigned int) val >> 16) & 0xff; + buffer[3] = ((unsigned int) val >> 24) & 0xff; #else - *(unsigned long *) buffer = (unsigned long) val; + *(unsigned int *) buffer = (unsigned int) val; #endif return buffer; } -static long get_long(char *buffer) +static int get_long(char *buffer) { #ifdef WORDS_BIGENDIAN - return ((unsigned long) ((unsigned char) buffer[0])) | ((unsigned long) ((unsigned char) buffer[1]) << 8) | - ((unsigned long) ((unsigned char) buffer[2]) << 16) | ((unsigned long) ((unsigned char) buffer[3]) << 24); + return ((unsigned int) ((unsigned char) buffer[0])) | ((unsigned int) ((unsigned char) buffer[1]) << 8) | + ((unsigned int) ((unsigned char) buffer[2]) << 16) | ((unsigned int) ((unsigned char) buffer[3]) << 24); #else - return *(long *) buffer; + return *(int *) buffer; #endif } @@ -390,7 +390,7 @@ void hytxpkt(enum HyPktTypes pkttype, char *txbuf, int txlen) * check if we can use 32-bit CRC's */ if ((format != HCHR_HEXPKT) && (txoptions & HOPT_CRC32)) { - unsigned long crc; + unsigned int crc; /* * Calc CRC-32 of data + pkttype @@ -471,7 +471,7 @@ void hytxpkt(enum HyPktTypes pkttype, char *txbuf, int txlen) -int put_flags(char *buf, unsigned long Flags) +int put_flags(char *buf, unsigned int Flags) { int i, count = 0; @@ -494,9 +494,9 @@ int put_flags(char *buf, unsigned long Flags) -unsigned long get_flags(char *buf) +unsigned int get_flags(char *buf) { - unsigned long Flags = 0L; + unsigned int Flags = 0L; char *p; int i; @@ -530,11 +530,11 @@ int hydra_batch(int role, file_list *to_send) FILE *rxfp = NULL; /* file currently being received */ char *inbuf, *outbuf; int rxlen, txlen; /* length of receive/transmit buffer */ - long txwindow, rxwindow; /* window sizes */ - long txpos; + int txwindow, rxwindow; /* window sizes */ + int txpos; off_t rxpos; /* file positions */ - long stxpos, srxpos; - long longnum; + int stxpos, srxpos; + int longnum; int hdxlink = FALSE; int txretries, rxretries; int txlastack, txsyncid; @@ -556,7 +556,7 @@ int hydra_batch(int role, file_list *to_send) int txcompressed, rxctries; #ifdef HAVE_ZLIB_H static char txzbuf[H_ZIPBUFLEN], rxzbuf[H_ZIPBUFLEN]; - unsigned long rxzlen, txzlen; /* length of receive/transmit compressed buffer */ + unsigned int rxzlen, txzlen; /* length of receive/transmit compressed buffer */ int rcz, cmpblksize; #endif @@ -645,9 +645,9 @@ int hydra_batch(int role, file_list *to_send) if ((pkttype == HPKT_RPOS) && (rxlen == 12) && ((txstate == HTX_DATA) || (txstate == HTX_DATAACK) || (txstate == HTX_XWAIT) || (txstate == HTX_EOFACK))) { - long rpos_pos = get_long(rxbuf); - long rpos_blksize = get_long(rxbuf + 4); - long rpos_id = get_long(rxbuf + 8); + int rpos_pos = get_long(rxbuf); + int rpos_blksize = get_long(rxbuf + 4); + int rpos_id = get_long(rxbuf + 8); #ifdef HAVE_ZLIB_H /* @@ -875,7 +875,7 @@ int hydra_batch(int role, file_list *to_send) } Syslog('+', "Hydra: send \"%s\" as \"%s\"", MBSE_SS(to_send->local), MBSE_SS(to_send->remote)); - Syslog('+', "Hydra: size %lu bytes, dated %s",(unsigned long)txstat.st_size, date(txstat.st_mtime)); + Syslog('+', "Hydra: size %lu bytes, dated %s",(unsigned int)txstat.st_size, date(txstat.st_mtime)); gettimeofday(&txstarttime, &tz); } @@ -901,9 +901,9 @@ int hydra_batch(int role, file_list *to_send) break; } else { if (to_send) { - txlen = snprintf(txbuf, H_ZIPBUFLEN, "%08lx%08lx%08lx%08lx%08lx", - (long)mtime2sl(txstat.st_mtime+(txstat.st_mtime%2)), - (long)(txstat.st_size), 0UL, 0UL, 0UL); + txlen = snprintf(txbuf, H_ZIPBUFLEN, "%08x%08x%08x%08x%08x", + (int)mtime2sl(txstat.st_mtime+(txstat.st_mtime%2)), + (int)(txstat.st_size), 0U, 0U, 0U); /* * convert file name to DOS-format @@ -1038,9 +1038,12 @@ int hydra_batch(int role, file_list *to_send) Syslog('h', "Hydra: set BRAIN timer %d", H_BRAINDEAD); // 03-11-2003 MB. SETTIMER(TIMERNO_BRAIN, H_BRAINDEAD); // 03-11-2003 MB. #ifdef HAVE_ZLIB_H + uLongf destLen; if (compstate == HCMP_GZ) { txzlen = H_ZIPBUFLEN - 4; - rcz = compress2(txzbuf + 4, &txzlen, txbuf + 4, txlen, 9); + destLen = (uLongf)txzlen; + rcz = compress2(txzbuf + 4, &destLen, txbuf + 4, txlen, 9); + txzlen = (int)destLen; if (rcz == Z_OK) { Syslog('h', "Hydra: compressed OK, srclen=%d, destlen=%d, will send compressed=%s", txlen, txzlen, (txzlen < txlen) ?"yes":"no"); @@ -1357,7 +1360,7 @@ int hydra_batch(int role, file_list *to_send) * get desired window sizes */ txwindow = rxwindow = 0; - sscanf(inbuf, "%08lx%08lx", &rxwindow, &txwindow); + sscanf(inbuf, "%08x%08x", &rxwindow, &txwindow); if (rxwindow < 0) rxwindow = 0; @@ -1403,10 +1406,11 @@ int hydra_batch(int role, file_list *to_send) else if ((rxlen > 41) && (rxbuf[rxlen - 1] == 0)) { time_t timestamp; time_t orgstamp; - long filesize; + int filesize, tt; char dosname[8 + 1 + 3 + 1], *Name; - sscanf(rxbuf, "%08lx%08lx%*08x%*08x%*08x", ×tamp, &filesize); + sscanf(rxbuf, "%08x%08x%*08x%*08x%*08x", &tt, &filesize); + timestamp = (time_t)tt; /* convert timestamp to UNIX time */ orgstamp = timestamp; @@ -1496,9 +1500,12 @@ int hydra_batch(int role, file_list *to_send) /* * If data packet is a zlib compressed packet, uncompress it first. */ + uLongf destLen; if (pkttype == HPKT_ZIPDATA) { rxzlen = H_ZIPBUFLEN; - rcz = uncompress(rxzbuf, &rxzlen, rxbuf + 4, rxlen - 4); + destLen = (uLongf)rxzlen; + rcz = uncompress(rxzbuf, &destLen, rxbuf + 4, rxlen - 4); + rxzlen = (int)destLen; if (rcz == Z_OK) { /* * Uncompress data and put the data into the normal receive buffer. @@ -1684,7 +1691,7 @@ int hydra_batch(int role, file_list *to_send) */ if ((compstate != HCMP_NONE) && (rxctries > 2)) { Syslog('+', "Hydra: too much compress errors, instructing remote to stop compression"); - put_long(txbuf + 8, (long)-1L); + put_long(txbuf + 8, (int)-1L); } else { put_long(txbuf + 8, rxsyncid); } diff --git a/mbcico/inbound.c b/mbcico/inbound.c index f7bfbbfe..a8691554 100644 --- a/mbcico/inbound.c +++ b/mbcico/inbound.c @@ -196,7 +196,7 @@ int inbound_close(int success) /* * Get the free space size in the temp inbound directory. */ -long inbound_space(void) +int inbound_space(void) { struct statfs sfs; diff --git a/mbcico/inbound.h b/mbcico/inbound.h index 3621bf09..9a9d8ff4 100644 --- a/mbcico/inbound.h +++ b/mbcico/inbound.h @@ -34,6 +34,6 @@ int inbound_open(faddr *, int, int); /* Open temp inbound */ int inbound_close(int); /* Close temp inbound */ -long inbound_space(void); /* Get free inbound space */ +int inbound_space(void); /* Get free inbound space */ #endif diff --git a/mbcico/lutil.c b/mbcico/lutil.c index f9063133..b41fad29 100644 --- a/mbcico/lutil.c +++ b/mbcico/lutil.c @@ -86,7 +86,7 @@ int IsZMH() } -unsigned long rnd (void) +unsigned int rnd (void) { static int i; diff --git a/mbcico/lutil.h b/mbcico/lutil.h index 49dde3b0..71fc12df 100644 --- a/mbcico/lutil.h +++ b/mbcico/lutil.h @@ -6,6 +6,6 @@ void setmyname(char *); char *date(time_t); int IsZMH(void); -unsigned long rnd(void); +unsigned int rnd(void); #endif diff --git a/mbcico/mbcico.c b/mbcico/mbcico.c index b04e3cd8..a5a336f6 100644 --- a/mbcico/mbcico.c +++ b/mbcico/mbcico.c @@ -56,8 +56,8 @@ time_t t_end; time_t c_start; time_t c_end; int online = 0; -unsigned long sentbytes = 0; -unsigned long rcvdbytes = 0; +unsigned int sentbytes = 0; +unsigned int rcvdbytes = 0; int tcp_mode = TCPMODE_NONE; int Loaded = FALSE; int telnet = FALSE; diff --git a/mbcico/md5b.h b/mbcico/md5b.h index 9e55d9fb..03a066dc 100644 --- a/mbcico/md5b.h +++ b/mbcico/md5b.h @@ -38,7 +38,7 @@ typedef unsigned char *POINTER; /* UINT2 defines a two byte word */ typedef unsigned short int UINT2; /* UINT4 defines a four byte word */ -typedef unsigned long int UINT4; +typedef unsigned int UINT4; /* end of GLOBAL.H ---------------------------------------------------------- */ diff --git a/mbcico/openfile.c b/mbcico/openfile.c index 6e082f39..346b2a5a 100644 --- a/mbcico/openfile.c +++ b/mbcico/openfile.c @@ -61,10 +61,10 @@ FILE *openfile(char *fname, time_t remtime, off_t remsize, off_t *resofs, int(*r strcpy(ctt,date(remtime)); - Syslog('s', "openfile(\"%s\",%s,%lu,...)", MBSE_SS(fname), MBSE_SS(ctt), (unsigned long)remsize); + Syslog('s', "openfile(\"%s\",%s,%lu,...)", MBSE_SS(fname), MBSE_SS(ctt), (unsigned int)remsize); if ((fname == NULL) || (fname[0] == '\0')) { - snprintf(tmpfname,16,"%08lx.pkt",(unsigned long)sequencer()); + snprintf(tmpfname,16,"%08x.pkt",sequencer()); fname=tmpfname; } @@ -141,7 +141,7 @@ FILE *openfile(char *fname, time_t remtime, off_t remsize, off_t *resofs, int(*r rc = 1; p = strrchr(infpath,'/'); *p = '\0'; - snprintf(ctt,32,"%08lx.doe",(unsigned long)sequencer()); + snprintf(ctt,32,"%08x.doe",sequencer()); free(infpath); infpath = xstrcpy(p); infpath = xstrcat(infpath, ctt); @@ -158,7 +158,7 @@ FILE *openfile(char *fname, time_t remtime, off_t remsize, off_t *resofs, int(*r case 0: /* Success */ opentype = (char *)"a+"; *resofs = st.st_size; - Syslog('+', "Resyncing at offset %lu of \"%s\"", (unsigned long)st.st_size, infpath); + Syslog('+', "Resyncing at offset %lu of \"%s\"", (unsigned int)st.st_size, infpath); break; case -1: /* Binkp did send a GET, return here and do not open file */ free(infpath); @@ -184,7 +184,7 @@ FILE *openfile(char *fname, time_t remtime, off_t remsize, off_t *resofs, int(*r freqname = xstrcpy(infpath); } - Syslog('s', "opened file \"%s\" for \"%s\", restart at %lu", infpath,opentype,(unsigned long)*resofs); + Syslog('s', "opened file \"%s\" for \"%s\", restart at %lu", infpath,opentype,(unsigned int)*resofs); return infp; } diff --git a/mbcico/opentcp.c b/mbcico/opentcp.c index 0cdf3ffb..ee3a9a65 100644 --- a/mbcico/opentcp.c +++ b/mbcico/opentcp.c @@ -52,8 +52,8 @@ extern time_t c_end; extern int online; extern int master; extern int carrier; -extern long sentbytes; -extern long rcvdbytes; +extern int sentbytes; +extern int rcvdbytes; extern int Loaded; static int tcp_is_open = FALSE; diff --git a/mbcico/outstat.c b/mbcico/outstat.c index bb2e22e2..e8436033 100644 --- a/mbcico/outstat.c +++ b/mbcico/outstat.c @@ -301,8 +301,8 @@ int outstat() cst = getstatus(&(tmp->addr)); age = time(NULL); age -= tmp->time; - snprintf(temp, PATH_MAX -1, "%s %3d %9lu %s %s", - flstr, cst->tryno, (long)tmp->size, str_time(age), ascfnode(&(tmp->addr), 0x1f)); + snprintf(temp, PATH_MAX -1, "%s %3d %9u %s %s", + flstr, cst->tryno, (int)tmp->size, str_time(age), ascfnode(&(tmp->addr), 0x1f)); if (!do_quiet) printf("%s\n", temp); diff --git a/mbcico/respfreq.c b/mbcico/respfreq.c index 6e23f028..cc12c596 100644 --- a/mbcico/respfreq.c +++ b/mbcico/respfreq.c @@ -55,8 +55,8 @@ extern char *freqname; static void attach_report(file_list**); static void add_report(char *, ...); static char *report_text = NULL; -static unsigned long report_total = 0L; -static unsigned long report_count = 0L; +static unsigned int report_total = 0L; +static unsigned int report_count = 0L; static int no_more = FALSE; @@ -159,7 +159,7 @@ file_list *respfreq(char *nm, char *pw, char *dt) time_t upd = 0L; int newer = 1, Send; FILE *fa, *fi; - long Area; + int Area; struct FILEIndex idx; struct _fdbarea *fdb_area = NULL; @@ -432,13 +432,13 @@ file_list *respmagic(char *cmd) /* must free(cmd) before exit */ int i, escaped; file_list *fl = NULL; FILE *fp, *ft; - long zeroes = 0L; + int zeroes = 0L; ftnmsg fmsg; char *svname; Syslog('+', "Magic execute: %s", strrchr(xstrcpy(cmd), '/')+1); add_report((char *)"RQ: Magic \"%s\"",cmd); - snprintf(tmpfn, PATH_MAX -1, "%s/tmp/%08lX", getenv((char *)"MBSE_ROOT"), (unsigned long)sequencer()); + snprintf(tmpfn, PATH_MAX -1, "%s/tmp/%08X", getenv((char *)"MBSE_ROOT"), (unsigned int)sequencer()); Syslog('+', "tmpfn \"%s\"", tmpfn); if ((p = strrchr(cmd,'/'))) p++; @@ -483,7 +483,7 @@ file_list *respmagic(char *cmd) /* must free(cmd) before exit */ unlink(tmpfn); } else { if (stat(tmpfn, &st) == 0) { - snprintf(tmptx, PATH_MAX -1, "%s/tmp/%08lX", getenv((char *)"MBSE_ROOT"), (unsigned long)sequencer()); + snprintf(tmptx, PATH_MAX -1, "%s/tmp/%08X", getenv((char *)"MBSE_ROOT"), (unsigned int)sequencer()); Syslog('+', "tmptx \"%s\"", tmptx); if ((fp = fopen(tmptx, "w"))) { @@ -523,7 +523,7 @@ file_list *respmagic(char *cmd) /* must free(cmd) before exit */ } fwrite(&zeroes, 1, 3, fp); fclose(fp); - snprintf(remname, 32, "%08lX.PKT", (unsigned long)sequencer()); + snprintf(remname, 32, "%08X.PKT", (unsigned int)sequencer()); add_list(&fl, tmptx, remname, KFS, 0L, NULL, 0); fmsg.from->name = svname; @@ -549,7 +549,7 @@ static void attach_report(file_list **fl) FILE *fp; char *tmpfn; char remname[14]; - long zeroes = 0L, recno, records; + int zeroes = 0L, recno, records; ftnmsg fmsg; char *svname; @@ -595,7 +595,7 @@ static void attach_report(file_list **fl) add_report((char *)"\r%s\r", TearLine()); - snprintf(tmpfn, PATH_MAX -1, "%s/tmp/%08lX.rpl", getenv((char *)"MBSE_ROOT"), (unsigned long)sequencer()); + snprintf(tmpfn, PATH_MAX -1, "%s/tmp/%08X.rpl", getenv((char *)"MBSE_ROOT"), (unsigned int)sequencer()); if ((fp = fopen(tmpfn,"w"))) { fmsg.flags = M_PVT|M_KILLSENT; fmsg.from = bestaka_s(remote->addr); @@ -622,7 +622,7 @@ static void attach_report(file_list **fl) fwrite(report_text, 1, strlen(report_text), fp); fwrite(&zeroes, 1, 3, fp); fclose(fp); - snprintf(remname, 14, "%08lX.PKT", (unsigned long)sequencer()); + snprintf(remname, 14, "%08X.PKT", (unsigned int)sequencer()); add_list(fl, tmpfn, remname, KFS, 0L, NULL, 0); fmsg.from->name = svname; } else { diff --git a/mbcico/tcpproto.c b/mbcico/tcpproto.c index 98f8cb0a..4f4866c9 100644 --- a/mbcico/tcpproto.c +++ b/mbcico/tcpproto.c @@ -58,7 +58,7 @@ static FILE *in; static char txbuf[TCP_BLKSIZE]; static char rxbuf[TCP_BLKSIZE]; static int rx_type; -static long sbytes; +static int sbytes; struct timeval starttime, endtime; struct timezone tz; static off_t rxbytes; @@ -72,8 +72,8 @@ static int tcp_sblk(char *,int,int); static int tcp_rblk(char *,int *); static int getsync(void); -extern unsigned long sentbytes; -extern unsigned long rcvdbytes; +extern unsigned int sentbytes; +extern unsigned int rcvdbytes; extern char *ttystat[]; @@ -124,7 +124,7 @@ int tcpsndfiles(file_list *lst) int tcprcvfiles(void) { int rc, bufl; - long filesize, filetime; + int filesize, filetime; char *filename = NULL, *p; Syslog('+', "TCP: start receive files"); @@ -183,7 +183,7 @@ static int sendtfile(char *ln, char *rn) struct stat st; struct flock fl; int bufl, sverr; - long offset; + int offset; fl.l_type = F_RDLCK; fl.l_whence = 0; @@ -215,14 +215,14 @@ static int sendtfile(char *ln, char *rn) if (st.st_size > 0) { Syslog('+', "TCP: send \"%s\" as \"%s\"", MBSE_SS(ln), MBSE_SS(rn)); - Syslog('+', "TCP: size %lu bytes, dated %s", (unsigned long)st.st_size, date(st.st_mtime)); + Syslog('+', "TCP: size %lu bytes, dated %s", (unsigned int)st.st_size, date(st.st_mtime)); gettimeofday(&starttime, &tz); } else { Syslog('+', "TCP: file \"%s\" has 0 size, skiped",ln); return 0; } - snprintf(txbuf,TCP_BLKSIZE, "S %s %lu %lu",rn,(unsigned long)st.st_size,(unsigned long)st.st_mtime+(st.st_mtime%2)); + snprintf(txbuf,TCP_BLKSIZE, "S %s %u %u",rn,(unsigned int)st.st_size,(unsigned int)st.st_mtime+(unsigned int)(st.st_mtime%2)); bufl = strlen(txbuf); rc = tcp_sblk(txbuf, bufl, TCP_CMD); rc = tcp_rblk(rxbuf, &bufl); @@ -261,7 +261,7 @@ static int sendtfile(char *ln, char *rn) gettimeofday(&endtime, &tz); Syslog('a', "st_size %d, offset %d",st.st_size,offset); Syslog('+', "TCP: OK %s", transfertime(starttime, endtime, st.st_size-offset, TRUE)); - sentbytes += (unsigned long)st.st_size - offset; + sentbytes += (unsigned int)st.st_size - offset; return 0; } else if(strncmp(rxbuf,"FERROR",6) == 0){ WriteError("TCP: remote file error",ln); @@ -274,7 +274,7 @@ static int sendtfile(char *ln, char *rn) static int resync(off_t off) { - snprintf(txbuf, TCP_BLKSIZE, "ROK %ld",(long)off); + snprintf(txbuf, TCP_BLKSIZE, "ROK %d",(int)off); return 0; } diff --git a/mbcico/xmrecv.c b/mbcico/xmrecv.c index 8a0f57d3..9538854c 100644 --- a/mbcico/xmrecv.c +++ b/mbcico/xmrecv.c @@ -4,7 +4,7 @@ * Purpose ...............: Fidonet mailer * ***************************************************************************** - * Copyright (C) 1997-2004 + * Copyright (C) 1997-2005 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -57,9 +57,9 @@ static int last; struct timeval starttime, endtime; struct timezone tz; static off_t startofs; -static long recv_blk; +static int recv_blk; -extern unsigned long rcvdbytes; +extern unsigned int rcvdbytes; @@ -94,7 +94,7 @@ int closeit(int success) Syslog('+', "Xmodem: OK %s", transfertime(starttime, endtime, endofs-startofs, FALSE)); else Syslog('+', "Xmodem: dropped after %ld bytes", endofs-startofs); - rcvdbytes += (unsigned long)(endofs-startofs); + rcvdbytes += (unsigned int)(endofs-startofs); fp = NULL; return closefile(); } @@ -136,9 +136,9 @@ SM_EDECL } xmblk; unsigned short localcrc,remotecrc; unsigned char localcs,remotecs; - long ackd_blk=-1L; - long next_blk=1L; - long last_blk=0L; + int ackd_blk=-1L; + int next_blk=1L; + int last_blk=0L; off_t resofs; char tmpfname[16]; off_t wsize; @@ -550,12 +550,12 @@ int resync(off_t resofs) int count=0; int gotack,gotnak; int c; - long sblk; + int sblk; - Syslog('x', "trying to resync at offset %ld",resofs); + Syslog('x', "trying to resync at offset %d", (int)resofs); sblk=resofs/XMBLKSIZ+1; - snprintf(resynbuf,16,"%ld",sblk); + snprintf(resynbuf,16,"%d",sblk); lcrc=crc16xmodem(resynbuf,strlen(resynbuf)); gotack=0; gotnak=0; diff --git a/mbcico/xmsend.c b/mbcico/xmsend.c index 8021c408..284f1d61 100644 --- a/mbcico/xmsend.c +++ b/mbcico/xmsend.c @@ -48,7 +48,7 @@ static char *ln,*rn; static int flg; static int xm_send(void); -extern unsigned long sentbytes; +extern unsigned int sentbytes; int xmsend(char *local, char *Remote, int fl) @@ -109,11 +109,11 @@ SM_EDECL int count=0; int cancount=0; int window; - long last_blk; - long send_blk; - long next_blk; - long ackd_blk; - long tmp; + int last_blk; + int send_blk; + int next_blk; + int ackd_blk; + int tmp; char resynbuf[16]; fl.l_type=F_RDLCK; diff --git a/mbcico/zmmisc.c b/mbcico/zmmisc.c index 9f50506e..2b31b24b 100644 --- a/mbcico/zmmisc.c +++ b/mbcico/zmmisc.c @@ -83,8 +83,8 @@ int Rxhlen; /* Length of header received */ int Rxcount; /* Count of data bytes received */ char Rxhdr[ZMAXHLEN]; /* Received header */ char Txhdr[ZMAXHLEN]; /* Transmitted header */ -long Rxpos; /* Received file position */ -long Txpos; /* Transmitted file position */ +int Rxpos; /* Received file position */ +int Txpos; /* Transmitted file position */ int Txfcs32; /* TRUE means send binary frames with 32 bit FCS */ int Crc32t; /* Controls 32 bit CRC being sent */ /* 1 == CRC32, 2 == CRC32 + RLE */ @@ -230,7 +230,7 @@ void zsbhdr(int len, int type, register char *shdr) void zsbh32(int len, register char *shdr, int type, int flavour) { register int n; - register unsigned long crc; + register unsigned int crc; BUFFER_BYTE(flavour); if (Usevhdrs) @@ -338,7 +338,7 @@ void zsdata(register char *buf, int length, int frameend) void zsda32(register char *buf, int length, int frameend) { register int c; - register unsigned long crc; + register unsigned int crc; crc = 0xFFFFFFFFL; for (;--length >= 0; ++buf) { @@ -429,7 +429,7 @@ crcfoo: int zrdat32(register char *buf, int length) { register int c; - register unsigned long crc; + register unsigned int crc; register char *end; register int d; @@ -704,7 +704,7 @@ int zrbhdr(register char *shdr) int zrbhd32(register char *shdr) { register int c, n; - register unsigned long crc; + register unsigned int crc; if ((c = zdlread()) & ~0377) return c; @@ -967,7 +967,7 @@ int noxrd7(void) /* * Store long integer pos in Txhdr */ -void stohdr(long pos) +void stohdr(int pos) { Txhdr[ZP0] = pos; Txhdr[ZP1] = pos>>8; @@ -980,9 +980,9 @@ void stohdr(long pos) /* * Recover a long integer from a header */ -long rclhdr(register char *shdr) +int rclhdr(register char *shdr) { - register long l; + register int l; l = (shdr[ZP3] & 0377); l = (l << 8) | (shdr[ZP2] & 0377); diff --git a/mbcico/zmodem.h b/mbcico/zmodem.h index 4af097bc..d226abff 100644 --- a/mbcico/zmodem.h +++ b/mbcico/zmodem.h @@ -1,6 +1,8 @@ #ifndef ZMODEM_H #define ZMODEM_H +/* $Id$ */ + #ifndef TRUE #define TRUE 1 #endif @@ -141,14 +143,14 @@ /* Parameters for ZCOMMAND frame ZF0 (otherwise 0) */ #define ZCACK1 1 /* Acknowledge, then do command */ -long rclhdr(register char *); +int rclhdr(register char *); /* Globals used by ZMODEM functions */ extern int Rxframeind; /* ZBIN ZBIN32, or ZHEX type of frame */ extern int Rxtype; /* Type of header received */ extern int Rxcount; /* Count of data bytes received */ -extern int long Rxpos; /* Received file position */ -extern int long Txpos; /* Transmitted file position */ +extern int Rxpos; /* Received file position */ +extern int Txpos; /* Transmitted file position */ extern int Txfcs32; /* TURE means send binary frames with 32 bit FCS */ extern int Crc32t; /* Display flag indicating 32 bit CRC being sent */ extern int Crc32r; /* Display flag indicating 32 bit CRC being received */ @@ -170,7 +172,7 @@ extern int Effbaud; extern int Zmodem; extern int Zctlesc; extern int Filesleft; -extern long Totalleft; +extern int Totalleft; extern char *frametypes[]; #define FTOFFSET 16 @@ -180,7 +182,7 @@ extern void zshhdr(int,int,char*); extern int zgethdr(char*); extern void zsdata(char*,int,int); extern int zrdata(char*,int); -extern void stohdr(long); +extern void stohdr(int); extern void zsendline(int); extern void zsdar32(char*,int,int); @@ -188,7 +190,7 @@ extern int zrdatr32(char*,int); extern int zdlread(void); extern unsigned short crc16xmodemtab[]; -extern unsigned long crc32tab[]; +extern unsigned int crc32tab[]; #define updcrc16(cp,crc) (crc16xmodemtab[(((int)crc >> 8) & 0xff)] ^ (crc << 8) ^ cp) #define updcrc32(cp,crc) (crc32tab[((int)crc ^ cp) & 0xff] ^ ((crc >> 8) & 0x00ffffff)) diff --git a/mbcico/zmrecv.c b/mbcico/zmrecv.c index 5ff8d23d..8bfb2a1b 100644 --- a/mbcico/zmrecv.c +++ b/mbcico/zmrecv.c @@ -4,7 +4,7 @@ * Purpose ...............: Fidonet mailer * ***************************************************************************** - * Copyright (C) 1997-2003 + * Copyright (C) 1997-2005 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -48,13 +48,13 @@ static int Usevhdrs; static off_t rxbytes; static int Eofseen; /* indicates cpm eof (^Z) has been received */ static int errors; -static long sbytes; +static int sbytes; struct timeval starttime, endtime; struct timezone tz; #define DEFBYTL 2000000000L /* default rx file size */ -static long Bytesleft; /* number of bytes of incoming file left */ -static long Modtime; /* Unix style mod time for incoming file */ +static int Bytesleft; /* number of bytes of incoming file left */ +static int Modtime; /* Unix style mod time for incoming file */ static int Filemode; /* Unix style mode for incoming file */ static int Thisbinary; /* current file is to be received in bin mode */ @@ -77,13 +77,13 @@ int closeit(int); static int putsec(char*,int); static int procheader(char*); static int ackbibi(void); -static long getfree(void); +static int getfree(void); void get_frame_buffer(void); void free_frame_buffer(void); -extern unsigned long rcvdbytes; +extern unsigned int rcvdbytes; @@ -503,9 +503,9 @@ int procheader(char *Name) Modtime = 0L; p = Name + 1 + strlen(Name); - sscanf(p, "%ld%lo%o%o%d%d%d%d", &Bytesleft, &Modtime, &Filemode, &dummy, &dummy, &dummy, &dummy, &dummy); + sscanf(p, "%d%o%o%o%d%d%d%d", &Bytesleft, &Modtime, &Filemode, &dummy, &dummy, &dummy, &dummy, &dummy); strcpy(ctt,date(Modtime)); - Syslog('+', "Zmodem: \"%s\" %ld bytes, %s mode %o", Name, Bytesleft, ctt, Filemode); + Syslog('+', "Zmodem: \"%s\" %d bytes, %s mode %o", Name, Bytesleft, ctt, Filemode); fout = openfile(Name,Modtime,Bytesleft,&rxbytes,resync); gettimeofday(&starttime, &tz); @@ -556,7 +556,7 @@ int putsec(char *buf, int n) -long getfree(void) +int getfree(void) { struct statfs sfs; diff --git a/mbcico/zmrle.c b/mbcico/zmrle.c index 64894aa6..41015fdc 100644 --- a/mbcico/zmrle.c +++ b/mbcico/zmrle.c @@ -52,7 +52,7 @@ void zsdar32(char *buf, int length, int frameend) { register int c, l, n; - register unsigned long crc; + register unsigned int crc; crc = 0xFFFFFFFFL; l = *buf++ & 0377; if (length == 1) { @@ -112,7 +112,7 @@ void zsdar32(char *buf, int length, int frameend) int zrdatr32(register char *buf, int length) { register int c; - register unsigned long crc; + register unsigned int crc; register char *end; register int d; diff --git a/mbcico/zmsend.c b/mbcico/zmsend.c index 4abb7687..f94d0f48 100644 --- a/mbcico/zmsend.c +++ b/mbcico/zmsend.c @@ -64,7 +64,7 @@ static int blklen = 128; /* Length of transmitted records */ static int blkopt; /* Override value for zmodem blklen */ static int errors; static int Lastsync; -static long bytcnt; +static int bytcnt; static int Lrxpos=0; static int Lztrans=0; static int Lzmanag=0; @@ -72,11 +72,11 @@ static int Lskipnocor=0; static int Lzconv=0; static int Beenhereb4; static char Myattn[]={0}; -static long skipsize; +static int skipsize; struct timeval starttime, endtime; struct timezone tz; -extern unsigned long sentbytes; +extern unsigned int sentbytes; extern int Rxhlen; extern void get_frame_buffer(void); extern void free_frame_buffer(void); @@ -210,11 +210,11 @@ static int sendzfile(char *ln, char *rn) } Syslog('+', "Zmodem: send \"%s\" as \"%s\"", MBSE_SS(ln), MBSE_SS(rn)); - Syslog('+', "Zmodem: size %lu bytes, dated %s", (unsigned long)st.st_size, date(st.st_mtime)); + Syslog('+', "Zmodem: size %lu bytes, dated %s", (unsigned int)st.st_size, date(st.st_mtime)); gettimeofday(&starttime, &tz); - snprintf(txbuf,MAXBLOCK, "%s %lu %lo %o 0 0 0", rn, - (unsigned long)st.st_size, (long)st.st_mtime+((long)st.st_mtime%2), st.st_mode); + snprintf(txbuf,MAXBLOCK, "%s %u %o %o 0 0 0", rn, + (unsigned int)st.st_size, (int)st.st_mtime+((int)st.st_mtime%2), st.st_mode); bufl = strlen(txbuf); *(strchr(txbuf,' ')) = '\0'; /*hope no blanks in filename*/ @@ -225,8 +225,8 @@ static int sendzfile(char *ln, char *rn) return 0; } else if ((rc == OK) && (st.st_size - skipsize)) { gettimeofday(&endtime, &tz); - Syslog('+', "Zmodem: OK %s", transfertime(starttime, endtime, (unsigned long)st.st_size - skipsize, TRUE)); - sentbytes += (unsigned long)st.st_size - skipsize; + Syslog('+', "Zmodem: OK %s", transfertime(starttime, endtime, (unsigned int)st.st_size - skipsize, TRUE)); + sentbytes += (unsigned int)st.st_size - skipsize; return 0; } else return 2; @@ -358,8 +358,8 @@ int zfilbuf(void) int zsendfile(char *buf, int blen) { int c; - register unsigned long crc = -1; - long lastcrcrq = -1; + register unsigned int crc = -1; + int lastcrcrq = -1; Syslog('z', "zsendfile %s (%d)", buf, blen); for (errors=0; ++errors<11;) { diff --git a/mbfido/addpkt.c b/mbfido/addpkt.c index edf1f582..6c55e46b 100644 --- a/mbfido/addpkt.c +++ b/mbfido/addpkt.c @@ -65,7 +65,7 @@ int PrepARC(char *Queue, fidoaddr Dest) } pktfile = calloc(PATH_MAX, sizeof(char)); - snprintf(pktfile, PATH_MAX, "%s/%d.%d.%d.%d/%08lx.pkt", CFG.out_queue, Dest.zone, Dest.net, Dest.node, Dest.point, sequencer()); + snprintf(pktfile, PATH_MAX, "%s/%d.%d.%d.%d/%08x.pkt", CFG.out_queue, Dest.zone, Dest.net, Dest.node, Dest.point, sequencer()); Syslog('p', "Rename .pkt to %s", pktfile); if (rename(Queue, pktfile)) { diff --git a/mbfido/announce.c b/mbfido/announce.c index c35a5365..3ef95f84 100644 --- a/mbfido/announce.c +++ b/mbfido/announce.c @@ -44,7 +44,7 @@ extern int do_quiet; /* Suppress screen output */ struct _filerecord T_File; /* Internal announce record */ int TotalFiles; /* Total announced files */ -unsigned long TotalSize; /* Total size in KBytes. */ +unsigned int TotalSize; /* Total size in KBytes. */ int MsgCount; /* Message counter */ @@ -112,7 +112,7 @@ void Uploads() T_File.Size = fdb.Size; T_File.SizeKb = fdb.Size / 1024; T_File.Fdate = fdb.FileDate; - snprintf(T_File.Crc, 9, "%08lx", fdb.Crc32); + snprintf(T_File.Crc, 9, "%08x", fdb.Crc32); snprintf(T_File.Desc, 256, "%s %s %s %s", fdb.Desc[0], fdb.Desc[1], fdb.Desc[2], fdb.Desc[3]); k = 0; for (j = 0; j < 25; j++) { @@ -159,8 +159,8 @@ void Uploads() -long StartMsg(void); -long StartMsg(void) +int StartMsg(void); +int StartMsg(void) { if (!Msg_Open(newfiles.Area)) return -1; @@ -196,8 +196,8 @@ long StartMsg(void) -void FinishMsg(int, long); -void FinishMsg(int Final, long filepos) +void FinishMsg(int, int); +void FinishMsg(int Final, int filepos) { char *temp; FILE *fp, *fi; @@ -226,7 +226,7 @@ void FinishMsg(int Final, long filepos) snprintf(temp, PATH_MAX, "%s/tmp/echomail.jam", getenv("MBSE_ROOT")); if ((fp = fopen(temp, "a")) != NULL) { - fprintf(fp, "%s %lu\n", newfiles.Area, Msg.Id); + fprintf(fp, "%s %u\n", newfiles.Area, Msg.Id); fclose(fp); } Msg_Close(); @@ -239,14 +239,14 @@ void FinishMsg(int Final, long filepos) /* * Report one group block of new files. */ -long Report(gr_list *, long); -long Report(gr_list *ta, long filepos) +int Report(gr_list *, int); +int Report(gr_list *ta, int filepos) { FILE *fp, *fi; char *temp, *line; int i, Total = 0; - unsigned long Size = 0; - long filepos1 = 0, filepos2, filepos3 = 0, finalpos = 0; + unsigned int Size = 0; + int filepos1 = 0, filepos2, filepos3 = 0, finalpos = 0; time_t ftime; temp = calloc(PATH_MAX, sizeof(char)); @@ -370,7 +370,7 @@ int Announce() char *temp; FILE *fp; int Count = 0, rc = FALSE; - long filepos, filepos1, filepos2; + int filepos, filepos1, filepos2; char group[13]; int i, groups, any; diff --git a/mbfido/areamgr.c b/mbfido/areamgr.c index 69bad1ba..59bf0940 100644 --- a/mbfido/areamgr.c +++ b/mbfido/areamgr.c @@ -63,7 +63,7 @@ int a_query = FALSE; /* Send AreaMgr query */ int a_stat = FALSE; /* Send AreaMgr status */ int a_unlnk = FALSE; /* Send AreaMgr unlinked */ int a_flow = FALSE; /* Send AreaMgr flow */ -unsigned long a_msgs = 0; /* Messages to rescan */ +unsigned int a_msgs = 0; /* Messages to rescan */ @@ -120,7 +120,7 @@ void A_List(faddr *t, char *replyid, int Notify) char Stat[5]; faddr *f, *g, *Temp; sysconnect System; - long msgptr; + int msgptr; fpos_t fileptr,fileptr1,fileptr2; subject = calloc(255, sizeof(char)); @@ -312,8 +312,8 @@ void A_Flow(faddr *t, char *replyid, int Notify) time_t Now; struct tm *tt; int lmonth; - long rlw, rlm, rlt, plw, plm, plt; - long msgptr; + int rlw, rlm, rlt, plw, plm, plt; + int msgptr; fpos_t fileptr, fileptr1, fileptr2; Now = time(NULL); @@ -781,7 +781,7 @@ void A_All(faddr *t, int Connect, FILE *tmp, char *Grp) faddr *f, *Temp; int i, Link, First = TRUE, Cons; sysconnect Sys; - long Pos; + int Pos; if (Grp == NULL) { if (Connect) diff --git a/mbfido/atoul.c b/mbfido/atoul.c index 1ec0c9bc..434b8ff0 100644 --- a/mbfido/atoul.c +++ b/mbfido/atoul.c @@ -4,7 +4,7 @@ * Purpose ...............: MBSE BBS Mail Gate * ***************************************************************************** - * Copyright (C) 1997-2004 + * Copyright (C) 1997-2005 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -33,11 +33,11 @@ #include "atoul.h" -unsigned long atoul(char *str) +unsigned int atoul(char *str) { - unsigned long x; + unsigned int x; - if (sscanf(str,"%lu",&x) == 1) + if (sscanf(str,"%u",&x) == 1) return x; else return 0xffffffff; diff --git a/mbfido/atoul.h b/mbfido/atoul.h index 87bd34c7..f4d14231 100644 --- a/mbfido/atoul.h +++ b/mbfido/atoul.h @@ -1,8 +1,9 @@ #ifndef _ATOUL_H #define _ATOUL_H +/* $Id$ */ -unsigned long atoul(char*); +unsigned int atoul(char*); #endif diff --git a/mbfido/bounce.c b/mbfido/bounce.c index b444bdb1..3b88c2d3 100644 --- a/mbfido/bounce.c +++ b/mbfido/bounce.c @@ -90,7 +90,7 @@ int Bounce(faddr *f, faddr *t, FILE *fp, char *reason) /* * Add MSGID, REPLY and PID */ - fprintf(np, "\001MSGID: %s %08lx\r", ascfnode(from, 0x1f), sequencer()); + fprintf(np, "\001MSGID: %s %08x\r", ascfnode(from, 0x1f), sequencer()); while ((fgets(Buf, MAX_LINE_LENGTH, fp)) != NULL) { Striplf(Buf); if (strncmp(Buf, "\001MSGID:", 7) == 0) { diff --git a/mbfido/bwrite.c b/mbfido/bwrite.c index 32e91f0c..d49900b9 100644 --- a/mbfido/bwrite.c +++ b/mbfido/bwrite.c @@ -4,7 +4,7 @@ * Purpose ...............: MBSE BBS Mail Gate * ***************************************************************************** - * Copyright (C) 1997-2004 + * Copyright (C) 1997-2005 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -51,9 +51,9 @@ int iwrite(int i, FILE *fp) /* - * write long (32bit) integer in "standart" byte order + * write 32bit integer in "standart" byte order */ -int lwrite(long i, FILE *fp) +int lwrite(int i, FILE *fp) { int c; diff --git a/mbfido/bwrite.h b/mbfido/bwrite.h index 0a3b729f..d764bd2f 100644 --- a/mbfido/bwrite.h +++ b/mbfido/bwrite.h @@ -1,11 +1,12 @@ #ifndef _BWRITE_H #define _BWRITE_H -int iwrite(int,FILE *); -int lwrite(long,FILE *); -int awrite(char *,FILE *); -int cwrite(char *,FILE *, int); -int kwrite(char *,FILE *, int); +/* $Id$ */ + +int iwrite(int, FILE *); +int lwrite(int, FILE *); +int awrite(char *, FILE *); +int cwrite(char *, FILE *, int); +int kwrite(char *, FILE *, int); #endif - diff --git a/mbfido/createf.c b/mbfido/createf.c index b63c420f..8b63557e 100644 --- a/mbfido/createf.c +++ b/mbfido/createf.c @@ -88,7 +88,7 @@ int CheckTicGroup(char *Area, int SendUplink, faddr *f) { char *temp, *buf, *tag = NULL, *desc = NULL, *p, *raid = NULL, *flow = NULL; FILE *ap, *mp, *fp; - long offset, AreaNr; + int offset, AreaNr; int i, rc = 0, Found = FALSE; sysconnect System; faddr *From, *To; diff --git a/mbfido/createm.c b/mbfido/createm.c index c881d765..dabfce02 100644 --- a/mbfido/createm.c +++ b/mbfido/createm.c @@ -91,7 +91,7 @@ int CheckEchoGroup(char *Area, int SendUplink, faddr *f) { char *temp, *buf, *tag, *desc, *p; FILE *ap, *mp; - long offset; + int offset; int i, rc = 0; sysconnect System; faddr *From, *To; diff --git a/mbfido/dirsession.c b/mbfido/dirsession.c index 812946b5..24576769 100644 --- a/mbfido/dirsession.c +++ b/mbfido/dirsession.c @@ -142,7 +142,7 @@ int dirinbound(void) { FILE *fp; char *temp, *from, *too; - long fileptr; + int fileptr; struct dirent *de; DIR *dp; int Something = FALSE; diff --git a/mbfido/fflist.c b/mbfido/fflist.c index 4d670feb..fc611885 100644 --- a/mbfido/fflist.c +++ b/mbfido/fflist.c @@ -118,7 +118,7 @@ void tidy_rflist(rf_list ** fdp) /* * Add a reply file to the array */ -void fill_rflist(rf_list **fdp, char *fname, unsigned long larea) +void fill_rflist(rf_list **fdp, char *fname, unsigned int larea) { rf_list *tmp, *ta; diff --git a/mbfido/fflist.h b/mbfido/fflist.h index c7765894..91945434 100644 --- a/mbfido/fflist.h +++ b/mbfido/fflist.h @@ -1,6 +1,7 @@ #ifndef _FFLIST_H_ #define _FFLIST_H +/* $Id$ */ typedef struct _ff_list { /* Filefind array */ struct _ff_list *next; @@ -11,7 +12,7 @@ typedef struct _ff_list { /* Filefind array */ unsigned short node; /* Original node */ unsigned short point; /* Original point */ char msgid[81]; /* Original msgid */ - unsigned long msgnr; /* Original message number */ + unsigned int msgnr; /* Original message number */ unsigned done : 1; /* True if processed with success */ } ff_list; @@ -20,15 +21,14 @@ typedef struct _ff_list { /* Filefind array */ typedef struct _rf_list { /* Reply filenames array */ struct _rf_list *next; char filename[15]; /* Filename found */ - unsigned long area; /* BBS file area number */ + unsigned int area; /* BBS file area number */ } rf_list; void tidy_fflist(ff_list **); void fill_fflist(ff_list **); void tidy_rflist(rf_list **); -void fill_rflist(rf_list **, char *, unsigned long); +void fill_rflist(rf_list **, char *, unsigned int); #endif - diff --git a/mbfido/filefind.c b/mbfido/filefind.c index 3531085d..24ed87a5 100644 --- a/mbfido/filefind.c +++ b/mbfido/filefind.c @@ -91,7 +91,7 @@ void Clean(int count) void ScanArea(ff_list **); void ScanArea(ff_list **ffl) { - unsigned long Number, Highest; + unsigned int Number, Highest; if (!do_quiet) { mbse_colour(CYAN, BLACK); @@ -108,7 +108,7 @@ void ScanArea(ff_list **ffl) do { if (!do_quiet) { - printf("%6lu / %6lu", Number, Highest); + printf("%6u / %6u", Number, Highest); Back(15); } @@ -117,7 +117,7 @@ void ScanArea(ff_list **ffl) if (Msg_ReadHeader(Number) == TRUE) { if (((!strcasecmp(Msg.To, "allfix")) || (!strcasecmp(Msg.To, "filefind"))) && (!Msg.Received)) { - Syslog('m', "Msg: %s (%lu) [%s]", Msg.From, Number, Msg.Subject); + Syslog('m', "Msg: %s (%u) [%s]", Msg.From, Number, Msg.Subject); Msg.Received = TRUE; Msg.Read = time(NULL); if (Msg_Lock(30L)) { @@ -145,11 +145,11 @@ void ScanArea(ff_list **ffl) -long StartReply(ff_list *); -long StartReply(ff_list *ffl) +int StartReply(ff_list *); +int StartReply(ff_list *ffl) { char *temp; - unsigned long crc = -1; + unsigned int crc = -1; if (strlen(scanmgr.ReplBoard)) { if (!Msg_Open(scanmgr.ReplBoard)) @@ -199,8 +199,8 @@ long StartReply(ff_list *ffl) -void FinishReply(int, int, long); -void FinishReply(int Reported, int Total, long filepos) +void FinishReply(int, int, int); +void FinishReply(int Reported, int Total, int filepos) { char *temp; FILE *fp, *fi; @@ -226,9 +226,9 @@ void FinishReply(int Reported, int Total, long filepos) snprintf(temp, PATH_MAX, "%s/tmp/%smail.jam", getenv("MBSE_ROOT"), scanmgr.NetReply?"net":"echo"); if ((fp = fopen(temp, "a")) != NULL) { if (strlen(scanmgr.ReplBoard)) - fprintf(fp, "%s %lu\n", scanmgr.ReplBoard, Msg.Id); + fprintf(fp, "%s %u\n", scanmgr.ReplBoard, Msg.Id); else - fprintf(fp, "%s %lu\n", scanmgr.ScanBoard, Msg.Id); + fprintf(fp, "%s %u\n", scanmgr.ScanBoard, Msg.Id); fclose(fp); } @@ -246,11 +246,11 @@ void ScanFiles(ff_list *tmp) { char *temp, *kwd, *BigDesc, *line; FILE *pAreas, *fi; - unsigned long areanr = 0, found = 0, SubSize = 0; + unsigned int areanr = 0, found = 0, SubSize = 0; int i, j, k, keywrd, Found; rf_list *rfl = NULL, *rft; int Rep = 0, Sub = 0, Stop = FALSE; - long filepos, filepos1 = 0, filepos2 = 0, filepos3 = 0, filepos4 = 0; + int filepos, filepos1 = 0, filepos2 = 0, filepos3 = 0, filepos4 = 0; struct _fdbarea *fdb_area = NULL; /* @@ -288,7 +288,7 @@ void ScanFiles(ff_list *tmp) msleep(1); if (!do_quiet) { - printf("%6lu / %6lu", areanr, found); + printf("%6u / %6u", areanr, found); Back(15); } if (area.Available && area.FileFind) { diff --git a/mbfido/filemgr.c b/mbfido/filemgr.c index 3eb8f8fe..453ffcca 100644 --- a/mbfido/filemgr.c +++ b/mbfido/filemgr.c @@ -109,7 +109,7 @@ void F_List(faddr *t, char *replyid, int Notify) char Stat[4]; faddr *f, *g, *Temp; sysconnect System; - long msgptr; + int msgptr; fpos_t fileptr,fileptr1,fileptr2; subject = calloc(255, sizeof(char)); @@ -589,7 +589,7 @@ void F_All(faddr *t, int Connect, FILE *tmp, char *Grp) faddr *f, *Temp; int i, Link, First = TRUE, Cons; sysconnect Sys; - long Pos; + int Pos; if (Grp == NULL) { if (Connect) diff --git a/mbfido/forward.c b/mbfido/forward.c index fee1c775..925d5768 100644 --- a/mbfido/forward.c +++ b/mbfido/forward.c @@ -101,7 +101,7 @@ void ForwardFile(fidoaddr Node, fa_list *sbl) ticfile = calloc(PATH_MAX, sizeof(char)); ticname = calloc(15, sizeof(char)); if (nodes.Tic) { - snprintf(ticname, 15, "%08lx.tic", sequencer()); + snprintf(ticname, 15, "%08x.tic", sequencer()); subject = xstrcat(subject, (char *)" "); subject = xstrcat(subject, ticname); snprintf(ticfile, PATH_MAX, "%s/%s", CFG.ticout, ticname); @@ -175,7 +175,7 @@ void ForwardFile(fidoaddr Node, fa_list *sbl) if (strlen(TIC.NewFullName)) fprintf(fp, "Fullname %s\r\n", TIC.NewFullName); } - fprintf(fp, "Size %ld\r\n", (long)(TIC.FileSize)); + fprintf(fp, "Size %d\r\n", (int)(TIC.FileSize)); fprintf(fp, "Desc %s\r\n", TIC.TicIn.Desc); fprintf(fp, "Crc %s\r\n", TIC.TicIn.Crc); if (nodes.TIC_To) { @@ -199,7 +199,7 @@ void ForwardFile(fidoaddr Node, fa_list *sbl) subject = ctime(&now); Striplf(subject); ba = bestaka_s(dest); - fprintf(fp, "Path %s %lu %s %s\r\n", ascfnode(ba, 0x1f), (long)mktime(localtime(&now)), subject, tzname[0]); + fprintf(fp, "Path %s %u %s %s\r\n", ascfnode(ba, 0x1f), (int)mktime(localtime(&now)), subject, tzname[0]); tidy_faddr(ba); if (nodes.TIC_AdvSB) { diff --git a/mbfido/ftn2rfc.c b/mbfido/ftn2rfc.c index 09287057..2ac7c181 100644 --- a/mbfido/ftn2rfc.c +++ b/mbfido/ftn2rfc.c @@ -102,7 +102,7 @@ char *rfcmsgid(char *, faddr *); char *rfcmsgid(char *msgid, faddr *bestaka) { char *p, *q, *r; - unsigned long id = 0L; + unsigned int id = 0L; faddr *ta = NULL; size_t bufsize; @@ -136,7 +136,7 @@ char *rfcmsgid(char *msgid, faddr *bestaka) * here we have a parseable address */ *p = '\0'; - sscanf(p+1, "%lx", &id); + sscanf(p+1, "%x", &id); ta = parsefnode(msgid); *p=' '; } @@ -149,7 +149,7 @@ char *rfcmsgid(char *msgid, faddr *bestaka) * isn't the case. By cheking also (ta->net) we avoid that */ if ((ta) && (ta->net)) { - snprintf(rbuf, bufsize, "<%lu@%s.ftn>", id, ascinode(ta,0x1f)); + snprintf(rbuf, bufsize, "<%u@%s.ftn>", id, ascinode(ta,0x1f)); } else { p = xstrcpy(msgid); if ((q = strchr(p,' '))) @@ -180,12 +180,12 @@ char *rfcmsgid(char *msgid, faddr *bestaka) *q = '%'; } } else { - snprintf(rbuf, bufsize, "<%lu@%s>", id, p); + snprintf(rbuf, bufsize, "<%u@%s>", id, p); } free(p); } } else { - snprintf(rbuf, bufsize, "<%lu@%s.ftn>", (unsigned long)sequencer(), ascinode(bestaka,0x1f)); + snprintf(rbuf, bufsize, "<%u@%s.ftn>", (unsigned int)sequencer(), ascinode(bestaka,0x1f)); } tidy_faddr(ta); if (r) @@ -270,7 +270,7 @@ void Send(int, char *); void Send(int newsmode, char *outstr) { char *p; - unsigned long crc; + unsigned int crc; charwrite(outstr, nfp); Syslog('m', "+ %s", printable(outstr, 0)); @@ -400,7 +400,7 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl if (!strcmp(l,"Via") && (via_off == 0L)) { via_off = ftell(fp); - Syslog('m', "^AVia \"%s\" at offset %ld", printable(buf, 0), (long)via_off); + Syslog('m', "^AVia \"%s\" at offset %d", printable(buf, 0), (int)via_off); } } else { /* @@ -428,7 +428,7 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl (*tmsg)->key = xstrcpy((char *)"Origin"); (*tmsg)->val = xstrcpy(buf+11); tmsg = &((*tmsg)->next); - Syslog('M', "origin \"%s\" at offset %ld", buf,(long)orig_off); + Syslog('M', "origin \"%s\" at offset %d", buf,(int)orig_off); p = buf+10; while (*p == ' ') p++; @@ -1492,7 +1492,7 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl } if (ftell(fp) > endmsg_off) { - Syslog('m', "line \"%s\" past message end %ld %ld", buf,(long)endmsg_off, ftell(fp)); + Syslog('m', "line \"%s\" past message end %d %d", buf,(int)endmsg_off, ftell(fp)); pass=0; } if (pass) { diff --git a/mbfido/hash.c b/mbfido/hash.c index eb389c94..6d2d2fb0 100644 --- a/mbfido/hash.c +++ b/mbfido/hash.c @@ -34,18 +34,18 @@ #include "lhash.h" -void hash_update_s(unsigned long *id, char *mod) +void hash_update_s(unsigned int *id, char *mod) { *id ^= lh_strhash(mod); } -void hash_update_n(unsigned long *id, unsigned long mod) +void hash_update_n(unsigned int *id, unsigned int mod) { char buf[32]; - snprintf(buf,32, "%030lu",mod); + snprintf(buf,32, "%030u",mod); *id ^= lh_strhash(buf); } diff --git a/mbfido/hash.h b/mbfido/hash.h index 511bcdd9..f9a7075c 100644 --- a/mbfido/hash.h +++ b/mbfido/hash.h @@ -1,8 +1,9 @@ #ifndef HASH_H #define HASH_H -void hash_update_s(unsigned long *, char *); -void hash_update_n(unsigned long *, unsigned long); +/* $Id$ */ +void hash_update_s(unsigned int *, char *); +void hash_update_n(unsigned int *, unsigned int); #endif diff --git a/mbfido/hatch.c b/mbfido/hatch.c index f70e7b1c..5546423e 100644 --- a/mbfido/hatch.c +++ b/mbfido/hatch.c @@ -176,7 +176,7 @@ int CheckHatch(char *temp) } } fprintf(Tf, "\r\n"); - fprintf(Tf, "Crc %08lx\r\n", file_crc(de->d_name, CFG.slow_util && do_quiet)); + fprintf(Tf, "Crc %08x\r\n", file_crc(de->d_name, CFG.slow_util && do_quiet)); fprintf(Tf, "Pw %s\r\n", CFG.hatchpasswd); fclose(Tf); Hatched++; diff --git a/mbfido/lhash.c b/mbfido/lhash.c index 9b4886f1..26406875 100644 --- a/mbfido/lhash.c +++ b/mbfido/lhash.c @@ -4,7 +4,7 @@ * Purpose ...............: MBSE BBS Mail Gate * ***************************************************************************** - * Copyright (C) 1997-2004 + * Copyright (C) 1997-2005 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -127,7 +127,7 @@ char *lh_version=(char *)"lhash part of SSLeay 0.6.4 30-Aug-1996"; #define P_CPP char *,char * static void expand(LHASH *lh); static void contract(LHASH *lh); -static LHASH_NODE **getrn(LHASH *lh, char *data, unsigned long *rhash); +static LHASH_NODE **getrn(LHASH *lh, char *data, unsigned int *rhash); #else @@ -139,7 +139,7 @@ static LHASH_NODE **getrn(); #endif -LHASH *lh_new(unsigned long (*h)(char *), int (*c)(char *, char *)) +LHASH *lh_new(unsigned int (*h)(char *), int (*c)(char *, char *)) { LHASH *ret; int i; @@ -151,7 +151,7 @@ LHASH *lh_new(unsigned long (*h)(char *), int (*c)(char *, char *)) for (i=0; ib[i]=NULL; ret->comp=((c == NULL)?(int (*)(char *, char *))strcmp:c); - ret->hash=((h == NULL)?(unsigned long (*)(char *))lh_strhash:h); + ret->hash=((h == NULL)?(unsigned int (*)(char *))lh_strhash:h); ret->num_nodes=MIN_NODES/2; ret->num_alloc_nodes=MIN_NODES; ret->p=0; @@ -206,7 +206,7 @@ void lh_free(LHASH *lh) char *lh_insert(LHASH *lh, char *data) { - unsigned long hash; + unsigned int hash; LHASH_NODE *nn,**rn; char *ret; @@ -240,7 +240,7 @@ char *lh_insert(LHASH *lh, char *data) char *lh_delete(LHASH *lh, char *data) { - unsigned long hash; + unsigned int hash; LHASH_NODE *nn,**rn; char *ret; @@ -272,7 +272,7 @@ char *lh_delete(LHASH *lh, char *data) char *lh_retrieve(LHASH *lh, char *data) { - unsigned long hash; + unsigned int hash; LHASH_NODE **rn; char *ret; @@ -327,7 +327,7 @@ static void expand(LHASH *lh) { LHASH_NODE **n,**n1,**n2,*np; unsigned int p,i,j; - unsigned long hash,nni; + unsigned int hash,nni; lh->num_nodes++; lh->num_expands++; @@ -415,10 +415,10 @@ static void contract(LHASH *lh) -static LHASH_NODE **getrn(LHASH *lh, char *data, unsigned long *rhash) +static LHASH_NODE **getrn(LHASH *lh, char *data, unsigned int *rhash) { LHASH_NODE **ret,*n1; - unsigned long hash,nn; + unsigned int hash,nn; int (*cf)(char *, char *); hash=(*(lh->hash))(data); @@ -469,11 +469,11 @@ char *str; * no collisions on /usr/dict/words and it distributes on %2^n quite * well, not as good as MD5, but still good. */ -unsigned long lh_strhash(char *c) +unsigned int lh_strhash(char *c) { - unsigned long ret=0; - long n; - unsigned long v; + unsigned int ret=0; + int n; + unsigned int v; int r; if ((c == NULL) || (*c == '\0')) diff --git a/mbfido/lhash.h b/mbfido/lhash.h index d7071c47..845c93ce 100644 --- a/mbfido/lhash.h +++ b/mbfido/lhash.h @@ -61,7 +61,7 @@ typedef struct lhash_node_st char *data; struct lhash_node_st *next; #ifndef NO_HASH_COMP - unsigned long hash; + unsigned int hash; #endif } LHASH_NODE; @@ -69,41 +69,41 @@ typedef struct lhash_st { LHASH_NODE **b; int (*comp)(char *, char *); - unsigned long (*hash)(char *); + unsigned int (*hash)(char *); unsigned int num_nodes; unsigned int num_alloc_nodes; unsigned int p; unsigned int pmax; - unsigned long up_load; /* load times 256 */ - unsigned long down_load; /* load times 256 */ - unsigned long num_items; + unsigned int up_load; /* load times 256 */ + unsigned int down_load; /* load times 256 */ + unsigned int num_items; - unsigned long num_expands; - unsigned long num_expand_reallocs; - unsigned long num_contracts; - unsigned long num_contract_reallocs; - unsigned long num_hash_calls; - unsigned long num_comp_calls; - unsigned long num_insert; - unsigned long num_replace; - unsigned long num_delete; - unsigned long num_no_delete; - unsigned long num_retreve; - unsigned long num_retreve_miss; - unsigned long num_hash_comps; + unsigned int num_expands; + unsigned int num_expand_reallocs; + unsigned int num_contracts; + unsigned int num_contract_reallocs; + unsigned int num_hash_calls; + unsigned int num_comp_calls; + unsigned int num_insert; + unsigned int num_replace; + unsigned int num_delete; + unsigned int num_no_delete; + unsigned int num_retreve; + unsigned int num_retreve_miss; + unsigned int num_hash_comps; } LHASH; #define LH_LOAD_MULT 256 #ifndef NOPROTO -LHASH *lh_new(unsigned long (*h)(char *), int (*c)(char *, char *)); +LHASH *lh_new(unsigned int (*h)(char *), int (*c)(char *, char *)); void lh_free(LHASH *lh); char *lh_insert(LHASH *lh, char *data); char *lh_delete(LHASH *lh, char *data); char *lh_retrieve(LHASH *lh, char *data); void lh_doall(LHASH *lh, void (*func)(char *, char *)); void lh_doall_arg(LHASH *lh, void (*func)(char *, char *),char *arg); -unsigned long lh_strhash(char *c); +unsigned int lh_strhash(char *c); #ifndef WIN16 void lh_stats(LHASH *lh, FILE *out); @@ -128,7 +128,7 @@ char *lh_delete(); char *lh_retrieve(); void lh_doall(); void lh_doall_arg(); -unsigned long lh_strhash(); +unsigned int lh_strhash(); #ifndef WIN16 void lh_stats(); diff --git a/mbfido/magic.c b/mbfido/magic.c index 7d2d48e3..b991fe2f 100644 --- a/mbfido/magic.c +++ b/mbfido/magic.c @@ -37,7 +37,7 @@ #include "magic.h" -long MagicNr; /* Current magic record number */ +int MagicNr; /* Current magic record number */ int Magics = 0; /* Processed magics */ diff --git a/mbfido/makestat.c b/mbfido/makestat.c index 4b7010c7..774176a9 100644 --- a/mbfido/makestat.c +++ b/mbfido/makestat.c @@ -4,7 +4,7 @@ * Purpose ...............: Make Web statistics * ***************************************************************************** - * Copyright (C) 1997-2004 + * Copyright (C) 1997-2005 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -113,7 +113,7 @@ void MakeStat(void) char *name, *p, *q; int i, Total, Lm, Area; struct _history hist; - long fileptr = 0; + int fileptr = 0; if (!strlen(CFG.www_root)) { Syslog('!', "Warning, WWW root not defined, skip statistical html creation"); diff --git a/mbfido/mbfcheck.c b/mbfido/mbfcheck.c index effbce64..6f703a40 100644 --- a/mbfido/mbfcheck.c +++ b/mbfido/mbfcheck.c @@ -45,7 +45,7 @@ int iErrors = 0; int iTotal = 0; int iAreasNew = 0; -void CheckArea(long); /* Check a single area */ +void CheckArea(int); /* Check a single area */ /* @@ -63,11 +63,11 @@ void CheckArea(long); /* Check a single area */ * Remarks: Maybe if the crc check fails, and the date and time are * ok, the file is damaged and must be made unavailable. */ -void Check(long AreaNr) +void Check(int AreaNr) { FILE *pAreas, *pFile; char *sAreas, *fAreas, *newdir, *temp, *mname; - long i, iAreas; + int i, iAreas; DIR *dp; struct dirent *de; int Found; @@ -120,7 +120,7 @@ void Check(long AreaNr) } else { if (strlen(area.Name) == 0) { - snprintf(fAreas, PATH_MAX, "%s/fdb/file%ld.data", getenv("MBSE_ROOT"), i); + snprintf(fAreas, PATH_MAX, "%s/fdb/file%d.data", getenv("MBSE_ROOT"), i); if (unlink(fAreas) == 0) { Syslog('+', "Removed obsolete %s", fAreas); } @@ -198,7 +198,7 @@ void Check(long AreaNr) -void CheckArea(long Area) +void CheckArea(int Area) { int j, Fix, inArea, rc; char *newdir, *temp, *mname, *tname; @@ -218,7 +218,7 @@ void CheckArea(long Area) IsDoing("Check area %ld", Area); if (!do_quiet) { - printf("\r%4ld => %-44s \b\b\b\b", Area, area.Name); + printf("\r%4d => %-44s \b\b\b\b", Area, area.Name); fflush(stdout); } diff --git a/mbfido/mbfcheck.h b/mbfido/mbfcheck.h index 5aa30b92..738fd5f0 100644 --- a/mbfido/mbfcheck.h +++ b/mbfido/mbfcheck.h @@ -1,8 +1,8 @@ -/* $Id$ */ - -#ifndef _MBFCHECK_H_ +#ifndef _MBFCHECK_H #define _MBFCHECK_H -void Check(long); /* Check file database */ +/* $Id$ */ + +void Check(int); /* Check file database */ #endif diff --git a/mbfido/mbfindex.c b/mbfido/mbfindex.c index c95bf836..4574f9da 100644 --- a/mbfido/mbfindex.c +++ b/mbfido/mbfindex.c @@ -40,7 +40,7 @@ extern int do_quiet; /* Suppress screen output */ int lastfile; /* Last file number */ -long gfilepos = 0; /* Global file position */ +int gfilepos = 0; /* Global file position */ int TotalHtml = 0; /* Total html files */ int AreasHtml = 0; /* Total html areas */ int aUpdate = 0; /* Updated areas */ @@ -321,7 +321,7 @@ void ReqIndex(void); void ReqIndex(void) { FILE *pAreas, *pIndex, *fp; - unsigned long i, iAreas, iAreasNew = 0, record; + unsigned int i, iAreas, iAreasNew = 0, record; int iTotal = 0, j, z, x = 0; int fbAreas = 0, fbFiles = 0, fbUpdate = 0; char *sAreas, *newdir = NULL, *sIndex, *temp; @@ -367,7 +367,7 @@ void ReqIndex(void) die(MBERR_DISK_FULL); if (!do_quiet) { - printf("\r%4ld => %-44s \b\b\b\b", i, area.Name); + printf("\r%4d => %-44s \b\b\b\b", i, area.Name); fflush(stdout); } @@ -386,7 +386,7 @@ void ReqIndex(void) if ((fdb_area = mbsedb_OpenFDB(i, 30)) == NULL) die(MBERR_GENERAL); - snprintf(temp, PATH_MAX, "%s/var/fdb/file%ld.data", getenv("MBSE_ROOT"), i); + snprintf(temp, PATH_MAX, "%s/var/fdb/file%d.data", getenv("MBSE_ROOT"), i); db_time = (int) file_time(temp); /* @@ -431,7 +431,7 @@ void ReqIndex(void) while (fread(&fdb, fdbhdr.recsize, 1, fdb_area->fp) == 1) { if (!fdb.Deleted) { fbFiles++; - fprintf(fp, "%-12s [%ld] %s\r\n", fdb.Name, fdb.TimesDL, fdb.Desc[0]); + fprintf(fp, "%-12s [%d] %s\r\n", fdb.Name, fdb.TimesDL, fdb.Desc[0]); for (j = 1; j < 25; j++) if (strlen(fdb.Desc[j])) fprintf(fp, " +%s\r\n", fdb.Desc[j]); @@ -481,7 +481,7 @@ void ReqIndex(void) for (z = 0; z <= 25; z++) { if (strlen(fdb.Desc[z])) { if (z == 0) - fprintf(fp, "%-12s %7luK %s ", fdb.Name, (long)(fdb.Size / 1024), + fprintf(fp, "%-12s %7uK %s ", fdb.Name, (int)(fdb.Size / 1024), StrDateDMY(fdb.UploadDate)); else fprintf(fp, " "); @@ -528,13 +528,13 @@ void HtmlIndex(char *); void HtmlIndex(char *Lang) { FILE *pAreas, *fa, *fb = NULL, *fm, *fi = NULL; - unsigned long i, iAreas, KSize = 0L, aSize = 0; + unsigned int i, iAreas, KSize = 0L, aSize = 0; int AreaNr = 0, j, k, x = 0, isthumb; int aTotal = 0, inArea = 0, filenr; char *sAreas, *fn, *temp; char linebuf[1024], outbuf[1024], desc[6400], namebuf[1024]; time_t last = 0L, later, db_time, obj_time; - long fileptr = 0, fileptr1 = 0; + int fileptr = 0, fileptr1 = 0; struct _fdbarea *fdb_area = NULL; sAreas = calloc(PATH_MAX, sizeof(char)); @@ -616,13 +616,13 @@ void HtmlIndex(char *Lang) die(MBERR_DISK_FULL); if (!do_quiet) { - printf("\r%4ld => %-44s \b\b\b\b", i, area.Name); + printf("\r%4d => %-44s \b\b\b\b", i, area.Name); fflush(stdout); } if ((fdb_area = mbsedb_OpenFDB(i, 30)) == NULL) die(MBERR_GENERAL); - snprintf(temp, PATH_MAX, "%s/var/fdb/file%ld.data", getenv("MBSE_ROOT"), i); + snprintf(temp, PATH_MAX, "%s/var/fdb/file%d.data", getenv("MBSE_ROOT"), i); db_time = (int) file_time(temp); snprintf(temp, PATH_MAX, "%s/index.html", area.Path); obj_time = (int) file_time(temp); @@ -708,7 +708,7 @@ void HtmlIndex(char *Lang) MacroVars("fghi", "dsss", 0, outbuf, fdb.LName, ""); } - snprintf(outbuf, 1024, "%lu Kb.", (long)(fdb.Size / 1024)); + snprintf(outbuf, 1024, "%u Kb.", (int)(fdb.Size / 1024)); MacroVars("jkl", "ssd", StrDateDMY(fdb.FileDate), outbuf, fdb.TimesDL); memset(&desc, 0, sizeof(desc)); k = 0; @@ -781,9 +781,9 @@ void HtmlIndex(char *Lang) html_massage(linebuf, namebuf, 1024); snprintf(linebuf, 1024, "%s/%s%s/index.html", CFG.www_url, CFG.www_link2ftp, area.Path+strlen(CFG.ftp_base)); if (aSize > 1048576) - snprintf(outbuf, 1024, "%ld Mb.", aSize / 1048576); + snprintf(outbuf, 1024, "%d Mb.", aSize / 1048576); else - snprintf(outbuf, 1024, "%ld Kb.", aSize / 1024); + snprintf(outbuf, 1024, "%d Kb.", aSize / 1024); MacroVars("efghi", "dssds", AreaNr, linebuf, namebuf, aTotal, outbuf); if (last == 0L) MacroVars("j", "s", " "); @@ -797,7 +797,7 @@ void HtmlIndex(char *Lang) } if (fm) { - snprintf(linebuf, 1024, "%ld Mb.", KSize / 1024); + snprintf(linebuf, 1024, "%d Mb.", KSize / 1024); MacroVars("cd", "ds", TotalHtml, linebuf); MacroRead(fi, fm); fclose(fi); diff --git a/mbfido/mbflist.c b/mbfido/mbflist.c index 11fec611..3587d366 100644 --- a/mbfido/mbflist.c +++ b/mbfido/mbflist.c @@ -44,7 +44,7 @@ void ListFileAreas(int Area) { FILE *pAreas, *pTic; int i, iAreas, fcount, tcount = 0, iTotal = 0, columns = 80; - long fsize, tsize = 0; + int fsize, tsize = 0; char *sAreas, *fAreas, *sTic, flags[6], *ticarea; struct _fdbarea *fdb_area = NULL; @@ -130,8 +130,8 @@ void ListFileAreas(int Area) flags[2] = 'A'; fdb.LName[columns - 60] = '\0'; - printf("%-12s %5ld %s %4ld %s %-20s %s\n", fdb.Name, (long)(fdb.Size / 1024), StrDateDMY(fdb.FileDate), - (long)(fdb.TimesDL), flags, fdb.TicArea, fdb.LName); + printf("%-12s %5d %s %4d %s %-20s %s\n", fdb.Name, (int)(fdb.Size / 1024), StrDateDMY(fdb.FileDate), + (int)(fdb.TimesDL), flags, fdb.TicArea, fdb.LName); fcount++; fsize = fsize + fdb.Size; } @@ -142,7 +142,7 @@ void ListFileAreas(int Area) for (i = 60; i < columns; i++) printf("-"); printf("\n"); - printf("%d file%s, %ld Kbytes\n", fcount, (fcount == 1) ? "":"s", fsize); + printf("%d file%s, %d Kbytes\n", fcount, (fcount == 1) ? "":"s", fsize); mbsedb_CloseFDB(fdb_area); } else { @@ -183,7 +183,7 @@ void ListFileAreas(int Area) tcount += fcount; tsize += fsize; - printf("%5d %5d %5ld %-12s %s\n", i, fcount, fsize, area.BbsGroup, area.Name); + printf("%5d %5d %5d %-12s %s\n", i, fcount, fsize, area.BbsGroup, area.Name); iTotal++; mbsedb_CloseFDB(fdb_area); } @@ -191,7 +191,7 @@ void ListFileAreas(int Area) mbse_colour(CYAN, BLACK); printf("----- ----- ----- ---------------------------------------------------------\n"); - printf("%5d %5d %5ld \n", iTotal, tcount, tsize); + printf("%5d %5d %5d \n", iTotal, tcount, tsize); fclose(pAreas); free(ticarea); free(sAreas); diff --git a/mbfido/mbfrearc.c b/mbfido/mbfrearc.c index 17d3b257..2079d535 100644 --- a/mbfido/mbfrearc.c +++ b/mbfido/mbfrearc.c @@ -51,6 +51,7 @@ void ReArc(int Area, char *File) int i, rc = -1, count = 0, errors = 0; struct utimbuf ut; struct _fdbarea *fdb_area = NULL; + time_t tt; IsDoing("ReArc file(s)"); mbse_colour(LIGHTRED, BLACK); @@ -158,8 +159,9 @@ void ReArc(int Area, char *File) Syslog('f', "%s %s", fdb.Name, fdb.LName); fdb.Size = file_size(temp); fdb.Crc32 = file_crc(temp, FALSE); - ut.actime = mktime(localtime(&fdb.FileDate)); - ut.modtime = mktime(localtime(&fdb.FileDate)); + tt = fdb.FileDate; + ut.actime = mktime(localtime(&tt)); + ut.modtime = mktime(localtime(&tt)); utime(temp, &ut); /* diff --git a/mbfido/mbftoberep.c b/mbfido/mbftoberep.c index b0fcc6fb..0143179b 100644 --- a/mbfido/mbftoberep.c +++ b/mbfido/mbftoberep.c @@ -68,9 +68,9 @@ void ToBeRep(void) mbse_colour(LIGHTGRAY, BLACK); while (fread(&rep, sizeof(rep), 1, fp) == 1) { - printf("%-20s %-12s %-12s %5ld %s %s\n", + printf("%-20s %-12s %-12s %5d %s %s\n", rep.Echo, rep.Group, rep.Name, rep.SizeKb, StrDateDMY(rep.Fdate), rep.Announce ? "Yes":"No "); - Syslog('f', "%-20s %-12s %-12s %5ld %s %s", + Syslog('f', "%-20s %-12s %-12s %5d %s %s", rep.Echo, rep.Group, rep.Name, rep.SizeKb, StrDateDMY(rep.Fdate), rep.Announce ? "Yes":"No "); } diff --git a/mbfido/mbindex.c b/mbfido/mbindex.c index b9195843..b4e6f001 100644 --- a/mbfido/mbindex.c +++ b/mbfido/mbindex.c @@ -50,7 +50,7 @@ typedef struct _nl_user { FILE *ifp, *ufp, *ffp; -long total = 0, entries = 0, users = 0; +int total = 0, entries = 0, users = 0; int filenr = 0; unsigned short regio; nl_list *nll = NULL; @@ -652,7 +652,7 @@ int compile(char *nlname, unsigned short zo, unsigned short ne, unsigned short n Syslog('+', "%d entries", entries); if (!do_quiet) { - printf(" %ld entries\n", entries); + printf(" %d entries\n", entries); fflush(stdout); } diff --git a/mbfido/mbmsg.c b/mbfido/mbmsg.c index bc745dbe..2dcb768a 100644 --- a/mbfido/mbmsg.c +++ b/mbfido/mbmsg.c @@ -44,7 +44,7 @@ int do_link = FALSE; /* Link messages */ int do_post = FALSE; /* Post a Message */ extern int do_quiet; /* Quiet flag */ extern int show_log; /* Show loglines */ -long do_area = 0; /* Do only one area */ +int do_area = 0; /* Do only one area */ time_t t_start; /* Start time */ time_t t_end; /* End time */ int are_tot = 0; /* Total areas */ @@ -80,7 +80,7 @@ int main(int argc, char **argv) int i; char *cmd, *too = NULL, *subj = NULL, *mfile = NULL, *flavor = NULL; struct passwd *pw; - long tarea = 0; + int tarea = 0; InitConfig(); @@ -246,7 +246,7 @@ void DoMsgBase() { FILE *pAreas; char *sAreas, *Name; - long arearec; + int arearec; int Del = 0; sAreas = calloc(PATH_MAX, sizeof(char)); @@ -281,7 +281,7 @@ void DoMsgBase() if (!do_quiet) { mbse_colour(CYAN, BLACK); - printf("\r%5ld .. %-40s", do_area, msgs.Name); + printf("\r%5d .. %-40s", do_area, msgs.Name); fflush(stdout); } are_tot++; @@ -309,7 +309,7 @@ void DoMsgBase() Nopper(); if (!do_quiet) { mbse_colour(CYAN, BLACK); - printf("\r%5ld .. %-40s", arearec, msgs.Name); + printf("\r%5d .. %-40s", arearec, msgs.Name); fflush(stdout); } are_tot++; @@ -403,7 +403,7 @@ void DoMsgBase() -void LinkArea(char *Path, long Areanr) +void LinkArea(char *Path, int Areanr) { int rc; @@ -421,9 +421,9 @@ void LinkArea(char *Path, long Areanr) /* * Kill messages according to age and max messages. */ -void KillArea(char *Path, char *Name, int DaysOld, int MaxMsgs, long Areanr) +void KillArea(char *Path, char *Name, int DaysOld, int MaxMsgs, int Areanr) { - unsigned long Number, TotalMsgs = 0, Highest, *Active, Counter = 0; + unsigned int Number, TotalMsgs = 0, Highest, *Active, Counter = 0; int i, DelCount = 0, DelAge = 0, Done; time_t Today, MsgDate; @@ -444,7 +444,7 @@ void KillArea(char *Path, char *Name, int DaysOld, int MaxMsgs, long Areanr) TotalMsgs = Msg_Number(); if (TotalMsgs) { - if ((Active = (unsigned long *)malloc((size_t)((TotalMsgs + 100L) * sizeof(unsigned long)))) != NULL) { + if ((Active = (unsigned int *)malloc((size_t)((TotalMsgs + 100L) * sizeof(unsigned int)))) != NULL) { i = 0; Number = Msg_Lowest(); do { @@ -462,7 +462,7 @@ void KillArea(char *Path, char *Name, int DaysOld, int MaxMsgs, long Areanr) msleep(1); if ((!do_quiet) && ((Counter % 10L) == 0)) { - printf("%6lu / %6lu\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b", Counter, TotalMsgs); + printf("%6u / %6u\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b", Counter, TotalMsgs); fflush(stdout); } if ((Counter % 10L) == 0) @@ -539,7 +539,7 @@ void KillArea(char *Path, char *Name, int DaysOld, int MaxMsgs, long Areanr) /* * Pack message area if there are deleted messages. */ -void PackArea(char *Path, long Areanr) +void PackArea(char *Path, int Areanr) { IsDoing("Packing %ld", Areanr); if (Msg_Open(Path)) { diff --git a/mbfido/mbmsg.h b/mbfido/mbmsg.h index 71215a5b..ec88075a 100644 --- a/mbfido/mbmsg.h +++ b/mbfido/mbmsg.h @@ -7,9 +7,9 @@ void ProgName(void); void Help(void); void die(int); void DoMsgBase(void); -void PackArea(char *, long); -void LinkArea(char *, long); -void KillArea(char *, char *, int, int, long); +void PackArea(char *, int); +void LinkArea(char *, int); +void KillArea(char *, char *, int, int, int); #endif diff --git a/mbfido/mbseq.c b/mbfido/mbseq.c index 03d5831d..bc704695 100644 --- a/mbfido/mbseq.c +++ b/mbfido/mbseq.c @@ -4,7 +4,7 @@ * Purpose ...............: give a hexadecimal sequence to stdout * ***************************************************************************** - * Copyright (C) 1997-2004 + * Copyright (C) 1997-2005 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -39,7 +39,7 @@ int main(int argc, char **argv) { struct passwd *pw; - unsigned long seq; + unsigned int seq; InitConfig(); @@ -53,7 +53,7 @@ int main(int argc, char **argv) seq = sequencer(); Syslog('+', "Sequence string %08lx", seq); - printf("%08lx", seq); + printf("%08x", seq); fflush(stdout); Syslog(' ', "MBSEQ finished"); diff --git a/mbfido/mgrutil.c b/mbfido/mgrutil.c index cb699d56..7a74bb27 100644 --- a/mbfido/mgrutil.c +++ b/mbfido/mgrutil.c @@ -391,7 +391,7 @@ int UplinkRequest(faddr *t, faddr *From, int FileMgr, char *cmd) /* * Add MSGID, REPLY and PID */ - fprintf(qp, "\001MSGID: %s %08lx\r", aka2str(Orig), sequencer()); + fprintf(qp, "\001MSGID: %s %08x\r", aka2str(Orig), sequencer()); fprintf(qp, "\001PID: MBSE-FIDO %s (%s-%s)\r", VERSION, OsName(), OsCPU()); fprintf(qp, "\001TZUTC: %s\r", gmtoffset(Now)); diff --git a/mbfido/mkftnhdr.c b/mbfido/mkftnhdr.c index b316823b..eda19e6a 100644 --- a/mbfido/mkftnhdr.c +++ b/mbfido/mkftnhdr.c @@ -4,7 +4,7 @@ * Purpose ...............: MBSE BBS Mail Gate * ***************************************************************************** - * Copyright (C) 1997-2004 + * Copyright (C) 1997-2005 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -64,10 +64,10 @@ faddr *bestaka; -int ftnmsgid(char *msgid, char **s, unsigned long *n, char *areaname) +int ftnmsgid(char *msgid, char **s, unsigned int *n, char *areaname) { char *buf, *l, *r, *p; - unsigned long nid = 0L; + unsigned int nid = 0L; faddr *tmp; static int ftnorigin = 0; @@ -120,7 +120,7 @@ int ftnmsgid(char *msgid, char **s, unsigned long *n, char *areaname) *r++ = '\0'; *s = xstrcpy(l+6); if (r) - sscanf(r,"%lx",&nid); + sscanf(r,"%x",&nid); ftnorigin = 1; /* */ } else if (strncmp(l,"NOMSGID_",8) == 0) { @@ -144,7 +144,7 @@ int ftnmsgid(char *msgid, char **s, unsigned long *n, char *areaname) r=strchr(l+4,'_'); *r++='\0'; *s=xstrcpy(l+4); - sscanf(r,"%lx",&nid); + sscanf(r,"%x",&nid); ftnorigin=1; /* */ } else if (strncmp(l,"wgcid$",6) == 0) { @@ -176,7 +176,7 @@ int ftnmsgid(char *msgid, char **s, unsigned long *n, char *areaname) if ((r=strstr(l,"$j"))) { *r='\0'; *s=xstrcat(*s,l); - sscanf(r+2,"%lx",&nid); + sscanf(r+2,"%x",&nid); } } else { *r='\0'; diff --git a/mbfido/mkftnhdr.h b/mbfido/mkftnhdr.h index 428473f7..03e400f4 100644 --- a/mbfido/mkftnhdr.h +++ b/mbfido/mkftnhdr.h @@ -2,7 +2,7 @@ #define _MKFTNHDR_H -int ftnmsgid(char *,char **,unsigned long *,char *); +int ftnmsgid(char *,char **,unsigned int *,char *); ftnmsg *mkftnhdr(rfcmsg *, int, faddr *); diff --git a/mbfido/msg.c b/mbfido/msg.c index e1d8ce08..d57ec7a4 100644 --- a/mbfido/msg.c +++ b/mbfido/msg.c @@ -369,7 +369,7 @@ int toss_onemsg(char *msgname) do_scan = TRUE; snprintf(temp, PATH_MAX, "%s/tmp/netmail.jam", getenv("MBSE_ROOT")); if ((np = fopen(temp, "a")) != NULL) { - fprintf(np, "%s %lu\n", msgs.Base, Msg.Id); + fprintf(np, "%s %u\n", msgs.Base, Msg.Id); fclose(np); } } diff --git a/mbfido/msgutil.c b/mbfido/msgutil.c index 46963f16..25a187dc 100644 --- a/mbfido/msgutil.c +++ b/mbfido/msgutil.c @@ -69,10 +69,10 @@ char lotab[] = { void Msg_Id(fidoaddr aka) { char *temp; - unsigned long crc = -1; + unsigned int crc = -1; temp = calloc(81, sizeof(char)); - snprintf(temp, 81, "\001MSGID: %s %08lx", aka2str(aka), sequencer()); + snprintf(temp, 81, "\001MSGID: %s %08x", aka2str(aka), sequencer()); MsgText_Add2(temp); Msg.MsgIdCRC = upd_crc32(temp, crc, strlen(temp)); Msg.ReplyCRC = 0xffffffff; @@ -143,11 +143,11 @@ void Msg_Macro(FILE *fi) -long Msg_Top(char *template, int language, fidoaddr aka) +int Msg_Top(char *template, int language, fidoaddr aka) { char *temp, *line; FILE *fp, *fi; - long fileptr, fileptr1 = -1L; + int fileptr, fileptr1 = -1L; int hasmodems = FALSE; temp = calloc(PATH_MAX, sizeof(char)); diff --git a/mbfido/msgutil.h b/mbfido/msgutil.h index 84da3757..f1b59a15 100644 --- a/mbfido/msgutil.h +++ b/mbfido/msgutil.h @@ -7,7 +7,7 @@ void Msg_Id(fidoaddr); void Msg_Pid(void); void Msg_Macro(FILE *); -long Msg_Top(char *, int, fidoaddr); +int Msg_Top(char *, int, fidoaddr); void Msg_Bot(fidoaddr, char *, char *); void CountPosted(char *); char *To_Low(char *, int); diff --git a/mbfido/newspost.c b/mbfido/newspost.c index 5d64578d..f4d41afa 100644 --- a/mbfido/newspost.c +++ b/mbfido/newspost.c @@ -45,7 +45,7 @@ int newspost(void) { int start = TRUE, fatal = FALSE; char *buf, *p; - long curpos, count, seqnr; + int curpos, count, seqnr; FILE *ofp = NULL, *nb; struct utsname utsbuf; @@ -138,7 +138,7 @@ int newspost(void) if (!count) break; fseek(nfp, curpos, SEEK_SET); - fprintf(ofp, "#! rnews %ld\n", count); + fprintf(ofp, "#! rnews %d\n", count); while (fgets(buf, 10240, nfp)) { if (strcmp(buf, ".\n")) { fprintf(ofp, buf); @@ -194,17 +194,17 @@ int newspost(void) return TRUE; } - snprintf(buf, 10240, "%s/C.%s%lx", CFG.rnewspath, CFG.nntpnode, seqnr); + snprintf(buf, 10240, "%s/C.%s%x", CFG.rnewspath, CFG.nntpnode, seqnr); if ((nb = fopen(buf, "a")) == NULL) { WriteError("Can't create %s", buf); newsopen = FALSE; return TRUE; } seqnr = sequencer(); - fprintf(nb, "E D.%s%lx D.%s%lx news -C D.%s%lx 0666 \"\" 0 rnews\n", + fprintf(nb, "E D.%s%x D.%s%x news -C D.%s%x 0666 \"\" 0 rnews\n", utsbuf.nodename, seqnr, utsbuf.nodename, seqnr, utsbuf.nodename, seqnr); fclose(nb); - snprintf(buf, 10240, "%s/D.%s%lx", CFG.rnewspath, utsbuf.nodename, seqnr); + snprintf(buf, 10240, "%s/D.%s%x", CFG.rnewspath, utsbuf.nodename, seqnr); if ((nb = fopen(buf, "a")) == NULL) { WriteError("Can't create %s", buf); newsopen = FALSE; diff --git a/mbfido/ping.c b/mbfido/ping.c index 6633e196..42dab51f 100644 --- a/mbfido/ping.c +++ b/mbfido/ping.c @@ -94,7 +94,7 @@ int Ping(faddr *f, faddr *t, FILE *fp, int intransit) /* * Add MSGID, REPLY and PID */ - fprintf(np, "\001MSGID: %s %08lx\r", ascfnode(from, 0x1f), sequencer()); + fprintf(np, "\001MSGID: %s %08x\r", ascfnode(from, 0x1f), sequencer()); while ((fgets(Buf, MAX_LINE_LENGTH, fp)) != NULL) { Striplf(Buf); if (strncmp(Buf, "\001MSGID:", 7) == 0) { diff --git a/mbfido/post.c b/mbfido/post.c index f2b44028..0d222160 100644 --- a/mbfido/post.c +++ b/mbfido/post.c @@ -41,12 +41,12 @@ extern int do_quiet; /* Suppress screen output */ -int Post(char *To, long Area, char *Subj, char *File, char *Flavor) +int Post(char *To, int Area, char *Subj, char *File, char *Flavor) { int i, rc = FALSE, has_tear = FALSE, has_origin = FALSE; char *aka, *temp, *sAreas; FILE *fp, *tp; - unsigned long crc = -1; + unsigned int crc = -1; time_t tt; struct tm *t; @@ -54,11 +54,11 @@ int Post(char *To, long Area, char *Subj, char *File, char *Flavor) if (!do_quiet) { mbse_colour(CYAN, BLACK); - printf("Post \"%s\" to \"%s\" in area %ld\n", File, To, Area); + printf("Post \"%s\" to \"%s\" in area %d\n", File, To, Area); } IsDoing("Posting"); - Syslog('+', "Post \"%s\" area %ld to \"%s\" flavor %s", File, Area, To, Flavor); + Syslog('+', "Post \"%s\" area %d to \"%s\" flavor %s", File, Area, To, Flavor); Syslog('+', "Subject: \"%s\"", Subj); if ((tp = fopen(File, "r")) == NULL) { @@ -213,7 +213,7 @@ int Post(char *To, long Area, char *Subj, char *File, char *Flavor) } temp = calloc(PATH_MAX, sizeof(char)); - snprintf(temp, PATH_MAX, "\001MSGID: %s %08lx", aka2str(msgs.Aka), sequencer()); + snprintf(temp, PATH_MAX, "\001MSGID: %s %08x", aka2str(msgs.Aka), sequencer()); MsgText_Add2(temp); Msg.MsgIdCRC = upd_crc32(temp, crc, strlen(temp)); Msg.ReplyCRC = 0xffffffff; @@ -275,7 +275,7 @@ int Post(char *To, long Area, char *Subj, char *File, char *Flavor) if (msgs.Type != LOCALMAIL) { snprintf(temp, PATH_MAX, "%s/tmp/%smail.jam", getenv("MBSE_ROOT"), (msgs.Type == ECHOMAIL) ? "echo" : "net"); if ((fp = fopen(temp, "a")) != NULL) { - fprintf(fp, "%s %lu\n", msgs.Base, Msg.Id); + fprintf(fp, "%s %u\n", msgs.Base, Msg.Id); fclose(fp); } CreateSema((char *)"mailout"); diff --git a/mbfido/post.h b/mbfido/post.h index 440bf7b7..5d7924be 100644 --- a/mbfido/post.h +++ b/mbfido/post.h @@ -3,7 +3,7 @@ /* $Id$ */ -int Post(char *, long, char *, char *, char *); /* Post a Message */ +int Post(char *, int, char *, char *, char *); /* Post a Message */ #endif diff --git a/mbfido/postecho.c b/mbfido/postecho.c index c14e7b14..287878de 100644 --- a/mbfido/postecho.c +++ b/mbfido/postecho.c @@ -136,7 +136,7 @@ int postecho(faddr *p_from, faddr *f, faddr *t, char *orig, char *subj, time_t m char *buf, *msgid = NULL, *reply = NULL, *p, *q, sbe[16]; int First = TRUE, rc = 0, i, kludges = TRUE, dupe = FALSE, bad = TRUE, seenlen, oldnet; faddr *Faddr; - unsigned long crc; + unsigned int crc; sysconnect Link; fa_list *sbl = NULL, *ptl = NULL, *tmpl; qualify *qal = NULL, *tmpq; diff --git a/mbfido/ptic.c b/mbfido/ptic.c index d62df7bf..1f721084 100644 --- a/mbfido/ptic.c +++ b/mbfido/ptic.c @@ -72,7 +72,7 @@ int ProcessTic(fa_list **sbl) int UnPacked = FALSE, IsArchive = FALSE, rc, i, j, k, File_Id = FALSE; char *Temp, *unarc = NULL, *cmd = NULL; char temp1[PATH_MAX], temp2[PATH_MAX], sbe[24], TDesc[256]; - unsigned long crc, crc2, Kb; + unsigned int crc, crc2, Kb; sysconnect Link; FILE *fp; struct utimbuf ut; diff --git a/mbfido/queue.c b/mbfido/queue.c index 51f543dd..c99c47b9 100644 --- a/mbfido/queue.c +++ b/mbfido/queue.c @@ -71,7 +71,7 @@ void flush_dir(char *ndir) faddr noden, *bestaka; fidoaddr nodenr; int flavor, mode, Attach, fage, first, bread, rc; - long fsize; + int fsize; char *p, *temp, *fname, *arcfile, *pktfile, *ext, maxnr, nr, oldnr, *buf; time_t Now; struct tm *ptm; @@ -185,7 +185,7 @@ void flush_dir(char *ndir) /* * Generate ARCfile name from the CRC of the ASCII string of the node address. */ - snprintf(arcfile, PATH_MAX, "%s/%08lx.%s0", nodes.Dir_out_path, StringCRC32(ascfnode(&noden, 0x1f)), ext); + snprintf(arcfile, PATH_MAX, "%s/%08x.%s0", nodes.Dir_out_path, StringCRC32(ascfnode(&noden, 0x1f)), ext); } else { bestaka = bestaka_s(&noden); @@ -216,7 +216,7 @@ void flush_dir(char *ndir) fname = calloc(PATH_MAX, sizeof(char)); snprintf(fname, PATH_MAX, "%s/mailpkt.qqq", temp); if (access(fname, W_OK) == 0) { - snprintf(pktfile, PATH_MAX, "%s/%08lx.pkt", temp, sequencer()); + snprintf(pktfile, PATH_MAX, "%s/%08x.pkt", temp, sequencer()); if (rename(fname, pktfile)) { WriteError("$Can't rename %s to %s", fname, pktfile); } else { @@ -464,7 +464,7 @@ void flush_dir(char *ndir) flavor = 'o'; if (nodes.Session_out == S_DIR) { - snprintf(arcfile, PATH_MAX, "%s/%08lx.pkt", nodes.Dir_out_path, sequencer()); + snprintf(arcfile, PATH_MAX, "%s/%08x.pkt", nodes.Dir_out_path, sequencer()); } else { snprintf(arcfile, PATH_MAX, "%s", pktname(&noden, flavor)); } diff --git a/mbfido/rfc2ftn.c b/mbfido/rfc2ftn.c index 80f57cb0..ac17b6cd 100644 --- a/mbfido/rfc2ftn.c +++ b/mbfido/rfc2ftn.c @@ -138,7 +138,7 @@ int rfc2ftn(FILE *fp, faddr *recipient) FILE *ofp; fa_list *sbl = NULL, *ptl = NULL, *tmpl; faddr *ta, *fta; - unsigned long svmsgid, svreply, acup_n = 0; + unsigned int svmsgid, svreply, acup_n = 0; int sot_kludge = FALSE, eot_kludge = FALSE, tinyorigin = FALSE; int needsplit, hdrsize, datasize, splitpart, forbidsplit, rfcheaders; time_t Now; @@ -385,11 +385,11 @@ int rfc2ftn(FILE *fp, faddr *recipient) Syslog('!', "Rfc2ftn: warning, no MSGID %s %08lx", MBSE_SS(fmsg->msgid_a), fmsg->msgid_n); } - fprintf(ofp, "\001MSGID: %s %08lx\n", MBSE_SS(fmsg->msgid_a),fmsg->msgid_n); + fprintf(ofp, "\001MSGID: %s %08x\n", MBSE_SS(fmsg->msgid_a),fmsg->msgid_n); if (fmsg->reply_s) fprintf(ofp, "\1REPLY: %s\n", fmsg->reply_s); else if (fmsg->reply_a) - fprintf(ofp, "\1REPLY: %s %08lx\n", fmsg->reply_a, fmsg->reply_n); + fprintf(ofp, "\1REPLY: %s %08x\n", fmsg->reply_a, fmsg->reply_n); Now = time(NULL) - (gmt_offset((time_t)0) * 60); fprintf(ofp, "\001TZUTC: %s\n", gmtoffset(Now)); fprintf(ofp, "\001CHRS: %s\n", getftnchrs(msgs.Charset)); @@ -453,7 +453,7 @@ int rfc2ftn(FILE *fp, faddr *recipient) if (acup_a) { hash_update_s(&acup_n,fmsg->area); hdrsize += 26 + strlen(acup_a); - fprintf(ofp,"\1ACUPDATE: DELETE %s %08lx\n", acup_a,acup_n); + fprintf(ofp,"\1ACUPDATE: DELETE %s %08x\n", acup_a,acup_n); } } } @@ -462,7 +462,7 @@ int rfc2ftn(FILE *fp, faddr *recipient) if (acup_a) { hash_update_s(&acup_n,fmsg->area); hdrsize += 26 + strlen(acup_a); - fprintf(ofp,"\1ACUPDATE: MODIFY %s %08lx\n", acup_a,acup_n); + fprintf(ofp,"\1ACUPDATE: MODIFY %s %08x\n", acup_a,acup_n); } } if (!(hdr((char *)"X-FTN-Tearline", msg)) && !(hdr((char *)"X-FTN-TID", msg))) { diff --git a/mbfido/rnews.c b/mbfido/rnews.c index d1fa9ad0..0a2f63f0 100644 --- a/mbfido/rnews.c +++ b/mbfido/rnews.c @@ -479,7 +479,7 @@ static int UnpackOne(int *fdp, int *countp) cargv[0] = (char *)"gzip"; cargv[1] = (char *)"-d"; cargv[2] = NULL; - lseek(*fdp, (long) 0, 0); /* Back to the beginning */ + lseek(*fdp, (int) 0, 0); /* Back to the beginning */ *fdp = StartChild(*fdp, (char*)_PATH_GZIP, cargv); if (*fdp < 0) return FALSE; @@ -565,7 +565,7 @@ void ProcessOne(FILE *fp) { char *p, *fn, *buf, *gbuf, *mbuf, *group, *groups[25]; int i, nrofgroups; - unsigned long crc; + unsigned int crc; buf = calloc(UUCPBUF, sizeof(char)); fn = calloc(PATH_MAX, sizeof(char)); diff --git a/mbfido/rollover.c b/mbfido/rollover.c index 0b8159ec..dc4e2cc8 100644 --- a/mbfido/rollover.c +++ b/mbfido/rollover.c @@ -36,7 +36,7 @@ extern int do_quiet; -void StatAdd(statcnt *S, unsigned long V) +void StatAdd(statcnt *S, unsigned int V) { S->total += V; S->tweek += V; diff --git a/mbfido/rollover.h b/mbfido/rollover.h index bfd8f71b..9f4347e9 100644 --- a/mbfido/rollover.h +++ b/mbfido/rollover.h @@ -1,10 +1,9 @@ #ifndef _ROLLOVER_H #define _ROLLOVER_H +/* $Id$ */ -void StatAdd(statcnt *, unsigned long); +void StatAdd(statcnt *, unsigned int); void Rollover(void); - #endif - diff --git a/mbfido/scan.c b/mbfido/scan.c index 39e98b39..7bdb1942 100644 --- a/mbfido/scan.c +++ b/mbfido/scan.c @@ -60,11 +60,11 @@ int scanned; * Internal prototypes */ void ScanFull(void); -void ScanOne(char *, unsigned long); -void ExportEcho(sysconnect, unsigned long, fa_list **); -void ExportNews( unsigned long, fa_list **); -void ExportNet(unsigned long, int); -void ExportEmail(unsigned long); +void ScanOne(char *, unsigned int); +void ExportEcho(sysconnect, unsigned int, fa_list **); +void ExportNews( unsigned int, fa_list **); +void ExportNet(unsigned int, int); +void ExportEmail(unsigned int); @@ -76,7 +76,7 @@ void ExportEmail(unsigned long); void ScanMail(int DoAll) { int DoFull = FALSE, i = 0; - unsigned long msg; + unsigned int msg; char *Fname = NULL, *temp, *msgstr, *path; FILE *fp; @@ -147,8 +147,8 @@ void ScanFull() { char *sAreas, sbe[128]; FILE *pAreas; - long arearec = 0, sysstart, nextstart; - unsigned long Total, Number; + int arearec = 0, sysstart, nextstart; + unsigned int Total, Number; int i; sysconnect Link; fa_list *sbl = NULL; @@ -189,7 +189,7 @@ void ScanFull() msleep(1); if (((Number % 10) == 0) && (!do_quiet)) { - printf("%6lu\b\b\b\b\b\b", Number); + printf("%6u\b\b\b\b\b\b", Number); fflush(stdout); } @@ -238,7 +238,7 @@ void ScanFull() Nopper(); if (!do_quiet) { mbse_colour(CYAN, BLACK); - printf("\r%5ld .. %-40s", arearec, msgs.Name); + printf("\r%5d .. %-40s", arearec, msgs.Name); mbse_colour(LIGHTMAGENTA, BLACK); fflush(stdout); } @@ -252,7 +252,7 @@ void ScanFull() msleep(1); if (((Number % 10) == 0) && (!do_quiet)) { - printf("%6lu\b\b\b\b\b\b", Number); + printf("%6u\b\b\b\b\b\b", Number); fflush(stdout); } @@ -339,12 +339,12 @@ void ScanFull() -void ScanOne(char *path, unsigned long MsgNum) +void ScanOne(char *path, unsigned int MsgNum) { char *sAreas, sbe[128]; FILE *pAreas; - long sysstart; - unsigned long Total, Area = 0; + int sysstart; + unsigned int Total, Area = 0; int i; sysconnect Link; fa_list *sbl = NULL; @@ -406,7 +406,7 @@ void ScanOne(char *path, unsigned long MsgNum) if ((msgs.Active) && (msgs.Type == ECHOMAIL || msgs.Type == NETMAIL || msgs.Type == NEWS)) { if (!do_quiet) { mbse_colour(CYAN, BLACK); - printf("\r%5ld .. %-40s", Area, msgs.Name); + printf("\r%5d .. %-40s", Area, msgs.Name); mbse_colour(LIGHTMAGENTA, BLACK); fflush(stdout); } @@ -485,16 +485,16 @@ void ScanOne(char *path, unsigned long MsgNum) -int RescanOne(faddr *L, char *marea, unsigned long Num) +int RescanOne(faddr *L, char *marea, unsigned int Num) // Return: 0 -> Ok // 1 -> Unknown area // 2 -> Node cant rescan this area { - unsigned long Total, MsgNum, Area = 0; + unsigned int Total, MsgNum, Area = 0; fa_list *sbl = NULL; fidoaddr *l; int First, Found; - unsigned long rescanned; + unsigned int rescanned; sysconnect Link; IsDoing("ReScan mail"); @@ -530,7 +530,7 @@ int RescanOne(faddr *L, char *marea, unsigned long Num) if ((msgs.Active) && ((msgs.Type == ECHOMAIL) || (msgs.Type == NEWS) || (msgs.Type == LIST))) { if (!do_quiet) { mbse_colour(CYAN, BLACK); - printf("\r%5ld .. %-40s", Area, msgs.Name); + printf("\r%5d .. %-40s", Area, msgs.Name); mbse_colour(LIGHTMAGENTA, BLACK); fflush(stdout); } @@ -573,7 +573,7 @@ int RescanOne(faddr *L, char *marea, unsigned long Num) /* * Export message to downlink. The messagebase is locked. */ -void ExportEcho(sysconnect L, unsigned long MsgNum, fa_list **sbl) +void ExportEcho(sysconnect L, unsigned int MsgNum, fa_list **sbl) { int rc, seenlen, oldnet, flags = 0, kludges = TRUE; char *p, sbe[128], ext[4]; @@ -680,7 +680,7 @@ void ExportEcho(sysconnect L, unsigned long MsgNum, fa_list **sbl) /* * Export message to the newsserver. The messagebase is locked. */ -void ExportNews(unsigned long MsgNum, fa_list **sbl) +void ExportNews(unsigned int MsgNum, fa_list **sbl) { char *p; int i, seenlen, oldnet, flags = 0; @@ -783,7 +783,7 @@ void ExportNews(unsigned long MsgNum, fa_list **sbl) /* * Export Netmail message, the messagebase is locked. */ -void ExportNet(unsigned long MsgNum, int UUCPgate) +void ExportNet(unsigned int MsgNum, int UUCPgate) { char *p, *q, ext[4], fromname[37], flavor, MailFrom[128], MailTo[128]; int i, rc, flags = 0, first, is_fmpt = FALSE, is_topt = FALSE, is_intl = FALSE, mypoint = FALSE, empty = TRUE; @@ -1091,7 +1091,7 @@ void ExportNet(unsigned long MsgNum, int UUCPgate) /* * Export Email message, the messagebase is locked. */ -void ExportEmail(unsigned long MsgNum) +void ExportEmail(unsigned int MsgNum) { char *p, *q, MailFrom[128], MailTo[128]; FILE *qp; diff --git a/mbfido/scan.h b/mbfido/scan.h index 4a655674..6464b10e 100644 --- a/mbfido/scan.h +++ b/mbfido/scan.h @@ -1,10 +1,9 @@ #ifndef _SCAN_H #define _SCAN_H +/* $Id$ */ void ScanMail(int); -int RescanOne(faddr *, char *, unsigned long); - +int RescanOne(faddr *, char *, unsigned int); #endif - diff --git a/mbfido/scannews.c b/mbfido/scannews.c index 9f755449..99228a90 100644 --- a/mbfido/scannews.c +++ b/mbfido/scannews.c @@ -75,10 +75,10 @@ extern char *replyaddr; * Internal functions */ int do_one_group(List **, char *, char *, int); -int get_xover(char *, long, long, List **); +int get_xover(char *, int, int, List **); int get_xoverview(void); void tidy_artlist(List **); -void fill_artlist(List **, char *, long, int); +void fill_artlist(List **, char *, int, int); void Marker(void); int get_article(char *, char *); @@ -100,7 +100,7 @@ void tidy_artlist(List **fdp) /* * Add article to the list */ -void fill_artlist(List **fdp, char *id, long nr, int dupe) +void fill_artlist(List **fdp, char *id, int nr, int dupe) { List **tmp; @@ -255,7 +255,7 @@ int do_one_group(List **art, char *grpname, char *ftntag, int maxarticles) List *tmp; char temp[128], *resp; int retval, fetched = 0; - long total, start, end; + int total, start, end; Syslog('m', "do_one_group(%s, %s)", grpname, ftntag); IsDoing((char *)"Scan %s", grpname); @@ -388,15 +388,15 @@ int get_article(char *msgid, char *ftntag) -int get_xover(char *grpname, long startnr, long endnr, List **art) +int get_xover(char *grpname, int startnr, int endnr, List **art) { char cmd[81], *ptr, *ptr2, *resp, *p; int retval, dupe, done = FALSE; - long nr; - unsigned long crc; + int nr; + unsigned int crc; POverview pov; - snprintf(cmd, 81, "XOVER %ld-%ld\r\n", startnr, endnr); + snprintf(cmd, 81, "XOVER %d-%d\r\n", startnr, endnr); if ((retval = nntp_cmd(cmd, 224))) { switch (retval) { case 412: WriteError("No newsgroup selected"); diff --git a/mbfido/scannews.h b/mbfido/scannews.h index 4e6d8f51..2adfa72e 100644 --- a/mbfido/scannews.h +++ b/mbfido/scannews.h @@ -1,6 +1,8 @@ #ifndef _SCANNEWS_H #define _SCANNEWS_H +/* $Id$ */ + #define MAX_MSGID_LEN 196 #define MAX_GRP_LEN 128 @@ -23,7 +25,7 @@ typedef struct XOVERVIEW { typedef struct LinkList { struct LinkList *next; char msgid[MAX_MSGID_LEN]; - long nr; + int nr; int isdupe; } List, *PList; @@ -35,4 +37,3 @@ void ScanNews(void); #endif - diff --git a/mbfido/sendmail.c b/mbfido/sendmail.c index 463b59f3..71e0fff1 100644 --- a/mbfido/sendmail.c +++ b/mbfido/sendmail.c @@ -116,7 +116,7 @@ FILE *SendMgrMail(faddr *t, int Keep, int FileAttach, char *bymgr, char *subj, c /* * Add MSGID, REPLY and PID */ - fprintf(qp, "\001MSGID: %s %08lx\r", aka2str(Orig), sequencer()); + fprintf(qp, "\001MSGID: %s %08x\r", aka2str(Orig), sequencer()); if (reply != NULL) fprintf(qp, "\001REPLY: %s\r", reply); fprintf(qp, "\001PID: MBSE-FIDO %s (%s-%s)\r", VERSION, OsName(), OsCPU()); diff --git a/mbfido/storeecho.c b/mbfido/storeecho.c index e3b40140..c5b2a2e7 100644 --- a/mbfido/storeecho.c +++ b/mbfido/storeecho.c @@ -57,7 +57,7 @@ extern int do_quiet; /* Quiet flag */ int storeecho(faddr *f, faddr *t, time_t mdate, int flags, char *subj, char *msgid, char *reply, int bad, int dupe, FILE *fp) { int result; - unsigned long crc2; + unsigned int crc2; char *buf; mbse_CleanSubject(subj); diff --git a/mbfido/storenet.c b/mbfido/storenet.c index bb8f9bdb..c68f797c 100644 --- a/mbfido/storenet.c +++ b/mbfido/storenet.c @@ -4,7 +4,7 @@ * Purpose ...............: Import a netmail message in the message base. * ***************************************************************************** - * Copyright (C) 1997-2004 + * Copyright (C) 1997-2005 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -59,7 +59,7 @@ extern int net_bad; /* Bad netmails (tracking errors */ int storenet(faddr *f, faddr *t, time_t mdate, int flags, char *Subj, char *msgid, char *reply, FILE *fp, char *flagstr) { int result = FALSE, i, empty = TRUE, bad; - unsigned long crc2; + unsigned int crc2; char *Buf; mbse_CleanSubject(Subj); diff --git a/mbfido/tic.c b/mbfido/tic.c index 8d5edfa6..f1f2824b 100644 --- a/mbfido/tic.c +++ b/mbfido/tic.c @@ -247,7 +247,7 @@ int LoadTic(char *inb, char *tfn) } else if (strncasecmp(Temp, "crc ", 4) == 0) { TIC.Crc_Int = strtoul(Temp+4, (char **)NULL, 16); - snprintf(TIC.TicIn.Crc, 9, "%08lX", TIC.Crc_Int); + snprintf(TIC.TicIn.Crc, 9, "%08X", TIC.Crc_Int); strcpy(T_File.Crc, TIC.TicIn.Crc); } else if (strncasecmp(Temp, "pw ", 3) == 0) { diff --git a/mbfido/tic.h b/mbfido/tic.h index ce5a1b2c..bb1549a7 100644 --- a/mbfido/tic.h +++ b/mbfido/tic.h @@ -1,7 +1,7 @@ -/* $Id$ */ +#ifndef _TIC_H +#define _TIC_H -#ifndef _TIC_H -#define _TIC_H +/* $Id$ */ typedef struct _tic_in { @@ -23,7 +23,7 @@ typedef struct _tic_in { char Pw[21]; /* Password */ char AreaDesc[61]; /* Area description */ char Date[61]; /* Date field */ - long Cost; /* Uplink cost */ + int Cost; /* Uplink cost */ off_t Size; /* Size of file */ char LDesc[25][81]; /* Long description */ int TotLDesc; /* Total lines */ @@ -43,7 +43,7 @@ typedef struct _TICrec { char NewFullName[256]; /* New LFN name */ char File_Id[25][49]; /* Description */ int File_Id_Ct; /* Nr of lines */ - unsigned long Crc_Int; /* Crc value */ + unsigned int Crc_Int; /* Crc value */ int KeepNum; /* Keep number of files */ off_t FileSize; /* Size of file */ time_t FileDate; /* Date of file */ @@ -53,7 +53,7 @@ typedef struct _TICrec { unsigned PassThru : 1; /* PassThru file */ unsigned NewAlias : 1; /* New alias is set */ unsigned Orphaned : 1; /* File is Orphaned */ - long FileCost; /* Cost for this file */ + int FileCost; /* Cost for this file */ char BBSpath[PATH_MAX]; /* Path to import in */ char BBSdesc[55]; /* Area description */ } TICrec; @@ -70,4 +70,3 @@ int LoadTic(char *, char *); #endif - diff --git a/mbfido/tracker.c b/mbfido/tracker.c index 949424c0..1dacd3cf 100644 --- a/mbfido/tracker.c +++ b/mbfido/tracker.c @@ -37,7 +37,7 @@ extern char nodes_fil[81]; -extern long nodes_pos; +extern int nodes_pos; /* * Internal prototypes @@ -161,7 +161,7 @@ int GetTableRoute(char *ftn, fidoaddr *res) faddr *dest; fidoaddr mask; int match, last; - long ptr; + int ptr; FILE *fil; /* diff --git a/mbfido/utic.c b/mbfido/utic.c index 42bd1a00..272483b6 100644 --- a/mbfido/utic.c +++ b/mbfido/utic.c @@ -45,7 +45,7 @@ char *MakeTicName() static char buf[13]; buf[12] = '\0'; - snprintf(buf, 13, "%08lx.tic", sequencer()); + snprintf(buf, 13, "%08x.tic", sequencer()); buf[0] = 'm'; buf[1] = 'b'; @@ -173,7 +173,7 @@ void Bad(char *format, ...) void ReCalcCrc(char *fn) { TIC.Crc_Int = file_crc(fn, CFG.slow_util && do_quiet); - snprintf(TIC.TicIn.Crc, 9, "%08lX", TIC.Crc_Int); + snprintf(TIC.TicIn.Crc, 9, "%08X", TIC.Crc_Int); strcpy(T_File.Crc, TIC.TicIn.Crc); } diff --git a/mbmon/mbmon.c b/mbmon/mbmon.c index 4c78ad28..c2e258fb 100644 --- a/mbmon/mbmon.c +++ b/mbmon/mbmon.c @@ -336,7 +336,7 @@ void disk_stat(void) { int ch, i, ro; char buf[1024], *cnt, *type, *fs, *p, sign; - unsigned long last[10], size, used, perc, avail; + unsigned int last[10], size, used, perc, avail; clr_index(); set_color(WHITE, BLACK); @@ -390,7 +390,7 @@ void disk_stat(void) } else { set_color(GREEN, BLACK); } - printf("%3lu", perc); + printf("%3u", perc); putchar('%'); set_color(CYAN, BLACK); printf(" %-8s %s %-37s", type, ro ?"RO":"RW", fs); diff --git a/mbnntp/atoul.c b/mbnntp/atoul.c index 4f359e97..2e3d126e 100644 --- a/mbnntp/atoul.c +++ b/mbnntp/atoul.c @@ -4,7 +4,7 @@ * Purpose ...............: MBSE BBS Mail Gate * ***************************************************************************** - * Copyright (C) 1997-2004 + * Copyright (C) 1997-2005 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -35,11 +35,11 @@ #ifndef USE_NEWSGATE -unsigned long atoul(char *str) +unsigned int atoul(char *str) { - unsigned long x; + unsigned int x; - if (sscanf(str,"%lu",&x) == 1) + if (sscanf(str,"%u",&x) == 1) return x; else return 0xffffffff; diff --git a/mbnntp/atoul.h b/mbnntp/atoul.h index 60c33924..6e4a4907 100644 --- a/mbnntp/atoul.h +++ b/mbnntp/atoul.h @@ -5,7 +5,7 @@ #ifndef USE_NEWSGATE -unsigned long atoul(char*); +unsigned int atoul(char*); #endif diff --git a/mbnntp/commands.c b/mbnntp/commands.c index 9b8d23b9..4997ff69 100644 --- a/mbnntp/commands.c +++ b/mbnntp/commands.c @@ -41,11 +41,11 @@ #ifndef USE_NEWSGATE -unsigned long article = 0L; /* Current article */ +unsigned int article = 0L; /* Current article */ char currentgroup[81]; /* Current newsgroup */ -extern unsigned long sentbytes; -extern unsigned long rcvdbytes; +extern unsigned int sentbytes; +extern unsigned int rcvdbytes; extern char *ttystat[]; @@ -100,7 +100,7 @@ char *make_msgid(char *msgid) { static char buf[100]; - snprintf(buf, 100, "<%08lx$%s@%s>", StringCRC32(msgid), currentgroup, CFG.sysdomain); + snprintf(buf, 100, "<%08x$%s@%s>", StringCRC32(msgid), currentgroup, CFG.sysdomain); return buf; } @@ -115,7 +115,7 @@ char *make_msgid(char *msgid) void command_abhs(char *buf) { char *p, *cmd, *opt, *subj, *charset = NULL; - unsigned long art = 0L; + unsigned int art = 0L; int i, found; Syslog('+', "%s", buf); @@ -567,7 +567,7 @@ void command_post(char *cmd) void command_xover(char *cmd) { char *opt, *p, msgid[100], reply[100]; - unsigned long i, start, end; + unsigned int i, start, end; int bytecount, linecount; IsDoing("Xover"); diff --git a/mbnntp/hash.c b/mbnntp/hash.c index 73cc183f..eee0ce22 100644 --- a/mbnntp/hash.c +++ b/mbnntp/hash.c @@ -35,18 +35,18 @@ #ifndef USE_NEWSGATE -void hash_update_s(unsigned long *id, char *mod) +void hash_update_s(unsigned int *id, char *mod) { *id ^= lh_strhash(mod); } -void hash_update_n(unsigned long *id, unsigned long mod) +void hash_update_n(unsigned int *id, unsigned int mod) { char buf[32]; - snprintf(buf,32,"%030lu",mod); + snprintf(buf,32,"%030u",mod); *id ^= lh_strhash(buf); } diff --git a/mbnntp/hash.h b/mbnntp/hash.h index 250cbf46..deaff228 100644 --- a/mbnntp/hash.h +++ b/mbnntp/hash.h @@ -5,8 +5,8 @@ #ifndef USE_NEWSGATE -void hash_update_s(unsigned long *, char *); -void hash_update_n(unsigned long *, unsigned long); +void hash_update_s(unsigned int *, char *); +void hash_update_n(unsigned int *, unsigned int); #endif diff --git a/mbnntp/lhash.c b/mbnntp/lhash.c index dcc2cb4f..077c486d 100644 --- a/mbnntp/lhash.c +++ b/mbnntp/lhash.c @@ -4,7 +4,7 @@ * Purpose ...............: MBSE BBS Mail Gate * ***************************************************************************** - * Copyright (C) 1997-2004 + * Copyright (C) 1997-2005 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -129,7 +129,7 @@ char *lh_version=(char *)"lhash part of SSLeay 0.6.4 30-Aug-1996"; #define P_CPP char *,char * static void expand(LHASH *lh); static void contract(LHASH *lh); -static LHASH_NODE **getrn(LHASH *lh, char *data, unsigned long *rhash); +static LHASH_NODE **getrn(LHASH *lh, char *data, unsigned int *rhash); #else @@ -141,7 +141,7 @@ static LHASH_NODE **getrn(); #endif -LHASH *lh_new(unsigned long (*h)(char *), int (*c)(char *, char *)) +LHASH *lh_new(unsigned int (*h)(char *), int (*c)(char *, char *)) { LHASH *ret; int i; @@ -153,7 +153,7 @@ LHASH *lh_new(unsigned long (*h)(char *), int (*c)(char *, char *)) for (i=0; ib[i]=NULL; ret->comp=((c == NULL)?(int (*)(char *, char *))strcmp:c); - ret->hash=((h == NULL)?(unsigned long (*)(char *))lh_strhash:h); + ret->hash=((h == NULL)?(unsigned int (*)(char *))lh_strhash:h); ret->num_nodes=MIN_NODES/2; ret->num_alloc_nodes=MIN_NODES; ret->p=0; @@ -208,7 +208,7 @@ void lh_free(LHASH *lh) char *lh_insert(LHASH *lh, char *data) { - unsigned long hash; + unsigned int hash; LHASH_NODE *nn,**rn; char *ret; @@ -242,7 +242,7 @@ char *lh_insert(LHASH *lh, char *data) char *lh_delete(LHASH *lh, char *data) { - unsigned long hash; + unsigned int hash; LHASH_NODE *nn,**rn; char *ret; @@ -274,7 +274,7 @@ char *lh_delete(LHASH *lh, char *data) char *lh_retrieve(LHASH *lh, char *data) { - unsigned long hash; + unsigned int hash; LHASH_NODE **rn; char *ret; @@ -329,7 +329,7 @@ static void expand(LHASH *lh) { LHASH_NODE **n,**n1,**n2,*np; unsigned int p,i,j; - unsigned long hash,nni; + unsigned int hash,nni; lh->num_nodes++; lh->num_expands++; @@ -417,10 +417,10 @@ static void contract(LHASH *lh) -static LHASH_NODE **getrn(LHASH *lh, char *data, unsigned long *rhash) +static LHASH_NODE **getrn(LHASH *lh, char *data, unsigned int *rhash) { LHASH_NODE **ret,*n1; - unsigned long hash,nn; + unsigned int hash,nn; int (*cf)(char *, char *); hash=(*(lh->hash))(data); @@ -455,11 +455,11 @@ static LHASH_NODE **getrn(LHASH *lh, char *data, unsigned long *rhash) * no collisions on /usr/dict/words and it distributes on %2^n quite * well, not as good as MD5, but still good. */ -unsigned long lh_strhash(char *c) +unsigned int lh_strhash(char *c) { - unsigned long ret=0; - long n; - unsigned long v; + unsigned int ret=0; + int n; + unsigned int v; int r; if ((c == NULL) || (*c == '\0')) diff --git a/mbnntp/lhash.h b/mbnntp/lhash.h index f74e1890..501c517b 100644 --- a/mbnntp/lhash.h +++ b/mbnntp/lhash.h @@ -63,7 +63,7 @@ typedef struct lhash_node_st char *data; struct lhash_node_st *next; #ifndef NO_HASH_COMP - unsigned long hash; + unsigned int hash; #endif } LHASH_NODE; @@ -71,41 +71,41 @@ typedef struct lhash_st { LHASH_NODE **b; int (*comp)(char *, char *); - unsigned long (*hash)(char *); + unsigned int (*hash)(char *); unsigned int num_nodes; unsigned int num_alloc_nodes; unsigned int p; unsigned int pmax; - unsigned long up_load; /* load times 256 */ - unsigned long down_load; /* load times 256 */ - unsigned long num_items; + unsigned int up_load; /* load times 256 */ + unsigned int down_load; /* load times 256 */ + unsigned int num_items; - unsigned long num_expands; - unsigned long num_expand_reallocs; - unsigned long num_contracts; - unsigned long num_contract_reallocs; - unsigned long num_hash_calls; - unsigned long num_comp_calls; - unsigned long num_insert; - unsigned long num_replace; - unsigned long num_delete; - unsigned long num_no_delete; - unsigned long num_retreve; - unsigned long num_retreve_miss; - unsigned long num_hash_comps; + unsigned int num_expands; + unsigned int num_expand_reallocs; + unsigned int num_contracts; + unsigned int num_contract_reallocs; + unsigned int num_hash_calls; + unsigned int num_comp_calls; + unsigned int num_insert; + unsigned int num_replace; + unsigned int num_delete; + unsigned int num_no_delete; + unsigned int num_retreve; + unsigned int num_retreve_miss; + unsigned int num_hash_comps; } LHASH; #define LH_LOAD_MULT 256 #ifndef NOPROTO -LHASH *lh_new(unsigned long (*h)(char *), int (*c)(char *, char *)); +LHASH *lh_new(unsigned int (*h)(char *), int (*c)(char *, char *)); void lh_free(LHASH *lh); char *lh_insert(LHASH *lh, char *data); char *lh_delete(LHASH *lh, char *data); char *lh_retrieve(LHASH *lh, char *data); void lh_doall(LHASH *lh, void (*func)(char *, char *)); void lh_doall_arg(LHASH *lh, void (*func)(char *, char *),char *arg); -unsigned long lh_strhash(char *c); +unsigned int lh_strhash(char *c); #ifndef WIN16 void lh_stats(LHASH *lh, FILE *out); @@ -130,7 +130,7 @@ char *lh_delete(); char *lh_retrieve(); void lh_doall(); void lh_doall_arg(); -unsigned long lh_strhash(); +unsigned int lh_strhash(); #ifndef WIN16 void lh_stats(); diff --git a/mbnntp/mbnntp.c b/mbnntp/mbnntp.c index 230d9c6b..adc3af01 100644 --- a/mbnntp/mbnntp.c +++ b/mbnntp/mbnntp.c @@ -44,8 +44,8 @@ time_t t_end; char *envptr = NULL; struct sockaddr_in peeraddr; pid_t mypid; -unsigned long rcvdbytes = 0L; -unsigned long sentbytes = 0L; +unsigned int rcvdbytes = 0L; +unsigned int sentbytes = 0L; int do_mailout = FALSE; extern char *ttystat[]; diff --git a/mbnntp/mkftnhdr.c b/mbnntp/mkftnhdr.c index 2f0e31c4..1035e5e2 100644 --- a/mbnntp/mkftnhdr.c +++ b/mbnntp/mkftnhdr.c @@ -4,7 +4,7 @@ * Purpose ...............: MBSE BBS Mail Gate * ***************************************************************************** - * Copyright (C) 1997-2004 + * Copyright (C) 1997-2005 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -63,10 +63,10 @@ faddr *bestaka; -int ftnmsgid(char *msgid, char **s, unsigned long *n, char *areaname) +int ftnmsgid(char *msgid, char **s, unsigned int *n, char *areaname) { char *buf, *l, *r, *p; - unsigned long nid = 0L; + unsigned int nid = 0L; faddr *tmp; static int ftnorigin = 0; @@ -117,7 +117,7 @@ int ftnmsgid(char *msgid, char **s, unsigned long *n, char *areaname) *r++ = '\0'; *s = xstrcpy(l+6); if (r) - sscanf(r,"%lx",&nid); + sscanf(r,"%x",&nid); ftnorigin = 1; /* */ } else if (strncmp(l,"NOMSGID_",8) == 0) { @@ -141,7 +141,7 @@ int ftnmsgid(char *msgid, char **s, unsigned long *n, char *areaname) r=strchr(l+4,'_'); *r++='\0'; *s=xstrcpy(l+4); - sscanf(r,"%lx",&nid); + sscanf(r,"%x",&nid); ftnorigin=1; /* */ } else if (strncmp(l,"wgcid$",6) == 0) { @@ -173,7 +173,7 @@ int ftnmsgid(char *msgid, char **s, unsigned long *n, char *areaname) if ((r=strstr(l,"$j"))) { *r='\0'; *s=xstrcat(*s,l); - sscanf(r+2,"%lx",&nid); + sscanf(r+2,"%x",&nid); } } else { *r='\0'; diff --git a/mbnntp/mkftnhdr.h b/mbnntp/mkftnhdr.h index 47e1ad7d..8db411a9 100644 --- a/mbnntp/mkftnhdr.h +++ b/mbnntp/mkftnhdr.h @@ -5,7 +5,7 @@ #ifndef USE_NEWSGATE -int ftnmsgid(char *,char **,unsigned long *,char *); +int ftnmsgid(char *,char **,unsigned int *,char *); ftnmsg *mkftnhdr(rfcmsg *, int, faddr *); #endif diff --git a/mbnntp/rfc2ftn.c b/mbnntp/rfc2ftn.c index 30ad79e9..e5eb459b 100644 --- a/mbnntp/rfc2ftn.c +++ b/mbnntp/rfc2ftn.c @@ -123,7 +123,7 @@ int kludgewrite(char *s, FILE *fp) int findorigmsg(char *msgid, char *o) { - unsigned long i, start, end; + unsigned int i, start, end; char *gen2; if (msgid == NULL) { @@ -177,7 +177,7 @@ int rfc2ftn(FILE *fp) FILE *ofp, *qfp; fa_list *sbl = NULL, *ptl = NULL, *tmpl; faddr *ta, *fta; - unsigned long svmsgid, svreply; + unsigned int svmsgid, svreply; int sot_kludge = FALSE, eot_kludge = FALSE, tinyorigin = FALSE; int needsplit, hdrsize, datasize, splitpart, forbidsplit, rfcheaders; time_t Now; @@ -399,14 +399,14 @@ int rfc2ftn(FILE *fp) fprintf(ofp, "AREA:%s\n", msgs.Tag); if ((fmsg->msgid_a == NULL) && (fmsg->msgid_n == 0)) { Syslog('n', "No Messageid from poster, creating new MSGID"); - fprintf(ofp, "\001MSGID: %s %08lx\n", aka2str(msgs.Aka), sequencer()); + fprintf(ofp, "\001MSGID: %s %08x\n", aka2str(msgs.Aka), sequencer()); } else { - fprintf(ofp, "\001MSGID: %s %08lx\n", MBSE_SS(fmsg->msgid_a),fmsg->msgid_n); + fprintf(ofp, "\001MSGID: %s %08x\n", MBSE_SS(fmsg->msgid_a),fmsg->msgid_n); } if (fmsg->reply_s) fprintf(ofp, "\1REPLY: %s\n", fmsg->reply_s); else if (fmsg->reply_a) - fprintf(ofp, "\1REPLY: %s %08lx\n", fmsg->reply_a, fmsg->reply_n); + fprintf(ofp, "\1REPLY: %s %08x\n", fmsg->reply_a, fmsg->reply_n); Now = time(NULL) - (gmt_offset((time_t)0) * 60); fprintf(ofp, "\001TZUTC: %s\n", gmtoffset(Now)); fprintf(ofp, "\001CHRS: %s\n", getftnchrs(msgs.Charset)); @@ -746,7 +746,7 @@ int rfc2ftn(FILE *fp) */ snprintf(temp, PATH_MAX, "%s/tmp/echomail.jam", getenv("MBSE_ROOT")); if ((qfp = fopen(temp, "a")) != NULL) { - fprintf(qfp, "%s %lu\n", msgs.Base, Msg.Id); + fprintf(qfp, "%s %u\n", msgs.Base, Msg.Id); fclose(qfp); } diff --git a/mbsebbs/bye.c b/mbsebbs/bye.c index a0c5f266..7f36806c 100644 --- a/mbsebbs/bye.c +++ b/mbsebbs/bye.c @@ -54,7 +54,7 @@ void Good_Bye(int onsig) { FILE *pUsrConfig, *pExitinfo; char *temp; - long offset; + int offset; time_t t_end; int i; diff --git a/mbsebbs/dispfile.c b/mbsebbs/dispfile.c index 8334c09a..fe3efbaf 100644 --- a/mbsebbs/dispfile.c +++ b/mbsebbs/dispfile.c @@ -232,7 +232,7 @@ int DisplayTextFile(char *filename) int DisplayFile(char *filename) { FILE *pFileName; - long iSec = 0; + int iSec = 0; char *sFileName, *tmp, *tmp1, newfile[PATH_MAX]; int i, x; unsigned char c; @@ -364,27 +364,27 @@ void ControlCodeF(int ch) snprintf(temp, 81, "%s", exitinfo.sProtocol); break; case 'A': - snprintf(temp, 81, "%ld", exitinfo.Uploads); + snprintf(temp, 81, "%d", exitinfo.Uploads); break; case 'B': - snprintf(temp, 81, "%ld", exitinfo.Downloads); + snprintf(temp, 81, "%d", exitinfo.Downloads); break; case 'C': - snprintf(temp, 81, "%lu", exitinfo.DownloadK); + snprintf(temp, 81, "%u", exitinfo.DownloadK); break; case 'D': - snprintf(temp, 81, "%lu", exitinfo.UploadK); + snprintf(temp, 81, "%u", exitinfo.UploadK); break; case 'E': - snprintf(temp, 81, "%lu", exitinfo.DownloadK + exitinfo.UploadK); + snprintf(temp, 81, "%u", exitinfo.DownloadK + exitinfo.UploadK); break; case 'F': - snprintf(temp, 81, "%lu", LIMIT.DownK); + snprintf(temp, 81, "%u", LIMIT.DownK); break; case 'H': @@ -594,7 +594,7 @@ void ControlCodeK(int ch) break; case 'E': - snprintf(temp, 81, "%ld", Speed()); + snprintf(temp, 81, "%d", Speed()); break; case 'F': @@ -609,7 +609,7 @@ void ControlCodeK(int ch) snprintf(sDataFile, PATH_MAX, "%s/etc/sysinfo.data", getenv("MBSE_ROOT")); if((pCallerLog = fopen(sDataFile, "rb")) != NULL) { fread(&SYSINFO, sizeof(SYSINFO), 1, pCallerLog); - snprintf(temp, 81, "%ld", SYSINFO.SystemCalls); + snprintf(temp, 81, "%d", SYSINFO.SystemCalls); fclose(pCallerLog); } break; @@ -628,7 +628,7 @@ void ControlCodeK(int ch) case 'L': SetMsgArea(iMsgAreaNumber); - snprintf(temp, 81, "%ld", MsgBase.Total); + snprintf(temp, 81, "%d", MsgBase.Total); break; case 'M': @@ -637,7 +637,7 @@ void ControlCodeK(int ch) if (Msg_GetLastRead(&LR) == TRUE) { if (LR.HighReadMsg > MsgBase.Highest) LR.HighReadMsg = MsgBase.Highest; - snprintf(temp, 81, "%ld", LR.HighReadMsg); + snprintf(temp, 81, "%d", LR.HighReadMsg); } else snprintf(temp, 81, "?"); Msg_Close(); @@ -650,7 +650,7 @@ void ControlCodeK(int ch) case 'O': SetEmailArea(sMailbox); - snprintf(temp, 81, "%ld", EmailBase.Total); + snprintf(temp, 81, "%d", EmailBase.Total); break; case 'P': @@ -660,7 +660,7 @@ void ControlCodeK(int ch) if (Msg_GetLastRead(&LR) == TRUE) { if (LR.HighReadMsg > EmailBase.Highest) LR.HighReadMsg = EmailBase.Highest; - snprintf(temp, 81, "%ld", LR.HighReadMsg); + snprintf(temp, 81, "%d", LR.HighReadMsg); } else snprintf(temp, 81, "?"); Msg_Close(); diff --git a/mbsebbs/door.c b/mbsebbs/door.c index 07992e0f..c2df050e 100644 --- a/mbsebbs/door.c +++ b/mbsebbs/door.c @@ -205,7 +205,7 @@ void ExtDoor(char *Program, int NoDoorsys, int Y2Kdoorsys, int Comport, int NoSu if (Comport) fprintf(fp, "19200\r\n");/* Locked baudrate */ else - fprintf(fp, "%ld\r\n", ttyinfo.portspeed); /* Locked baudrate */ + fprintf(fp, "%d\r\n", ttyinfo.portspeed); /* Locked baudrate */ fprintf(fp, "Y\r\n"); /* Screen snoop */ fprintf(fp, "N\r\n"); /* Printer on */ fprintf(fp, "Y\r\n"); /* Page bell */ @@ -228,10 +228,10 @@ void ExtDoor(char *Program, int NoDoorsys, int Y2Kdoorsys, int Comport, int NoSu fprintf(fp, "%s\r\n", Rdate(exitinfo.sExpiryDate, Y2Kdoorsys)); fprintf(fp, "%d\r\n", grecno); /* Users recordnumber */ fprintf(fp, "%s\r\n", exitinfo.sProtocol); - fprintf(fp, "%ld\r\n", exitinfo.Uploads); - fprintf(fp, "%ld\r\n", exitinfo.Downloads); - fprintf(fp, "%ld\r\n", LIMIT.DownK); /* FIXME: Download Kb today */ - fprintf(fp, "%ld\r\n", LIMIT.DownK); + fprintf(fp, "%d\r\n", exitinfo.Uploads); + fprintf(fp, "%d\r\n", exitinfo.Downloads); + fprintf(fp, "%d\r\n", LIMIT.DownK); /* FIXME: Download Kb today */ + fprintf(fp, "%d\r\n", LIMIT.DownK); fprintf(fp, "%s\r\n", Rdate(exitinfo.sDateOfBirth, Y2Kdoorsys)); fprintf(fp, "\r\n"); /* Path to userbase */ fprintf(fp, "\r\n"); /* Path to messagebase */ @@ -248,8 +248,8 @@ void ExtDoor(char *Program, int NoDoorsys, int Y2Kdoorsys, int Comport, int NoSu fprintf(fp, "%s\r\n", LastLoginTime); /* Time of last call */ fprintf(fp, "32768\r\n"); /* Always 32768 */ fprintf(fp, "%d\r\n", exitinfo.DownloadsToday); - fprintf(fp, "%ld\r\n", exitinfo.UploadK); - fprintf(fp, "%ld\r\n", exitinfo.DownloadK); + fprintf(fp, "%d\r\n", exitinfo.UploadK); + fprintf(fp, "%d\r\n", exitinfo.DownloadK); fprintf(fp, "%s\r\n", exitinfo.sComment); fprintf(fp, "0\r\n"); /* Always 0 */ fprintf(fp, "%d\r\n\032", exitinfo.iPosted); diff --git a/mbsebbs/email.c b/mbsebbs/email.c index 35bcb53d..96b30130 100644 --- a/mbsebbs/email.c +++ b/mbsebbs/email.c @@ -47,7 +47,7 @@ #include "ttyio.h" -extern unsigned long LastNum; +extern unsigned int LastNum; extern int Kludges; extern FILE *qf; extern char *Message[]; @@ -60,7 +60,7 @@ extern int LC_Wrote; * Internal prototypes */ int HasNoEmail(void); -int Export_a_Email(unsigned long); +int Export_a_Email(unsigned int); int EmailPanel(void); int Save_Email(int); @@ -96,7 +96,7 @@ void ShowEmailHdr(void) snprintf(temp, 81, " %-70s", sMailbox); pout(BLUE, LIGHTGRAY, temp); - snprintf(temp, 81, "#%-5lu", Msg.Id); + snprintf(temp, 81, "#%-5u", Msg.Id); pout(RED, LIGHTGRAY, temp); Enter(1); @@ -156,9 +156,9 @@ void ShowEmailHdr(void) Enter(1); if (Msg.Reply) - snprintf(Buf1, 35, "\"+\" %s %lu", (char *)Language(211), Msg.Reply); + snprintf(Buf1, 35, "\"+\" %s %u", (char *)Language(211), Msg.Reply); if (Msg.Original) - snprintf(Buf2, 35, " \"-\" %s %lu", (char *)Language(212), Msg.Original); + snprintf(Buf2, 35, " \"-\" %s %u", (char *)Language(212), Msg.Original); snprintf(Buf3, 35, "%s%s ", Buf1, Buf2); snprintf(temp, 81, "%78s ", Buf3); pout(YELLOW, BLUE, temp); @@ -170,7 +170,7 @@ void ShowEmailHdr(void) /* * Export a email to file in the users home directory. */ -int Export_a_Email(unsigned long Num) +int Export_a_Email(unsigned int Num) { char *p, temp[21]; @@ -211,7 +211,7 @@ int Export_a_Email(unsigned long Num) * written in M$DOS format. */ p = calloc(PATH_MAX, sizeof(char)); - snprintf(p, PATH_MAX, "%s/%s/wrk/%s_%lu.msg", CFG.bbs_usersdir, exitinfo.Name, sMailbox, Num); + snprintf(p, PATH_MAX, "%s/%s/wrk/%s_%u.msg", CFG.bbs_usersdir, exitinfo.Name, sMailbox, Num); if ((qf = fopen(p, "w")) != NULL) { free(p); p = NULL; @@ -240,7 +240,7 @@ int Export_a_Email(unsigned long Num) */ Enter(2); pout(CFG.TextColourF, CFG.TextColourB, (char *) Language(46)); - snprintf(temp, 21, "%s_%lu.msg", sMailbox, Num); + snprintf(temp, 21, "%s_%u.msg", sMailbox, Num); pout(CFG.HiliteF, CFG.HiliteB, temp); Enter(2); Pause(); @@ -256,8 +256,8 @@ int Save_Email(int IsReply) { int i; char *p, *temp; - unsigned long crc = -1; - long id; + unsigned int crc = -1; + int id; FILE *fp; if (Line < 2) @@ -298,7 +298,7 @@ int Save_Email(int IsReply) MsgText_Add2(temp); p = calloc(81, sizeof(char)); id = sequencer(); - snprintf(p, 81, "<%08lx@%s>", id, CFG.sysdomain); + snprintf(p, 81, "<%08x@%s>", id, CFG.sysdomain); snprintf(temp, PATH_MAX, "\001Message-id: %s", p); MsgText_Add2(temp); Msg.MsgIdCRC = upd_crc32(temp, crc, strlen(temp)); @@ -352,7 +352,7 @@ int Save_Email(int IsReply) Enter(1); /* Saving message to disk */ - snprintf(temp, 81, "%s(%ld)", (char *) Language(202), Msg.Id); + snprintf(temp, 81, "%s(%d)", (char *) Language(202), Msg.Id); pout(CFG.HiliteF, CFG.HiliteB, temp); Enter(2); sleep(2); @@ -362,7 +362,7 @@ int Save_Email(int IsReply) */ snprintf(temp, PATH_MAX, "%s/tmp/netmail.jam", getenv("MBSE_ROOT")); if ((fp = fopen(temp, "a")) != NULL) { - fprintf(fp, "%s/%s/mailbox %lu\n", CFG.bbs_usersdir, exitinfo.Name, Msg.Id); + fprintf(fp, "%s/%s/mailbox %u\n", CFG.bbs_usersdir, exitinfo.Name, Msg.Id); fclose(fp); } @@ -374,7 +374,7 @@ int Save_Email(int IsReply) -int Read_a_Email(unsigned long Num) +int Read_a_Email(unsigned int Num) { char *p = NULL, *fn; lastread LR; @@ -602,7 +602,7 @@ int EmailPanel(void) void Read_Email(void) { char *temp; - unsigned long Start; + unsigned int Start; lastread LR; if (HasNoEmail()) @@ -611,7 +611,7 @@ void Read_Email(void) Enter(1); temp = calloc(128, sizeof(char)); /* Message area \"%s\" contains %lu messages. */ - snprintf(temp, 128, "\n%s\"%s\" %s%lu %s", (char *) Language(221), sMailbox, (char *) Language(222), + snprintf(temp, 128, "\n%s\"%s\" %s%u %s", (char *) Language(221), sMailbox, (char *) Language(222), EmailBase.Total, (char *) Language(223)); pout(CFG.TextColourF, CFG.TextColourB, temp); @@ -637,11 +637,11 @@ void Read_Email(void) Enter(1); /* Please enter a message between */ - snprintf(temp, 81, "%s(%lu - %lu)", (char *) Language(224), EmailBase.Lowest, EmailBase.Highest); + snprintf(temp, 81, "%s(%u - %u)", (char *) Language(224), EmailBase.Lowest, EmailBase.Highest); pout(WHITE, BLACK, temp); Enter(1); /* Message number [ */ - snprintf(temp, 81, "%s%lu]: ", (char *) Language(225), Start); + snprintf(temp, 81, "%s%u]: ", (char *) Language(225), Start); PUTSTR(temp); colour(CFG.InputColourF, CFG.InputColourB); @@ -692,7 +692,7 @@ void Reply_Email(int IsReply) clear(); snprintf(temp, 81, " %-70s", sMailbox); pout(BLUE, LIGHTGRAY, temp); - snprintf(temp, 81, "#%-5lu", EmailBase.Highest + 1); + snprintf(temp, 81, "#%-5u", EmailBase.Highest + 1); pout(RED, LIGHTGRAY, temp); Enter(1); @@ -917,7 +917,7 @@ void Write_Email(void) void QuickScan_Email(void) { int FoundMsg = FALSE; - long i; + int i; char temp[81]; iLineCount = 2; @@ -940,7 +940,7 @@ void QuickScan_Email(void) for (i = EmailBase.Lowest; i <= EmailBase.Highest; i++) { if (Msg_ReadHeader(i)) { - snprintf(temp, 81, "%-6lu", Msg.Id); + snprintf(temp, 81, "%-6u", Msg.Id); pout(WHITE, BLACK, temp); snprintf(temp, 81, "%s ", padleft(Msg.From, 20, ' ')); pout(CYAN, BLACK, temp); diff --git a/mbsebbs/email.h b/mbsebbs/email.h index 6921ba48..d9ff0b73 100644 --- a/mbsebbs/email.h +++ b/mbsebbs/email.h @@ -4,7 +4,7 @@ /* $Id$ */ void ShowEmailHdr(void); -int Read_a_Email(unsigned long); +int Read_a_Email(unsigned int); void Read_Email(void); void Write_Email(void); void Reply_Email(int); diff --git a/mbsebbs/exitinfo.c b/mbsebbs/exitinfo.c index 95de8338..cc6d881f 100644 --- a/mbsebbs/exitinfo.c +++ b/mbsebbs/exitinfo.c @@ -51,7 +51,7 @@ int InitExitinfo() { FILE *pUsrConfig, *pExitinfo; char *temp; - long offset; + int offset; temp = calloc(PATH_MAX, sizeof(char)); snprintf(temp, PATH_MAX, "%s/etc/users.data", getenv("MBSE_ROOT")); diff --git a/mbsebbs/file.c b/mbsebbs/file.c index ac7bbffa..9bf36087 100644 --- a/mbsebbs/file.c +++ b/mbsebbs/file.c @@ -51,7 +51,7 @@ -extern long arecno; /* File area number in xxxScan() functions */ +extern int arecno; /* File area number in xxxScan() functions */ int Strlen = 0; int FileRecno = 0; extern int rows; @@ -134,7 +134,7 @@ void File_List() if (fdb.Deleted) { /* D E L E T E D */ /* Uploaded by: */ - snprintf(temp, 81, " -- %-12s %s [%4ld] %s%s\n", fdb.Name, (char *) Language(239), + snprintf(temp, 81, " -- %-12s %s [%4d] %s%s\n", fdb.Name, (char *) Language(239), fdb.TimesDL, (char *) Language(238), fdb.Uploader); PUTSTR(temp); } @@ -166,7 +166,7 @@ void Download(void) FILE *tf, *fd; int rc = 0, i, Count = 0, OldArea; char *local, *temp; - long Size = 0, CostSize = 0, dsize; + int Size = 0, CostSize = 0, dsize; struct _fdbarea *fdb_area = NULL; down_list *dl = NULL, *tmpf; @@ -233,7 +233,7 @@ void Download(void) * can unlink it aftwerwards. We also insert CR * characters to please the poor DOS (M$oft) users. */ - snprintf(local, PATH_MAX, "./tag/filedesc.%ld", exitinfo.Downloads % 256); + snprintf(local, PATH_MAX, "./tag/filedesc.%d", exitinfo.Downloads % 256); if ((fd = fopen(local, "a")) != NULL) { fprintf(fd, "%s (%s)\r\n", fdb.LName, fdb.Name); for (i = 0; i < 25; i++) { @@ -294,14 +294,14 @@ void Download(void) /* * Add descriptions file to the queue. */ - snprintf(local, PATH_MAX, "%s/%s/tag/filedesc.%ld", CFG.bbs_usersdir, exitinfo.Name, exitinfo.Downloads % 256); + snprintf(local, PATH_MAX, "%s/%s/tag/filedesc.%d", CFG.bbs_usersdir, exitinfo.Name, exitinfo.Downloads % 256); dsize = file_size(local); - snprintf(temp, PATH_MAX, "filedesc.%ld", exitinfo.Downloads % 256); + snprintf(temp, PATH_MAX, "filedesc.%d", exitinfo.Downloads % 256); add_download(&dl, local, temp, 0, dsize, TRUE); free(local); /* You have */ /* files( */ /* bytes) marked for download */ - snprintf(temp, PATH_MAX, "%s %d %s%ld %s", (char *) Language(249), Count, (char *) Language(280), Size, (char *) Language(281)); + snprintf(temp, PATH_MAX, "%s %d %s%d %s", (char *) Language(249), Count, (char *) Language(280), Size, (char *) Language(281)); pout(YELLOW, BLACK, temp); Enter(2); @@ -452,7 +452,7 @@ void File_RawDir(char *OpData) snprintf(temp2, 81, "%-54s " , dp->d_name); pout(YELLOW, BLACK, temp2); - snprintf(temp2, 81, "%-12ld", (long)(statfile.st_size)); + snprintf(temp2, 81, "%-12d", (int)(statfile.st_size)); pout(LIGHTMAGENTA, BLACK, temp2); snprintf(temp2, 81, "%-10s", StrDateDMY(statfile.st_mtime)); @@ -494,7 +494,7 @@ int KeywordScan() int i, z, y, Found, Count = 0; char *Name, *tmpname, *BigDesc, temp[81]; _Tag T; - unsigned long OldArea; + unsigned int OldArea; struct _fdbarea *fdb_area = NULL; Name = calloc(81, sizeof(char)); @@ -625,7 +625,7 @@ int FilenameScan() char mask[256]; char *Name; _Tag T; - unsigned long OldArea; + unsigned int OldArea; struct _fdbarea *fdb_area = NULL; Name = calloc(81, sizeof(char)); @@ -733,7 +733,7 @@ int FilenameScan() int NewfileScan(int AskStart) { FILE *pAreas; - long ifDate, itDate; + int ifDate, itDate; char *temp, *Date; int Found, Count = 0; _Tag T; @@ -884,7 +884,7 @@ int NewfileScan(int AskStart) int Upload() { int Area, rc; - unsigned long OldArea; + unsigned int OldArea; char *arc, *temp; up_list *up = NULL, *tmpf; @@ -990,7 +990,7 @@ int Upload() int DownloadDirect(char *Name, int Wait) { int rc = 0; - long Size; + int Size; down_list *dl = NULL; if ((Size = file_size(Name)) == -1) { @@ -1075,7 +1075,7 @@ void List_Home() iBytes += statfile.st_size; snprintf(temp, 81, "%-20s", dp->d_name); pout(YELLOW, BLACK, temp); - snprintf(temp, 81, "%-12ld", (long)(statfile.st_size)); + snprintf(temp, 81, "%-12d", (int)(statfile.st_size)); pout(LIGHTMAGENTA, BLACK, temp); snprintf(temp, 81, "%s ", StrDateDMY(statfile.st_mtime)); pout(LIGHTGREEN, BLACK, temp); @@ -1336,7 +1336,7 @@ void FileArea_List(char *Option) FILE *pAreas; int iAreaCount = 6, Recno = 1, iOldArea, iAreaNum = 0; int iGotArea = FALSE; /* Flag to check if user typed in area */ - long offset; + int offset; char *temp; /* @@ -1688,7 +1688,7 @@ void EditTaglist() pout(Fg, BLACK, temp); Fg--; - snprintf(temp, 81, "%5ld ", Tag.Area); + snprintf(temp, 81, "%5d ", Tag.Area); pout(Fg, BLACK, temp); Fg--; @@ -1705,7 +1705,7 @@ void EditTaglist() pout(Fg, BLACK, temp); Fg--; - snprintf(temp, 81, " %8ld", (long)(Tag.Size)); + snprintf(temp, 81, " %8d", (int)(Tag.Size)); pout(Fg, BLACK, temp); Fg--; diff --git a/mbsebbs/file.h b/mbsebbs/file.h index f4d1ef69..ab10a403 100644 --- a/mbsebbs/file.h +++ b/mbsebbs/file.h @@ -12,7 +12,7 @@ int FilenameScan(void); /* Search a file on filenames */ int NewfileScan(int); /* Scan for new files */ int Upload(void); /* Upload a file. */ void FileArea_List(char *); /* Select file area */ -void SetFileArea(unsigned long);/* Select new area and load globals */ +void SetFileArea(unsigned int); /* Select new area and load globals */ void EditTaglist(void); /* Edit download taglist */ void List_Home(void); /* List users home directory */ void Delete_Home(void); /* Delete file from home directory */ diff --git a/mbsebbs/filesub.c b/mbsebbs/filesub.c index c9f3ba25..76a3a721 100644 --- a/mbsebbs/filesub.c +++ b/mbsebbs/filesub.c @@ -46,7 +46,7 @@ extern pid_t mypid; -long arecno = 1; /* Area record number */ +int arecno = 1; /* Area record number */ int Hcolor = 9; /* Color of area line in xxxScan() functions */ extern int rows; @@ -185,7 +185,7 @@ void Sheader() char temp[81]; PUTCHAR('\r'); - snprintf(temp, 81, " %-4ld", arecno); + snprintf(temp, 81, " %-4d", arecno); pout(Hcolor, BLACK, temp); pout(LIGHTBLUE, BLACK, (char *)" ... "); @@ -361,13 +361,13 @@ int ShowOneFile() snprintf(temp, 81, "%-12s", fdb.Name); pout(CFG.FilenameF, CFG.FilenameB, temp); - snprintf(temp, 81, "%10lu ", (long)(fdb.Size)); + snprintf(temp, 81, "%10u ", (int)(fdb.Size)); pout(CFG.FilesizeF, CFG.FilesizeB, temp); snprintf(temp, 81, "%-10s ", StrDateDMY(fdb.UploadDate)); pout(CFG.FiledateF, CFG.FiledateB, temp); - snprintf(temp, 81, "[%4ld] ", fdb.TimesDL); + snprintf(temp, 81, "[%4d] ", fdb.TimesDL); pout(LIGHTRED, BLACK, temp); if ((strcmp(fdb.Uploader, "")) == 0) @@ -409,7 +409,7 @@ int ShowOneFile() -int CheckBytesAvailable(long CostSize) +int CheckBytesAvailable(int CostSize) { char temp[81]; @@ -426,7 +426,7 @@ int CheckBytesAvailable(long CostSize) Enter(2); /* Kilobytes currently available: */ - snprintf(temp, 81, "%s%lu Kbytes.", (char *) Language(254), exitinfo.DownloadKToday); + snprintf(temp, 81, "%s%u Kbytes.", (char *) Language(254), exitinfo.DownloadKToday); pout(YELLOW, BLACK, temp); Enter(2); @@ -787,7 +787,7 @@ int ImportFile(char *fn, int Area, int fileid, off_t Size) exitinfo.UploadKToday += (Size / 1024); Syslog('b', "Uploads %d, Kb %d, Kb today %d", exitinfo.Uploads, exitinfo.UploadK, exitinfo.UploadKToday); /* You have */ /* extra download KBytes. */ - snprintf(msg, 81, "%s %ld %s", (char *) Language(249), (long)(Size / 1024), (char *) Language(250)); + snprintf(msg, 81, "%s %d %s", (char *) Language(249), (int)(Size / 1024), (char *) Language(250)); PUTSTR(msg); Enter(1); @@ -856,7 +856,7 @@ int Addfile(char *File, int AreaNum, int fileid) strcpy(temp1, File); name_mangle(temp1); strncpy(fdb.Name, temp1, 12); /* 8.3 name */ - fdb.Size = (long)(statfile.st_size); + fdb.Size = (int)(statfile.st_size); fdb.FileDate = statfile.st_mtime; fdb.Crc32 = file_crc(Filename, TRUE); strncpy(fdb.Uploader, exitinfo.sUserName, 35); @@ -1026,7 +1026,7 @@ int Addfile(char *File, int AreaNum, int fileid) fprintf(pPrivate, "****************************************************"); fprintf(pPrivate, "\nUser : %s", fdb.Uploader); fprintf(pPrivate, "\nFile : %s (%s)", fdb.LName, fdb.Name); - fprintf(pPrivate, "\nSize : %lu", (long)(fdb.Size)); + fprintf(pPrivate, "\nSize : %u", (int)(fdb.Size)); fprintf(pPrivate, "\nUpload Date : %s\n\n", StrDateDMY(fdb.UploadDate)); for (i = 0; i < iDesc - 1; i++) @@ -1051,10 +1051,10 @@ int Addfile(char *File, int AreaNum, int fileid) /* * Set file area number, set global area description and path. */ -void SetFileArea(unsigned long AreaNum) +void SetFileArea(unsigned int AreaNum) { FILE *pArea; - long offset; + int offset; memset(&area, 0, sizeof(area)); @@ -1079,11 +1079,11 @@ void SetFileArea(unsigned long AreaNum) /* * Return size in bytes of all files in the users wrk directory. */ -unsigned long Quota() +unsigned int Quota() { DIR *dirp; char *FileName, *temp; - unsigned long Bytes = 0; + unsigned int Bytes = 0; struct dirent *dp; struct stat statfile; diff --git a/mbsebbs/filesub.h b/mbsebbs/filesub.h index 32ce1d84..e0bae319 100644 --- a/mbsebbs/filesub.h +++ b/mbsebbs/filesub.h @@ -4,7 +4,7 @@ /* $Id$ */ FILE *OpenFareas(int); -int CheckBytesAvailable(long); +int CheckBytesAvailable(int); int iLC(int); void Header(void); void Sheader(void); @@ -21,7 +21,7 @@ void Home(void); int ScanDirect(char *); int ScanArchive(char *, char *); int ImportFile(char *, int, int, off_t); -unsigned long Quota(void); +unsigned int Quota(void); void ImportHome(char *); #endif diff --git a/mbsebbs/input.c b/mbsebbs/input.c index 01af34b3..67312fed 100644 --- a/mbsebbs/input.c +++ b/mbsebbs/input.c @@ -203,7 +203,7 @@ unsigned char Readkey(void) /* * Read the (locked) speed from the tty */ -long Speed(void) +int Speed(void) { speed_t mspeed; diff --git a/mbsebbs/input.h b/mbsebbs/input.h index 7f75252f..9f60ef15 100644 --- a/mbsebbs/input.h +++ b/mbsebbs/input.h @@ -5,7 +5,7 @@ void CheckScreen(void); /* Detect screensize changes */ -long Speed(void); /* Get (locked) tty speed */ +int Speed(void); /* Get (locked) tty speed */ int Waitchar(unsigned char *, int); /* Wait n* 10mSec for char */ int Escapechar(unsigned char *); /* Escape sequence test */ unsigned char Readkey(void); /* Read a translated key */ diff --git a/mbsebbs/mail.c b/mbsebbs/mail.c index a27cfb2b..5fb19a1f 100644 --- a/mbsebbs/mail.c +++ b/mbsebbs/mail.c @@ -67,7 +67,7 @@ /* * Global variables */ -unsigned long LastNum; /* Last read message number */ +unsigned int LastNum; /* Last read message number */ int Kludges = FALSE; /* Show kludges or not */ int Line = 1; /* Line counter in editor */ char *Message[TEXTBUFSIZE +1];/* Message compose text buffer */ @@ -81,13 +81,13 @@ extern int rows; * Internal prototypes */ void ShowMsgHdr(int Conv); /* Show message header */ -int Read_a_Msg(unsigned long Num, int);/* Read a message */ -int Export_a_Msg(unsigned long Num);/* Export message to homedir */ +int Read_a_Msg(unsigned int Num, int);/* Read a message */ +int Export_a_Msg(unsigned int Num);/* Export message to homedir */ int ReadPanel(void); /* Read panel bar */ int Save_Msg(int, faddr *); /* Save a message */ int Save_CC(int, char *); /* Save carbon copy */ void Reply_Msg(int); /* Reply to message */ -void Delete_MsgNum(unsigned long); /* Delete specified message */ +void Delete_MsgNum(unsigned int); /* Delete specified message */ int CheckUser(char *); /* Check if user exists */ int IsMe(char *); /* Test if this is my userrecord */ @@ -345,7 +345,7 @@ void Check_Attach(void) */ void SysopComment(char *Cmt) { - unsigned long tmp; + unsigned int tmp; char *temp; FILE *fp; @@ -821,7 +821,7 @@ int Save_Msg(int IsReply, faddr *Dest) Msg_AddMsg(); Msg_UnLock(); - snprintf(temp, 81, " (%ld)", Msg.Id); + snprintf(temp, 81, " (%d)", Msg.Id); PUTSTR(temp); Enter(1); @@ -831,7 +831,7 @@ int Save_Msg(int IsReply, faddr *Dest) LC_Wrote = TRUE; - Syslog('+', "Msg (%ld) to \"%s\", \"%s\", in %ld", Msg.Id, Msg.To, Msg.Subject, iMsgAreaNumber + 1); + Syslog('+', "Msg (%ld) to \"%s\", \"%s\", in %d", Msg.Id, Msg.To, Msg.Subject, iMsgAreaNumber + 1); msgs.LastPosted = time(NULL); msgs.Posted.total++; @@ -878,7 +878,7 @@ int Save_Msg(int IsReply, faddr *Dest) snprintf(temp, PATH_MAX, "%s/tmp/%smail.jam", getenv("MBSE_ROOT"), ((msgs.Type == ECHOMAIL) || (msgs.Type == LIST))? "echo" : "net"); if ((fp = fopen(temp, "a")) != NULL) { - fprintf(fp, "%s %lu\n", msgs.Base, Msg.Id); + fprintf(fp, "%s %u\n", msgs.Base, Msg.Id); fclose(fp); } } @@ -910,7 +910,7 @@ void ShowMsgHdr(int Conv) snprintf(msg, 81, " %-70s", sMsgAreaDesc); pout(BLUE, LIGHTGRAY, msg); - snprintf(msg, 81,"#%-5lu", Msg.Id); + snprintf(msg, 81,"#%-5u", Msg.Id); pout(RED, LIGHTGRAY, msg); Enter(1); @@ -1005,9 +1005,9 @@ void ShowMsgHdr(int Conv) colour(CFG.HiliteF, CFG.HiliteB); colour(YELLOW, BLUE); if (Msg.Reply) - snprintf(Buf1, 35, "\"+\" %s %lu", (char *)Language(211), Msg.Reply); + snprintf(Buf1, 35, "\"+\" %s %u", (char *)Language(211), Msg.Reply); if (Msg.Original) - snprintf(Buf2, 35, " \"-\" %s %lu", (char *)Language(212), Msg.Original); + snprintf(Buf2, 35, " \"-\" %s %u", (char *)Language(212), Msg.Original); snprintf(Buf3, 35, "%s%s ", Buf1, Buf2); snprintf(msg, 81, "%77s ", Buf3); pout(YELLOW, BLUE, msg); @@ -1019,7 +1019,7 @@ void ShowMsgHdr(int Conv) /* * Export a message to file in the users home directory or to the rules directory. */ -int Export_a_Msg(unsigned long Num) +int Export_a_Msg(unsigned int Num) { char *p, msg[81]; int ShowMsg = TRUE, z, homedir = TRUE; @@ -1108,7 +1108,7 @@ int Export_a_Msg(unsigned long Num) */ p = calloc(PATH_MAX, sizeof(char)); if (homedir) - snprintf(p, PATH_MAX, "%s/%s/wrk/%d_%lu.msg", CFG.bbs_usersdir, exitinfo.Name, iMsgAreaNumber + 1, Num); + snprintf(p, PATH_MAX, "%s/%s/wrk/%d_%u.msg", CFG.bbs_usersdir, exitinfo.Name, iMsgAreaNumber + 1, Num); else snprintf(p, PATH_MAX, "%s/%s", CFG.rulesdir, msgs.Tag); @@ -1151,7 +1151,7 @@ int Export_a_Msg(unsigned long Num) if (homedir) { /* Message exported to your private directory as: */ pout(CFG.TextColourF, CFG.TextColourB, (char *) Language(46)); - snprintf(msg, 81, "%d_%lu.msg", iMsgAreaNumber + 1, Num); + snprintf(msg, 81, "%d_%u.msg", iMsgAreaNumber + 1, Num); pout(CFG.HiliteF, CFG.HiliteB, msg); } else { /* Message exported to rules directory as */ @@ -1169,7 +1169,7 @@ int Export_a_Msg(unsigned long Num) * Read a message on screen. Update the lastread pointers, * except while scanning and reading new mail at logon. */ -int Read_a_Msg(unsigned long Num, int UpdateLR) +int Read_a_Msg(unsigned int Num, int UpdateLR) { char *p = NULL, *fn, *charset = NULL, *charsin = NULL, *charsout = NULL; int i, ShowMsg = TRUE, UseIconv = FALSE; @@ -1380,13 +1380,13 @@ int Read_a_Msg(unsigned long Num, int UpdateLR) void Read_Msgs() { char *temp; - unsigned long Start; + unsigned int Start; lastread LR; temp = calloc(81, sizeof(char)); Enter(1); /* Message area \"%s\" contains %lu messages. */ - snprintf(temp, 81, "%s\"%s\" %s%lu %s", (char *) Language(221), sMsgAreaDesc, + snprintf(temp, 81, "%s\"%s\" %s%u %s", (char *) Language(221), sMsgAreaDesc, (char *) Language(222), MsgBase.Total, (char *) Language(223)); pout(CFG.TextColourF, CFG.TextColourB, temp); @@ -1412,11 +1412,11 @@ void Read_Msgs() Enter(1); /* Please enter a message between */ - snprintf(temp, 81, "%s(%lu - %lu)", (char *) Language(224), MsgBase.Lowest, MsgBase.Highest); + snprintf(temp, 81, "%s(%u - %u)", (char *) Language(224), MsgBase.Lowest, MsgBase.Highest); pout(WHITE, BLACK, temp); Enter(1); /* Message number [ */ - snprintf(temp, 81, "%s%lu]: ", (char *) Language(225), Start); + snprintf(temp, 81, "%s%u]: ", (char *) Language(225), Start); PUTSTR(temp); colour(CFG.InputColourF, CFG.InputColourB); @@ -1584,7 +1584,7 @@ void Reply_Msg(int IsReply) clear(); snprintf(msg, 81, " %-71s", sMsgAreaDesc); pout(BLUE, LIGHTGRAY, msg); - snprintf(msg, 81, "#%-5lu", MsgBase.Highest + 1); + snprintf(msg, 81, "#%-5u", MsgBase.Highest + 1); pout(RED, LIGHTGRAY, msg); Enter(1); @@ -1810,7 +1810,7 @@ int IsMe(char *Name) void QuickScan_Msgs() { int FoundMsg = FALSE; - long i; + int i; char msg[81]; iLineCount = 2; @@ -1834,7 +1834,7 @@ void QuickScan_Msgs() if (Msg_ReadHeader(i) && ((msgs.Type != NETMAIL) || ((msgs.Type == NETMAIL) && ((IsMe(Msg.From)) || (IsMe(Msg.To)))))) { - snprintf(msg, 81, "%-6lu", Msg.Id); + snprintf(msg, 81, "%-6u", Msg.Id); pout(WHITE, BLACK, msg); snprintf(msg, 81, "%s ", padleft(Msg.From, 20, ' ')); if (IsMe(Msg.From)) @@ -1878,7 +1878,7 @@ void QuickScan_Msgs() void Delete_Msg() { char *temp; - unsigned long Msgnum = 0L; + unsigned int Msgnum = 0L; WhosDoingWhat(READ_POST, NULL); @@ -1897,13 +1897,13 @@ void Delete_Msg() temp = calloc(81, sizeof(char)); Enter(1); /* Message area \"%s\" contains %lu messages. */ - snprintf(temp, 81, "%s\"%s\" %s%lu %s", (char *) Language(221), sMsgAreaDesc, + snprintf(temp, 81, "%s\"%s\" %s%u %s", (char *) Language(221), sMsgAreaDesc, (char *) Language(222), MsgBase.Total, (char *) Language(223)); pout(CFG.TextColourF, CFG.TextColourB, temp); Enter(1); /* Please enter a message between */ - snprintf(temp, 81, "%s(%lu - %lu): ", (char *) Language(224), MsgBase.Lowest, MsgBase.Highest); + snprintf(temp, 81, "%s(%u - %u): ", (char *) Language(224), MsgBase.Lowest, MsgBase.Highest); pout(WHITE, BLACK, temp); colour(CFG.InputColourF, CFG.InputColourB); @@ -1993,7 +1993,7 @@ void MsgArea_List(char *Option) int iAreaCount = 6, Recno = 0, iOldArea = 0, iAreaNum = 0, loopcount = 0; int iGotArea = FALSE; /* Flag to check if user typed in area */ int iCheckNew = FALSE; /* Flag to check for new mail in area */ - long offset; + int offset; char *temp, msg[81]; lastread LR; @@ -2319,7 +2319,7 @@ void MsgArea_List(char *Option) -void Delete_MsgNum(unsigned long MsgNum) +void Delete_MsgNum(unsigned int MsgNum) { int Result = FALSE; @@ -2351,8 +2351,8 @@ int CheckUser(char *To) FILE *pUsrConfig; int Found = FALSE; char *temp; - long offset; - unsigned long Crc; + int offset; + unsigned int Crc; temp = calloc(PATH_MAX, sizeof(char)); snprintf(temp, PATH_MAX, "%s/etc/users.data", getenv("MBSE_ROOT")); @@ -2399,10 +2399,10 @@ void CheckMail() FILE *pMsgArea, *Tmp; int x, Found = 0, Color, Count = 0, Reading, OldMsgArea; char *temp, *sFileName, msg[81]; - unsigned long i, Start; + unsigned int i, Start; typedef struct _Mailrec { - long Area; - unsigned long Msg; + int Area; + unsigned int Msg; } _Mail; _Mail Mail; lastread LR; @@ -2634,7 +2634,7 @@ void MailStatus() int OldMsgArea; char temp[81], msg[81]; char *sFileName; - unsigned long i; + unsigned int i; sFileName = calloc(PATH_MAX, sizeof(char)); OldMsgArea = iMsgAreaNumber; @@ -2661,12 +2661,12 @@ void MailStatus() snprintf(msg, 81, " %-40s", Language(467 + i)); pout(LIGHTCYAN, BLACK, msg); if (EmailBase.Highest) - snprintf(msg, 81, " %8lu", EmailBase.Highest - EmailBase.Lowest + 1); + snprintf(msg, 81, " %8u", EmailBase.Highest - EmailBase.Lowest + 1); else snprintf(msg, 81, " 0"); pout(YELLOW, BLACK, msg); if (EmailBase.Highest) - snprintf(msg, 81, " %8lu", EmailBase.Highest - EmailBase.Lowest + 1); + snprintf(msg, 81, " %8u", EmailBase.Highest - EmailBase.Lowest + 1); else snprintf(msg, 81, " 0"); pout(LIGHTBLUE, BLACK, msg); @@ -2724,7 +2724,7 @@ void MailStatus() } else WriteError("Error open JAM %s", sMsgAreaBase); if (MsgBase.Highest) - snprintf(msg, 81, " %8lu", MsgBase.Highest - MsgBase.Lowest + 1); + snprintf(msg, 81, " %8u", MsgBase.Highest - MsgBase.Lowest + 1); else snprintf(msg, 81, " 0"); pout(YELLOW, BLACK, msg); @@ -2748,10 +2748,10 @@ void MailStatus() /* * Set message area number, set global area description and JAM path */ -void SetMsgArea(unsigned long AreaNum) +void SetMsgArea(unsigned int AreaNum) { FILE *pMsgArea; - long offset; + int offset; char *sFileName; sFileName = calloc(PATH_MAX, sizeof(char)); diff --git a/mbsebbs/mail.h b/mbsebbs/mail.h index 7047df07..b98d1adf 100644 --- a/mbsebbs/mail.h +++ b/mbsebbs/mail.h @@ -18,7 +18,7 @@ void Delete_Msg(void); /* Delete a specified message */ void MsgArea_List(char *); /* Select message area */ void CheckMail(void); /* Check for new mail */ void MailStatus(void); /* Mail status in areas */ -void SetMsgArea(unsigned long); /* Set message area and variables */ +void SetMsgArea(unsigned int); /* Set message area and variables */ #endif diff --git a/mbsebbs/msgutil.c b/mbsebbs/msgutil.c index c542f237..1b89c668 100644 --- a/mbsebbs/msgutil.c +++ b/mbsebbs/msgutil.c @@ -58,7 +58,7 @@ char *rfcdate(time_t now) struct tm ptm, gtm; char sign; int hr, min; - long offset; + int offset; if (!now) now = time(NULL); @@ -156,7 +156,7 @@ void Close_Msgbase(char *Base) void Add_Headkludges(faddr *dest, int IsReply) { char *temp; - unsigned long crc = -1; + unsigned int crc = -1; time_t tt; faddr *Node; @@ -231,7 +231,7 @@ void Add_Headkludges(faddr *dest, int IsReply) snprintf(temp, PATH_MAX, "\001CHRS: %s", getftnchrs(FTNC_LATIN_1)); } MsgText_Add2(temp); - snprintf(temp, PATH_MAX, "\001MSGID: %s %08lx", aka2str(msgs.Aka), sequencer()); + snprintf(temp, PATH_MAX, "\001MSGID: %s %08x", aka2str(msgs.Aka), sequencer()); MsgText_Add2(temp); Msg.MsgIdCRC = upd_crc32(temp, crc, strlen(temp)); diff --git a/mbsebbs/newuser.c b/mbsebbs/newuser.c index 7b9055d1..a5640e97 100644 --- a/mbsebbs/newuser.c +++ b/mbsebbs/newuser.c @@ -77,9 +77,9 @@ int newuser(void) { FILE *pUsrConfig; int i, x, Found, iLang, recno = 0, Count = 0, badname; - unsigned long crc; + unsigned int crc; char temp[PATH_MAX], *FullName, *temp1, *temp2, *Phone1, *Phone2; - long offset; + int offset; struct userrec us; IsDoing("New user login"); diff --git a/mbsebbs/offline.c b/mbsebbs/offline.c index 1b3bfd50..9f0ba966 100644 --- a/mbsebbs/offline.c +++ b/mbsebbs/offline.c @@ -54,8 +54,8 @@ -long Total, TotalPersonal, Current, Personal; -unsigned long TotalPack; +int Total, TotalPersonal, Current, Personal; +unsigned int TotalPack; unsigned short BarWidth; lastread LR; static char TempStr[128]; @@ -67,9 +67,9 @@ char *newtear = NULL; typedef struct _msg_high { struct _msg_high *next; - unsigned long Area; - unsigned long LastMsg; - unsigned long Personal; + unsigned int Area; + unsigned int LastMsg; + unsigned int Personal; } msg_high; @@ -79,19 +79,19 @@ typedef struct _msg_high { */ void AddArc(char *, char *); void tidy_high(msg_high **); -void fill_high(msg_high **, unsigned long, unsigned long, unsigned long); +void fill_high(msg_high **, unsigned int, unsigned int, unsigned int); void UpdateLR(msg_high *, FILE *); void Add_Kludges(fidoaddr, int, char *); int OLR_Prescan(void); void DrawBar(char *); -unsigned long BlueWave_PackArea(unsigned long, long); +unsigned int BlueWave_PackArea(unsigned int, int); void BlueWave_Fetch(void); -unsigned long QWK_PackArea(unsigned long, long); +unsigned int QWK_PackArea(unsigned int, int); void QWK_Fetch(void); float IEEToMSBIN(float); float MSBINToIEE(float); char *StripSpaces(char *, int); -unsigned long ASCII_PackArea(unsigned long, long); +unsigned int ASCII_PackArea(unsigned int, int); @@ -126,7 +126,7 @@ void tidy_high(msg_high **hdp) /* * Add an area to the array */ -void fill_high(msg_high **hdp, unsigned long Area, unsigned long Last, unsigned long Pers) +void fill_high(msg_high **hdp, unsigned int Area, unsigned int Last, unsigned int Pers) { msg_high *tmp; @@ -228,7 +228,7 @@ void OLR_TagArea() char *Msgname, *Tagname; FILE *ma, *tf; char *buf, msg[81]; - long total, Offset, Area; + int total, Offset, Area; int lines, input, ignore = FALSE, maxlines; WhosDoingWhat(OLR, NULL); @@ -271,7 +271,7 @@ void OLR_TagArea() if (msgs.Active && Access(exitinfo.Security, msgs.RDSec) && (!olrtagrec.Tagged) && strlen(msgs.QWKname)) { if ( (lines != 0) || (ignore) ) { lines--; - snprintf(msg, 81, "%-20.20s %-5ld %-5ld %s", msgs.QWKname, Area, total, msgs.Name); + snprintf(msg, 81, "%-20.20s %-5d %-5d %s", msgs.QWKname, Area, total, msgs.Name); poutCR(CYAN, BLACK, msg); } if (lines == 0) { @@ -368,7 +368,7 @@ void OLR_UntagArea() { char *Msgname, *Tagname, *buf, msg[81]; FILE *ma, *tf; - long total, Offset, Area; + int total, Offset, Area; int lines, input, ignore = FALSE, maxlines; WhosDoingWhat(OLR, NULL); @@ -411,7 +411,7 @@ void OLR_UntagArea() if (msgs.Active && Access(exitinfo.Security, msgs.RDSec) && olrtagrec.Tagged && strlen(msgs.QWKname)) { if ( (lines != 0) || (ignore) ) { lines--; - snprintf(msg, 81, "%-20.20s %-5ld %-5ld %s", msgs.QWKname, Area, total, msgs.Name); + snprintf(msg, 81, "%-20.20s %-5d %-5d %s", msgs.QWKname, Area, total, msgs.Name); poutCR(CYAN, BLACK, msg); } if (lines == 0) { @@ -530,13 +530,13 @@ void New_Hdr() -void New_Area(long); -void New_Area(long Area) +void New_Area(int); +void New_Area(int Area) { char msg[81]; /* New */ - snprintf(msg, 81, "%4ld %s", Area, (char *)Language(391)); + snprintf(msg, 81, "%4d %s", Area, (char *)Language(391)); pout(LIGHTCYAN, BLACK, msg); switch (msgs.Type) { @@ -556,13 +556,13 @@ void New_Area(long Area) -void Old_Area(long); -void Old_Area(long Area) +void Old_Area(int); +void Old_Area(int Area) { char msg[81]; /* Del */ - snprintf(msg, 81, "%4ld %s", Area, (char *)Language(397)); + snprintf(msg, 81, "%4d %s", Area, (char *)Language(397)); poutCR(LIGHTRED, BLACK, msg); } @@ -576,7 +576,7 @@ void OLR_SyncTags() { char *Tagname, *Msgname; FILE *fp, *ma; - long Area; + int Area; int Changed = FALSE; Tagname = calloc(PATH_MAX, sizeof(char)); @@ -716,7 +716,7 @@ void OLR_ViewTags() { char *Tagname, *Msgname, msg[81]; FILE *tf, *ma; - long total, Area = 0; + int total, Area = 0; int lines, input, ignore = FALSE, maxlines; WhosDoingWhat(OLR, NULL); @@ -764,7 +764,7 @@ void OLR_ViewTags() total = 0; if ( (lines != 0) || (ignore) ) { lines--; - snprintf(msg, 81, "%-20.20s %-5ld %-5ld %s", msgs.QWKname, Area, total, msgs.Name); + snprintf(msg, 81, "%-20.20s %-5d %-5d %s", msgs.QWKname, Area, total, msgs.Name); PUTSTR(msg); Enter(1); } @@ -806,7 +806,7 @@ void OLR_ViewTags() int OLR_Prescan() { unsigned short RetVal = FALSE, Areas; - unsigned long Number; + unsigned int Number; char *Temp, msg[81]; FILE *mf, *tf; int x; @@ -868,18 +868,18 @@ int OLR_Prescan() } while (Msg_Next(&Number)); } - snprintf(msg, 81, "%5lu %5lu", Current, Personal); + snprintf(msg, 81, "%5u %5u", Current, Personal); poutCR(LIGHTGREEN, BLACK, msg); Msg_Close(); } } } - Syslog('+', "OLR Prescan: %u Areas, %lu Messages", Areas, Total); + Syslog('+', "OLR Prescan: %u Areas, %u Messages", Areas, Total); Enter(1); /* Total messages found: */ - snprintf(msg, 81, "%s %lu", (char *)Language(338), Total); + snprintf(msg, 81, "%s %u", (char *)Language(338), Total); pout(LIGHTBLUE, BLACK, msg); Enter(2); @@ -1152,12 +1152,12 @@ void OLR_DownBW() struct tm *tp; time_t Now; char Pktname[32], *Work, *Temp; - long Area = 0; + int Area = 0; int RetVal = FALSE, rc = 0; FILE *fp, *tf, *mf, *af; INF_HEADER Inf; INF_AREA_INFO AreaInf; - unsigned long Start, High; + unsigned int Start, High; msg_high *mhl = NULL; if (strlen(CFG.bbsid) == 0) { @@ -1260,7 +1260,7 @@ void OLR_DownBW() if (msgs.Active && Access(exitinfo.Security, msgs.RDSec) && strlen(msgs.QWKname)) { memset(&AreaInf, 0, sizeof(AreaInf)); - snprintf((char *)AreaInf.areanum, 6, "%lu", Area); + snprintf((char *)AreaInf.areanum, 6, "%u", Area); strncpy((char *)AreaInf.echotag, msgs.QWKname, 21); strncpy((char *)AreaInf.title, msgs.Name, 50); if (olrtagrec.Tagged) { @@ -1566,7 +1566,7 @@ void BlueWave_Fetch() snprintf(temp, PATH_MAX, "%s/tmp/%smail.jam", getenv("MBSE_ROOT"), ((msgs.Type == ECHOMAIL) || (msgs.Type == LIST))? "echo" : "net"); if ((fp = fopen(temp, "a")) != NULL) { - fprintf(fp, "%s %lu\n", msgs.Base, Msg.Id); + fprintf(fp, "%s %u\n", msgs.Base, Msg.Id); fclose(fp); } } @@ -1792,11 +1792,11 @@ void BlueWave_Fetch() /* * Add one area to the BlueWave download packet */ -unsigned long BlueWave_PackArea(unsigned long ulLast, long Area) +unsigned int BlueWave_PackArea(unsigned int ulLast, int Area) { FILE *fdm, *fdfti, *fdmix; char *Temp, *Text, msg[81]; - unsigned long Number; + unsigned int Number; MIX_REC Mix; FTI_REC Fti; struct tm *tp; @@ -1815,7 +1815,7 @@ unsigned long BlueWave_PackArea(unsigned long ulLast, long Area) fdm = fopen(Temp, "a+"); memset(&Mix, 0, sizeof(MIX_REC)); - snprintf((char *)Mix.areanum, 6, "%lu", Area); + snprintf((char *)Mix.areanum, 6, "%u", Area); Mix.msghptr = ftell(fdfti); if ((fdfti != NULL) && (fdmix != NULL) && (fdm != NULL)) { @@ -1915,11 +1915,11 @@ void OLR_DownQWK(void) struct tm *tp; time_t Now; char Pktname[32]; - long Area = 0; + int Area = 0; char *Work, *Temp; int i, rc = 0; FILE *fp = NULL, *tf, *mf, *af; - unsigned long Start, High; + unsigned int Start, High; msg_high *tmp, *mhl = NULL; if (strlen(CFG.bbsid) == 0) { @@ -2017,7 +2017,7 @@ void OLR_DownQWK(void) fprintf(fp, "%s\n", tu(Temp)); fprintf(fp, " \n"); fprintf(fp, "0\n"); - fprintf(fp, "%lu\n", Total); + fprintf(fp, "%u\n", Total); /* * Count available areas. @@ -2096,7 +2096,7 @@ void OLR_DownQWK(void) AddArc(Temp, Pktname); for (tmp = mhl; tmp; tmp = tmp->next) { - snprintf(Temp, PATH_MAX, "%s/%03ld.NDX", Work, tmp->Area); + snprintf(Temp, PATH_MAX, "%s/%03d.NDX", Work, tmp->Area); AddArc(Temp, Pktname); } @@ -2150,7 +2150,7 @@ void QWK_Fetch() char *temp, *otemp, Temp[128], szLine[132], *pLine = NULL, *pBuff, Dirpath[PATH_MAX], Filename[81]; FILE *fp, *up = NULL, *op, *mf; unsigned short nRec, i, r, x, nCol = 0, nWidth, nReaded, nPosted = 0; - unsigned long Area; + unsigned int Area; struct tm *ltm = NULL; fidoaddr dest; int HasTear; @@ -2366,7 +2366,7 @@ void QWK_Fetch() snprintf(temp, PATH_MAX, "%s/tmp/%smail.jam", getenv("MBSE_ROOT"), ((msgs.Type == ECHOMAIL) || (msgs.Type == LIST))? "echo" : "net"); if ((fp = fopen(temp, "a")) != NULL) { - fprintf(fp, "%s %lu\n", msgs.Base, Msg.Id); + fprintf(fp, "%s %u\n", msgs.Base, Msg.Id); fclose(fp); } } @@ -2411,7 +2411,7 @@ void QWK_Fetch() union Converter { unsigned char uc[10]; unsigned short ui[5]; - unsigned long ul[2]; + unsigned int ul[2]; float f[2]; double d[1]; }; @@ -2450,12 +2450,12 @@ float MSBINToIEEE(float f) /* * Pack messages in one mail area */ -unsigned long QWK_PackArea(unsigned long ulLast, long Area) +unsigned int QWK_PackArea(unsigned int ulLast, int Area) { FILE *fdm, *fdi, *fdp; float out, in; char *Work, *Temp, *Text, msg[81]; - unsigned long Number, Pos, Size, Blocks; + unsigned int Number, Pos, Size, Blocks; int Pack = FALSE; struct tm *tp; @@ -2466,7 +2466,7 @@ unsigned long QWK_PackArea(unsigned long ulLast, long Area) Work = calloc(PATH_MAX, sizeof(char)); snprintf(Work, PATH_MAX, "%s/%s/tmp", CFG.bbs_usersdir, exitinfo.Name); - snprintf(Temp, PATH_MAX, "%s/%03ld.NDX", Work, Area); + snprintf(Temp, PATH_MAX, "%s/%03d.NDX", Work, Area); fdi = fopen(Temp, "a+"); snprintf(Temp, PATH_MAX, "%s/PERSONAL.NDX", Work); @@ -2522,7 +2522,7 @@ unsigned long QWK_PackArea(unsigned long ulLast, long Area) */ Pos = ftell(fdm); Blocks = (Pos / 128L) + 1L; - snprintf(Temp, 6, "%lu", Blocks); + snprintf(Temp, 6, "%u", Blocks); in = atof(Temp); out = IEEToMSBIN(in); fwrite(&out, sizeof(float), 1, fdi); @@ -2531,7 +2531,7 @@ unsigned long QWK_PackArea(unsigned long ulLast, long Area) Total++; memset(&Qwk, ' ', sizeof(Qwk)); - snprintf(Temp, 81, "%-*lu", (int)sizeof(Qwk.Msgnum), (long)Number); + snprintf(Temp, 81, "%-*u", (int)sizeof(Qwk.Msgnum), (int)Number); Syslog('M', "Message %s", Temp); memcpy(Qwk.Msgnum, Temp, sizeof(Qwk.Msgnum)); tp = localtime(&Msg.Written); @@ -2564,7 +2564,7 @@ unsigned long QWK_PackArea(unsigned long ulLast, long Area) Size += fwrite(Temp, (int)(128L - (Size % 128L)), 1, fdm); } - snprintf(Qwk.Msgrecs, 6, "%-*lu", (int)sizeof(Qwk.Msgrecs), (long)((ftell(fdm) - Pos) / 128L)); + snprintf(Qwk.Msgrecs, 6, "%-*u", (int)sizeof(Qwk.Msgrecs), (int)((ftell(fdm) - Pos) / 128L)); fseek(fdm, Pos, SEEK_SET); fwrite(&Qwk, sizeof(Qwk), 1, fdm); fseek(fdm, 0L, SEEK_END); @@ -2626,10 +2626,10 @@ void OLR_DownASCII(void) struct tm *tp; time_t Now; char Pktname[32], *Work, *Temp; - long Area = 0; + int Area = 0; int rc = 0; FILE *fp = NULL, *tf, *mf, *af; - unsigned long Start, High; + unsigned int Start, High; msg_high *tmp, *mhl = NULL; if (strlen(CFG.bbsid) == 0) { @@ -2722,7 +2722,7 @@ void OLR_DownASCII(void) alarm_on(); for (tmp = mhl; tmp; tmp = tmp->next) { - snprintf(Temp, PATH_MAX, "%s/%03ld.TXT", Work, tmp->Area); + snprintf(Temp, PATH_MAX, "%s/%03d.TXT", Work, tmp->Area); AddArc(Temp, Pktname); } snprintf(Temp, PATH_MAX, "%s/%s/%s", CFG.bbs_usersdir, exitinfo.Name, Pktname); @@ -2760,11 +2760,11 @@ void OLR_DownASCII(void) /* * Pack messages in one mail area */ -unsigned long ASCII_PackArea(unsigned long ulLast, long Area) +unsigned int ASCII_PackArea(unsigned int ulLast, int Area) { FILE *fp; char *Work, *Temp, *Text, msg[81]; - unsigned long Number; + unsigned int Number; int Pack = FALSE; struct tm *tp; @@ -2775,7 +2775,7 @@ unsigned long ASCII_PackArea(unsigned long ulLast, long Area) Work = calloc(PATH_MAX, sizeof(char)); snprintf(Work, PATH_MAX, "%s/%s/tmp", CFG.bbs_usersdir, exitinfo.Name); - snprintf(Temp, PATH_MAX, "%s/%03ld.TXT", Work, Area); + snprintf(Temp, PATH_MAX, "%s/%03d.TXT", Work, Area); if ((fp = fopen(Temp, "a+")) != NULL) { if (Msg_Next(&Number)) { do { @@ -2795,7 +2795,7 @@ unsigned long ASCII_PackArea(unsigned long ulLast, long Area) } if (Pack) { - fprintf (fp, "\n==============================================\n Msg. #%ld of %ld (%s)\n", + fprintf (fp, "\n==============================================\n Msg. #%d of %d (%s)\n", Number, Msg_Number(), msgs.Name); tp = localtime(&Msg.Written); fprintf (fp, " Date: %d %s %d %2d:%02d\n", tp->tm_mday, diff --git a/mbsebbs/oneline.c b/mbsebbs/oneline.c index 6dd40225..2975c3d9 100644 --- a/mbsebbs/oneline.c +++ b/mbsebbs/oneline.c @@ -188,7 +188,7 @@ char *Oneliner_Get() { FILE *pOneline; int i, j, in, id, recno = 0; - long offset; + int offset; int nrecno; char *sFileName; static char temp[81]; @@ -309,7 +309,7 @@ void Oneliner_Show() { FILE *pOneline; int recno = 0; - long offset; + int offset; char *sFileName, msg[81]; sFileName = calloc(PATH_MAX, sizeof(char)); @@ -355,7 +355,7 @@ void Oneliner_Delete() { FILE *pOneline; int recno = 0, nrecno = 0; - long offset; + int offset; char srecno[7], *sFileName, stemp[50], sUser[36], msg[81]; sFileName = calloc(PATH_MAX, sizeof(char)); diff --git a/mbsebbs/openport.c b/mbsebbs/openport.c index 84bba2d7..5f163d44 100644 --- a/mbsebbs/openport.c +++ b/mbsebbs/openport.c @@ -3,7 +3,7 @@ * $Id$ * ***************************************************************************** - * Copyright (C) 1997-2004 + * Copyright (C) 1997-2005 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -35,8 +35,8 @@ #ifdef USE_SGTTY # ifdef LLITOUT -long Locmode; /* Saved "local mode" for 4.x BSD "new driver" */ -long Locbit = LLITOUT; /* Bit SUPPOSED to disable output translations */ +int Locmode; /* Saved "local mode" for 4.x BSD "new driver" */ +int Locbit = LLITOUT; /* Bit SUPPOSED to disable output translations */ # endif #endif diff --git a/mbsebbs/pop3.c b/mbsebbs/pop3.c index c6ae19b6..6fcf4b35 100644 --- a/mbsebbs/pop3.c +++ b/mbsebbs/pop3.c @@ -55,7 +55,7 @@ void retr_msg(int msgnum) { char *p, *q, temp[PATH_MAX], *base; int Header; - unsigned long crc = -1; + unsigned int crc = -1; snprintf(temp, 81, "RETR %d\r\n", msgnum); if (pop3_cmd(temp) == 0) { diff --git a/mbsebbs/transfer.c b/mbsebbs/transfer.c index 66eb9eea..3fa1f9b7 100644 --- a/mbsebbs/transfer.c +++ b/mbsebbs/transfer.c @@ -75,7 +75,7 @@ int ForceProtocol() -void add_download(down_list **lst, char *local, char *remote, long Area, unsigned long size, int kfs) +void add_download(down_list **lst, char *local, char *remote, int Area, unsigned int size, int kfs) { down_list *tmp, *ta; int i; @@ -149,7 +149,7 @@ int download(down_list *download_list) down_list *tmpf; int err, maxrc = 0, Count = 0; char *temp, *symTo, *symFrom; - unsigned long Size = 0; + unsigned int Size = 0; struct dirent *dp; DIR *dirp; struct timeval starttime, endtime; @@ -225,7 +225,7 @@ int download(down_list *download_list) /* File(s) : */ pout(YELLOW, BLACK, (char *) Language(349)); snprintf(temp, PATH_MAX, "%d", Count); PUTSTR(temp); Enter(1); /* Size : */ - pout( CYAN, BLACK, (char *) Language(350)); snprintf(temp, PATH_MAX, "%lu", Size); PUTSTR(temp); Enter(1); + pout( CYAN, BLACK, (char *) Language(350)); snprintf(temp, PATH_MAX, "%u", Size); PUTSTR(temp); Enter(1); /* Protocol : */ pout( CYAN, BLACK, (char *) Language(351)); snprintf(temp, PATH_MAX, "%s", sProtName); PUTSTR(temp); Enter(1); @@ -341,7 +341,7 @@ int download(down_list *download_list) * Size of the File by the amount of time it took to download * the file. */ - Syslog('+', "Download %s in %d file(s)", transfertime(starttime, endtime, (unsigned long)Size, TRUE), Count); + Syslog('+', "Download %s in %d file(s)", transfertime(starttime, endtime, (unsigned int)Size, TRUE), Count); } free(symTo); @@ -390,7 +390,7 @@ int upload(up_list **upload_list) struct stat statfile; struct timeval starttime, endtime; struct timezone tz; - unsigned long Size = 0; + unsigned int Size = 0; int err, Count = 0, rc = 0, want1k = FALSE, wantg = FALSE; up_list *tmp, *ta; @@ -548,7 +548,7 @@ int upload(up_list **upload_list) } } closedir(dirp); - Syslog('+', "Upload %s in %d file(s)", transfertime(starttime, endtime, (unsigned long)Size, FALSE), Count); + Syslog('+', "Upload %s in %d file(s)", transfertime(starttime, endtime, (unsigned int)Size, FALSE), Count); } } free(temp); @@ -559,10 +559,10 @@ int upload(up_list **upload_list) -char *transfertime(struct timeval start, struct timeval end, long bytes, int sent) +char *transfertime(struct timeval start, struct timeval end, int bytes, int sent) { static char resp[81]; - double long startms, endms, elapsed; + double long startms, endms, elapsed; startms = (start.tv_sec * 1000) + (start.tv_usec / 1000); endms = (end.tv_sec * 1000) + (end.tv_usec / 1000); @@ -571,10 +571,10 @@ char *transfertime(struct timeval start, struct timeval end, long bytes, int sen if (!elapsed) elapsed = 1L; if (bytes > 1000000) - snprintf(resp, 81, "%ld bytes %s in %0.3Lf seconds (%0.3Lf Kb/s)", + snprintf(resp, 81, "%d bytes %s in %0.3Lf seconds (%0.3Lf Kb/s)", bytes, sent?"sent":"received", elapsed / 1000.000, ((bytes / elapsed) * 1000) / 1024); else - snprintf(resp, 81, "%ld bytes %s in %0.3Lf seconds (%0.3Lf Kb/s)", + snprintf(resp, 81, "%d bytes %s in %0.3Lf seconds (%0.3Lf Kb/s)", bytes, sent?"sent":"received", elapsed / 1000.000, ((bytes * 1000) / elapsed) / 1024); return resp; } diff --git a/mbsebbs/transfer.h b/mbsebbs/transfer.h index 9a4fc66c..8f8add7c 100644 --- a/mbsebbs/transfer.h +++ b/mbsebbs/transfer.h @@ -12,9 +12,9 @@ typedef struct _down_list { struct _down_list *next; char *local; /* Local filename */ char *remote; /* Remove filename */ - long cps; /* CPS after sent */ - long area; /* File area or 0 */ - unsigned long size; /* File size */ + int cps; /* CPS after sent */ + int area; /* File area or 0 */ + unsigned int size; /* File size */ unsigned kfs : 1; /* Kill File Sent */ unsigned sent : 1; /* File is Sent */ unsigned failed : 1; /* Transfer failed */ @@ -28,16 +28,16 @@ typedef struct _down_list { typedef struct _up_list { struct _up_list *next; char *filename; /* Filename */ - unsigned long size; /* Filesize */ + unsigned int size; /* Filesize */ } up_list; int ForceProtocol(void); -void add_download(down_list **, char *, char *, long, unsigned long, int); +void add_download(down_list **, char *, char *, int, unsigned int, int); void tidy_download(down_list **); int download(down_list *); void tidy_upload(up_list **); int upload(up_list **); -char *transfertime(struct timeval, struct timeval, long bytes, int); +char *transfertime(struct timeval, struct timeval, int bytes, int); #endif diff --git a/mbsebbs/user.c b/mbsebbs/user.c index fbeff3dc..e1ad1e3c 100644 --- a/mbsebbs/user.c +++ b/mbsebbs/user.c @@ -174,7 +174,7 @@ void user(void) { FILE *pUsrConfig, *pLimits; int i, x, FoundName = FALSE, iFoundLimit = FALSE, IsNew = FALSE, logins = 0, Start; - long l1, l2; + int l1, l2; char *token, temp[PATH_MAX], temp1[84], UserName[37], buf[128], *fullname; time_t LastLogin; struct stat st; diff --git a/mbsebbs/ymrecv.c b/mbsebbs/ymrecv.c index 841c7630..5f9573ae 100644 --- a/mbsebbs/ymrecv.c +++ b/mbsebbs/ymrecv.c @@ -4,7 +4,7 @@ * Purpose ...............: Ymodem receiver * ***************************************************************************** - * Copyright (C) 1997-2004 + * Copyright (C) 1997-2005 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -47,7 +47,7 @@ static int errors; static int Gflg = FALSE; static char NAKchar; -extern long Bytesleft; +extern int Bytesleft; extern off_t rxbytes; extern int Crcflg; extern char Lastrx; @@ -149,7 +149,7 @@ int wcrx(void) register int sectnum, sectcurr; register char sendchar; size_t Blklen; - long bytes_received = 0; + int bytes_received = 0; Firstsec = TRUE; sectnum = 0; eof_seen = FALSE; diff --git a/mbsebbs/ymsend.c b/mbsebbs/ymsend.c index f0eb8dea..74ff2ebd 100644 --- a/mbsebbs/ymsend.c +++ b/mbsebbs/ymsend.c @@ -49,8 +49,8 @@ char Crcflg; char Lastrx; int Fullname = 0; /* transmit full pathname */ int Filesleft; -long Totalleft; -long bytes_sent; +int Totalleft; +int bytes_sent; int firstsec; int Optiong; /* Let it rip no wait for sector ACK's */ int Totsecs; /* total number of sectors this file */ @@ -60,7 +60,7 @@ int zmodem_requested = FALSE; static int no_unixmode; struct timeval starttime, endtime; struct timezone tz; -long skipsize; +int skipsize; extern int Rxtimeout; @@ -68,7 +68,7 @@ extern int Rxtimeout; static int wctxpn(char *); static int getnak(void); -static int wctx(long); +static int wctx(int); static int wcputsec(char *, int, size_t); static size_t filbuf(char *, size_t); @@ -127,7 +127,7 @@ int ymsndfiles(down_list *lst, int use1k) tmpf->sent = TRUE; gettimeofday(&endtime, &tz); Syslog('+', "%s: OK %s", protname(), - transfertime(starttime, endtime, (unsigned long)tmpf->size - skipsize, TRUE)); + transfertime(starttime, endtime, (unsigned int)tmpf->size - skipsize, TRUE)); } } @@ -180,11 +180,11 @@ static int wctxpn(char *fname) fstat(fileno(input_f), &f); Syslog('+', "%s: send \"%s\"", protname(), MBSE_SS(fname)); - Syslog('+', "%s: size %lu bytes, dated %s", protname(), (unsigned long)f.st_size, rfcdate(f.st_mtime)); + Syslog('+', "%s: size %lu bytes, dated %s", protname(), (unsigned int)f.st_size, rfcdate(f.st_mtime)); if (protocol == ZM_XMODEM) { if (*fname) { - snprintf(name2, PATH_MAX +1, "Sending %s, %ld blocks: ", fname, (long) (f.st_size >> 7)); + snprintf(name2, PATH_MAX +1, "Sending %s, %d blocks: ", fname, (int) (f.st_size >> 7)); PUTSTR(name2); Enter(1); } @@ -222,7 +222,7 @@ static int wctxpn(char *fname) * int. But i believe sending %lo instead of %o _could_ break compatability */ if ((input_f != stdin) && *fname) - snprintf(p, MAXBLOCK + 1024, "%lu %lo %o 0 %d %ld", (long) f.st_size, (long) f.st_mtime, + snprintf(p, MAXBLOCK + 1024, "%u %o %o 0 %d %d", (int) f.st_size, (int) f.st_mtime, (unsigned int)((no_unixmode) ? 0 : f.st_mode), Filesleft, Totalleft); Totalleft -= f.st_size; @@ -296,7 +296,7 @@ static int getnak(void) -static int wctx(long bytes_total) +static int wctx(int bytes_total) { register size_t thisblklen; register int sectnum, attempts, firstch; diff --git a/mbsebbs/zmmisc.c b/mbsebbs/zmmisc.c index e9109661..09388738 100644 --- a/mbsebbs/zmmisc.c +++ b/mbsebbs/zmmisc.c @@ -176,7 +176,7 @@ void zsbhdr(int type, char *shdr) void zsbh32(char *shdr, int type) { register int n; - register unsigned long crc; + register unsigned int crc; PUTCHAR(ZBIN32); zsendline(type); @@ -277,7 +277,7 @@ void zsdata(register char *buf, int length, int frameend) void zsda32(register char *buf, int length, int frameend) { register int c; - register unsigned long crc; + register unsigned int crc; crc = 0xFFFFFFFFL; zsendline_s(buf, length); @@ -364,7 +364,7 @@ crcfoo: int zrdat32(register char *buf, int length) { register int c; - register unsigned long crc; + register unsigned int crc; register char *end; register int d; @@ -597,7 +597,7 @@ int zrbhdr(register char *shdr) int zrbhd32(register char *shdr) { register int c, n; - register unsigned long crc; + register unsigned int crc; if ((c = zdlread()) & ~0377) return c; @@ -932,7 +932,7 @@ int noxrd7(void) /* * Store long integer pos in Txhdr */ -void stohdr(long pos) +void stohdr(int pos) { Txhdr[ZP0] = pos; Txhdr[ZP1] = pos>>8; @@ -945,9 +945,9 @@ void stohdr(long pos) /* * Recover a long integer from a header */ -long rclhdr(register char *shdr) +int rclhdr(register char *shdr) { - register long l; + register int l; l = (shdr[ZP3] & 0377); l = (l << 8) | (shdr[ZP2] & 0377); diff --git a/mbsebbs/zmmisc.h b/mbsebbs/zmmisc.h index ccd73855..811ce86a 100644 --- a/mbsebbs/zmmisc.h +++ b/mbsebbs/zmmisc.h @@ -124,8 +124,8 @@ int Rxframeind; /* ZBIN ZBIN32, or ZHEX type of frame */ int Rxtype; /* Type of header received */ int Rxcount; /* Count of data bytes received */ -int long Rxpos; /* Received file position */ -int long Txpos; /* Transmitted file position */ +int Rxpos; /* Received file position */ +int Txpos; /* Transmitted file position */ int Txfcs32; /* TURE means send binary frames with 32 bit FCS */ int Crc32t; /* Display flag indicating 32 bit CRC being sent */ int Crc32r; /* Display flag indicating 32 bit CRC being received */ @@ -155,8 +155,8 @@ int zgethdr(char *); int zrbhdr(register char *); void zsendline(int); int zdlread(void); -void stohdr(long); -long rclhdr(register char *); +void stohdr(int); +int rclhdr(register char *); void zsendline_init(void); char *protname(void); void purgeline(int); @@ -165,7 +165,7 @@ void canit(int); #define FTOFFSET 16 extern unsigned short crc16xmodemtab[]; -extern unsigned long crc32tab[]; +extern unsigned int crc32tab[]; #define updcrc16(cp,crc) (crc16xmodemtab[(((int)crc >> 8) & 0xff)] ^ (crc << 8) ^ cp) #define updcrc32(cp,crc) (crc32tab[((int)crc ^ cp) & 0xff] ^ ((crc >> 8) & 0x00ffffff)) diff --git a/mbsebbs/zmrecv.c b/mbsebbs/zmrecv.c index 70e83033..12223d59 100644 --- a/mbsebbs/zmrecv.c +++ b/mbsebbs/zmrecv.c @@ -47,13 +47,13 @@ char *curfile = NULL; off_t rxbytes; static int Eofseen; /* indicates cpm eof (^Z) has been received */ static int errors; -long sbytes; +int sbytes; struct timeval starttime, endtime; struct timezone tz; #define DEFBYTL 2000000000L /* default rx file size */ -long Bytesleft; /* number of bytes of incoming file left */ -static long Modtime; /* Unix style mod time for incoming file */ +int Bytesleft; /* number of bytes of incoming file left */ +static int Modtime; /* Unix style mod time for incoming file */ static int Filemode; /* Unix style mode for incoming file */ static int Thisbinary = TRUE; /* current file is to be received in bin mode */ char *secbuf=0; /* "sector" buffer */ @@ -67,10 +67,10 @@ static int rzfiles(void); static int rzfile(void); static void zmputs(char*); static int ackbibi(void); -static long getfree(void); +static int getfree(void); -extern unsigned long rcvdbytes; +extern unsigned int rcvdbytes; extern int zmodem_requested; @@ -540,7 +540,7 @@ int procheader(char *Name) p = Name + 1 + strlen(Name); if (*p) { /* file coming from Unix or DOS system */ - sscanf(p, "%ld%lo%o%o%d%d%d%d", &Bytesleft, &Modtime, &Filemode, &dummy, &dummy, &dummy, &dummy, &dummy); + sscanf(p, "%d%o%o%o%d%d%d%d", &Bytesleft, &Modtime, &Filemode, &dummy, &dummy, &dummy, &dummy, &dummy); strcpy(ctt, rfcdate(Modtime)); } else { Syslog('z', "File coming from a CP/M system"); @@ -611,7 +611,7 @@ int putsec(char *buf, int n) -long getfree(void) +int getfree(void) { struct statfs sfs; char *temp; diff --git a/mbsebbs/zmsend.c b/mbsebbs/zmsend.c index 87e35057..1f6d62e4 100644 --- a/mbsebbs/zmsend.c +++ b/mbsebbs/zmsend.c @@ -61,7 +61,7 @@ static int blklen = 128; /* Length of transmitted records */ static int blkopt; /* Override value for zmodem blklen */ static int errors; static int Lastsync; -static long bytcnt; +static int bytcnt; static int Lrxpos=0; static int Lztrans=0; static int Lzmanag=0; @@ -69,11 +69,11 @@ static int Lskipnocor=0; static int Lzconv=0; static int Beenhereb4; static char Myattn[]={0}; -static long skipsize; +static int skipsize; struct timeval starttime, endtime; struct timezone tz; static int use8k = FALSE; -extern unsigned long sentbytes; +extern unsigned int sentbytes; extern int Rxhlen; extern char *txbuf; @@ -210,11 +210,11 @@ static int sendzfile(char *rn) } Syslog('+', "Zmodem: send \"%s\"", MBSE_SS(rn)); - Syslog('+', "Zmodem: size %lu bytes, dated %s", (unsigned long)st.st_size, rfcdate(st.st_mtime)); + Syslog('+', "Zmodem: size %lu bytes, dated %s", (unsigned int)st.st_size, rfcdate(st.st_mtime)); gettimeofday(&starttime, &tz); - snprintf(txbuf,MAXBLOCK + 1024,"%s %lu %lo %o 0 0 0", rn, - (unsigned long)st.st_size, (long)st.st_mtime+(st.st_mtime%2), st.st_mode); + snprintf(txbuf,MAXBLOCK + 1024,"%s %u %o %o 0 0 0", rn, + (unsigned int)st.st_size, (int)st.st_mtime + (int)(st.st_mtime % 2), st.st_mode); bufl = strlen(txbuf); *(strchr(txbuf,' ')) = '\0'; /*hope no blanks in filename*/ @@ -225,8 +225,8 @@ static int sendzfile(char *rn) return 0; } else if ((rc == OK) && (st.st_size - skipsize)) { gettimeofday(&endtime, &tz); - Syslog('+', "Zmodem: OK %s", transfertime(starttime, endtime, (unsigned long)st.st_size - skipsize, TRUE)); - sentbytes += (unsigned long)st.st_size - skipsize; + Syslog('+', "Zmodem: OK %s", transfertime(starttime, endtime, (unsigned int)st.st_size - skipsize, TRUE)); + sentbytes += (unsigned int)st.st_size - skipsize; return 0; } else return 2; @@ -361,8 +361,8 @@ int zfilbuf(void) int zsendfile(char *buf, int blen) { int c; - register unsigned long crc = -1; - long lastcrcrq = -1; + register unsigned int crc = -1; + int lastcrcrq = -1; Syslog('z', "zsendfile %s (%d)", buf, blen); for (errors=0; ++errors<11;) { diff --git a/mbsetup/ledit.c b/mbsetup/ledit.c index c6165bb4..e3f3965c 100644 --- a/mbsetup/ledit.c +++ b/mbsetup/ledit.c @@ -916,7 +916,7 @@ int edit_bool(int y, int x, int val, char *help) -char *getloglevel(long val) +char *getloglevel(int val) { char *p; @@ -949,7 +949,7 @@ char *getloglevel(long val) -void show_logl(int y, int x, long val) +void show_logl(int y, int x, int val) { char *p; @@ -960,7 +960,7 @@ void show_logl(int y, int x, long val) -long edit_logl(long val, char *txt) +int edit_logl(int val, char *txt) { clr_index(); set_color(WHITE, BLACK); @@ -1149,14 +1149,14 @@ unsigned short toggle_sbit(int y, int x, unsigned short val, unsigned short mask -void show_lbit(int y, int x, long val, long mask) +void show_lbit(int y, int x, int val, int mask) { show_bool(y, x, (val & mask) != 0); } -long toggle_lbit(int y, int x, long val, long mask, char *help) +int toggle_lbit(int y, int x, int val, int mask, char *help) { int ch; @@ -1176,7 +1176,7 @@ long toggle_lbit(int y, int x, long val, long mask, char *help) -char *getflag(unsigned long flag, unsigned long not) +char *getflag(unsigned int flag, unsigned int not) { static char temp[33]; int i; diff --git a/mbsetup/ledit.h b/mbsetup/ledit.h index bbe71778..b4db5d4c 100644 --- a/mbsetup/ledit.h +++ b/mbsetup/ledit.h @@ -27,10 +27,10 @@ char *edit_ups(int, int, int, char *, char *); char *getboolean(int val); void show_bool(int, int, int); int edit_bool(int, int, int, char *); -char *getloglevel(long val); -void show_logl(int, int, long); -long edit_logl(long, char *); -char *getflag(unsigned long, unsigned long); +char *getloglevel(int val); +void show_logl(int, int, int); +int edit_logl(int, char *); +char *getflag(unsigned int, unsigned int); void show_sec(int, int, securityrec); securityrec edit_sec(int, int, securityrec, char *); securityrec edit_usec(int, int, securityrec, char *); @@ -44,8 +44,8 @@ void show_ushort(int, int, unsigned short); unsigned short edit_ushort(int, int, unsigned short, char *); void show_sbit(int, int, unsigned short, unsigned short); unsigned short toggle_sbit(int, int, unsigned short, unsigned short, char *); -void show_lbit(int, int, long, long); -long toggle_lbit(int, int, long, long, char *); +void show_lbit(int, int, int, int); +int toggle_lbit(int, int, int, int, char *); char *getmsgtype(int); void show_msgtype(int, int, int); int edit_msgtype(int, int, int); diff --git a/mbsetup/m_archive.c b/mbsetup/m_archive.c index e6e3e0d2..17bd5af2 100644 --- a/mbsetup/m_archive.c +++ b/mbsetup/m_archive.c @@ -393,7 +393,7 @@ int OpenArchive(void) { FILE *fin, *fout; char fnin[PATH_MAX], fnout[PATH_MAX]; - long oldsize; + int oldsize; snprintf(fnin, PATH_MAX, "%s/etc/archiver.data", getenv("MBSE_ROOT")); snprintf(fnout, PATH_MAX, "%s/etc/archiver.temp", getenv("MBSE_ROOT")); @@ -509,9 +509,9 @@ int EditArchRec(int Area) { FILE *fil; char mfile[PATH_MAX]; - long offset; + int offset; int j; - unsigned long crc, crc1; + unsigned int crc, crc1; clr_index(); working(1, 0, 0); @@ -611,7 +611,7 @@ void EditArchive(void) char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; clr_index(); working(1, 0, 0); @@ -717,7 +717,7 @@ char *PickArchive(char *shdr) char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; clr_index(); diff --git a/mbsetup/m_domain.c b/mbsetup/m_domain.c index 1e2d7dcd..76364f20 100644 --- a/mbsetup/m_domain.c +++ b/mbsetup/m_domain.c @@ -109,7 +109,7 @@ int OpenDomain(void) { FILE *fin, *fout; char fnin[PATH_MAX], fnout[PATH_MAX]; - long oldsize; + int oldsize; snprintf(fnin, PATH_MAX, "%s/etc/domain.data", getenv("MBSE_ROOT")); snprintf(fnout, PATH_MAX, "%s/etc/domain.temp", getenv("MBSE_ROOT")); @@ -233,8 +233,8 @@ int EditDomainRec(int Area) { FILE *fil; char mfile[PATH_MAX]; - long offset; - unsigned long crc, crc1; + int offset; + unsigned int crc, crc1; clr_index(); working(1, 0, 0); @@ -303,7 +303,7 @@ void EditDomain(void) char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; struct domrec tdomtrans; if (! check_free()) diff --git a/mbsetup/m_farea.c b/mbsetup/m_farea.c index 45f70d12..6367177a 100644 --- a/mbsetup/m_farea.c +++ b/mbsetup/m_farea.c @@ -107,7 +107,7 @@ int OpenFilearea(void) { FILE *fin, *fout; char fnin[PATH_MAX], fnout[PATH_MAX]; - long oldsize; + int oldsize; snprintf(fnin, PATH_MAX, "%s/etc/fareas.data", getenv("MBSE_ROOT")); snprintf(fnout, PATH_MAX, "%s/etc/fareas.temp", getenv("MBSE_ROOT")); @@ -263,8 +263,8 @@ int EditFileRec(int Area) { FILE *fil; char mfile[PATH_MAX], *temp, tpath[65], frpath[81], topath[81]; - long offset; - unsigned long crc, crc1; + int offset; + unsigned int crc, crc1; int Available, files, rc, Force = FALSE, count; DIR *dp; struct dirent *de; @@ -469,7 +469,7 @@ void EditFilearea(void) char pick[12]; FILE *fil, *tfil; char temp[PATH_MAX], new[PATH_MAX]; - long offset, from, too; + int offset, from, too; clr_index(); working(1, 0, 0); @@ -590,8 +590,8 @@ void EditFilearea(void) offset = areahdr.hdrsize + ((from - 1) * areahdr.recsize); fseek(fil, offset, 0); fwrite(&area, areahdr.recsize, 1, fil); - snprintf(temp, PATH_MAX, "%s/var/fdb/file%ld.data", getenv("MBSE_ROOT"), from); - snprintf(new, PATH_MAX, "%s/var/fdb/file%ld.data", getenv("MBSE_ROOT"), too); + snprintf(temp, PATH_MAX, "%s/var/fdb/file%d.data", getenv("MBSE_ROOT"), from); + snprintf(new, PATH_MAX, "%s/var/fdb/file%d.data", getenv("MBSE_ROOT"), too); rename(temp, new); /* @@ -664,13 +664,13 @@ void EditFilearea(void) -long PickFilearea(char *shdr) +int PickFilearea(char *shdr) { int records, i, o = 0, x, y; char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; clr_index(); working(1, 0, 0); diff --git a/mbsetup/m_farea.h b/mbsetup/m_farea.h index 77986446..17e19151 100644 --- a/mbsetup/m_farea.h +++ b/mbsetup/m_farea.h @@ -1,10 +1,11 @@ #ifndef _FAREA_H #define _FAREA_H +/* $Id$ */ int CountFilearea(void); void EditFilearea(void); -long PickFilearea(char *); +int PickFilearea(char *); void InitFilearea(void); int bbs_file_doc(FILE *, FILE *, int); diff --git a/mbsetup/m_fdb.c b/mbsetup/m_fdb.c index ee180b16..41b10dcc 100644 --- a/mbsetup/m_fdb.c +++ b/mbsetup/m_fdb.c @@ -40,7 +40,7 @@ #include "m_fdb.h" -void E_F(long); +void E_F(int); void EditFile(void); @@ -105,20 +105,20 @@ void EditFile() -void E_F(long areanr) +void E_F(int areanr) { FILE *fil; char temp[PATH_MAX], help[81]; int i, y, o, records, Ondisk; static char *menu = (char *)"0"; - long offset; + int offset; time_t Time; struct stat statfile; - unsigned long crc, crc1; + unsigned int crc, crc1; clr_index(); - snprintf(temp, PATH_MAX, "%s/var/fdb/file%ld.data", getenv("MBSE_ROOT"), areanr); + snprintf(temp, PATH_MAX, "%s/var/fdb/file%d.data", getenv("MBSE_ROOT"), areanr); if ((fil = fopen(temp, "r+")) == NULL) { working(2, 0, 0); return; @@ -262,7 +262,7 @@ void EditFDB() char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; clr_index(); working(1, 0, 0); @@ -353,7 +353,7 @@ void EditFDB() void InitFDB(void) { int records, i; - long Area = 0; + int Area = 0; char *temp, Magic[21]; FILE *fp1, *fp2, *fil, *ft, *fp; DIR *dp; @@ -374,12 +374,12 @@ void InitFDB(void) while (fread(&area, areahdr.recsize, 1, fil)) { Area++; if (area.Available) { - snprintf(temp, PATH_MAX, "%s/var/fdb/fdb%ld.data", getenv("MBSE_ROOT"), Area); + snprintf(temp, PATH_MAX, "%s/var/fdb/fdb%d.data", getenv("MBSE_ROOT"), Area); if ((fp1 = fopen(temp, "r")) != NULL) { /* * Old area available, upgrade. */ - snprintf(temp, PATH_MAX, "%s/var/fdb/file%ld.data", getenv("MBSE_ROOT"), Area); + snprintf(temp, PATH_MAX, "%s/var/fdb/file%d.data", getenv("MBSE_ROOT"), Area); if ((fp2 = fopen(temp, "w+")) == NULL) { WriteError("$Can't create %s", temp); } else { @@ -452,7 +452,7 @@ void InitFDB(void) Syslog('+', "Upgraded file area database %d", Area); } fclose(fp1); - snprintf(temp, PATH_MAX, "%s/var/fdb/fdb%ld.data", getenv("MBSE_ROOT"), Area); + snprintf(temp, PATH_MAX, "%s/var/fdb/fdb%d.data", getenv("MBSE_ROOT"), Area); unlink(temp); } // Old area type upgrade. @@ -460,7 +460,7 @@ void InitFDB(void) * Current area, check */ if ((fdb_area = mbsedb_OpenFDB(Area, 30)) == NULL) - WriteError("InitFDB(): database area %ld might be corrupt", Area); + WriteError("InitFDB(): database area %d might be corrupt", Area); else mbsedb_CloseFDB(fdb_area); } diff --git a/mbsetup/m_ff.c b/mbsetup/m_ff.c index d1298284..6a4e3281 100644 --- a/mbsetup/m_ff.c +++ b/mbsetup/m_ff.c @@ -87,7 +87,7 @@ int OpenFilefind(void) { FILE *fin, *fout; char fnin[PATH_MAX], fnout[PATH_MAX]; - long oldsize; + int oldsize; snprintf(fnin, PATH_MAX, "%s/etc/scanmgr.data", getenv("MBSE_ROOT")); snprintf(fnout, PATH_MAX, "%s/etc/scanmgr.temp", getenv("MBSE_ROOT")); @@ -239,8 +239,8 @@ int EditFfRec(int Area) { FILE *fil; char mfile[PATH_MAX], temp1[2]; - long offset; - unsigned long crc, crc1; + int offset; + unsigned int crc, crc1; int i; clr_index(); @@ -331,7 +331,7 @@ void EditFilefind(void) char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; clr_index(); working(1, 0, 0); diff --git a/mbsetup/m_fgroup.c b/mbsetup/m_fgroup.c index 8c1d4c01..fb4a35be 100644 --- a/mbsetup/m_fgroup.c +++ b/mbsetup/m_fgroup.c @@ -92,7 +92,7 @@ int OpenFGroup(void) { FILE *fin, *fout; char fnin[PATH_MAX], fnout[PATH_MAX], temp[13]; - long oldsize; + int oldsize; snprintf(fnin, PATH_MAX, "%s/etc/fgroups.data", getenv("MBSE_ROOT")); snprintf(fnout, PATH_MAX, "%s/etc/fgroups.temp", getenv("MBSE_ROOT")); @@ -307,11 +307,11 @@ void FgScreen(void) */ int EditFGrpRec(int Area) { - FILE *fil; - char mfile[PATH_MAX], temp[13]; - long offset; - int i, j, tmp; - unsigned long crc, crc1; + FILE *fil; + char mfile[PATH_MAX], temp[13]; + int offset; + int i, j, tmp; + unsigned int crc, crc1; clr_index(); working(1, 0, 0); @@ -485,7 +485,7 @@ void EditFGroup(void) int records, i, o, x, y; char pick[12], temp[PATH_MAX]; FILE *fil; - long offset; + int offset; clr_index(); working(1, 0, 0); @@ -598,7 +598,7 @@ char *PickFGroup(char *shdr) char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; clr_index(); @@ -685,6 +685,7 @@ int tic_group_doc(FILE *fp, FILE *toc, int page) char *temp, group[13]; FILE *ti, *wp, *ip, *no; int refs, i, First = TRUE;; + time_t tt; temp = calloc(PATH_MAX, sizeof(char)); snprintf(temp, PATH_MAX, "%s/etc/fgroups.data", getenv("MBSE_ROOT")); @@ -730,7 +731,7 @@ int tic_group_doc(FILE *fp, FILE *toc, int page) add_webtable(wp, (char *)"Use Aka", aka2str(fgroup.UseAka)); add_webtable(wp, (char *)"Uplink Aka", aka2str(fgroup.UpLink)); add_webtable(wp, (char *)"Areas file", fgroup.AreaFile); - snprintf(temp, 81, "%ld", fgroup.StartArea); + snprintf(temp, 81, "%d", fgroup.StartArea); add_webtable(wp, (char *)"Start autocreate BBS area", temp); add_webtable(wp, (char *)"Banner file", fgroup.Banner); add_webtable(wp, (char *)"Default archiver", fgroup.Convert); @@ -758,8 +759,10 @@ int tic_group_doc(FILE *fp, FILE *toc, int page) fgroup.AnnGroup); snprintf(temp, 81, "%d", fgroup.Upload); add_webtable(wp, (char *)"Upload area", temp); - add_webtable(wp, (char *)"Start date", ctime(&fgroup.StartDate)); - add_webtable(wp, (char *)"Last active date", ctime(&fgroup.LastDate)); + tt = (time_t)fgroup.StartDate; + add_webtable(wp, (char *)"Start date", ctime(&tt)); + tt = (time_t)fgroup.LastDate; + add_webtable(wp, (char *)"Last active date", ctime(&tt)); fprintf(wp, "\n"); fprintf(wp, "\n"); fprintf(wp, "
\n"); @@ -863,7 +866,7 @@ int tic_group_doc(FILE *fp, FILE *toc, int page) fprintf(fp, " Use Aka %s\n", aka2str(fgroup.UseAka)); fprintf(fp, " Uplink %s\n", aka2str(fgroup.UpLink)); fprintf(fp, " Areas file %s\n", fgroup.AreaFile); - fprintf(fp, " Start area %ld\n", fgroup.StartArea); + fprintf(fp, " Start area %d\n", fgroup.StartArea); fprintf(fp, " Banner file %s\n", fgroup.Banner); fprintf(fp, " Def. archiver %s\n", fgroup.Convert); fprintf(fp, " Filegate fmt %s\n", getboolean(fgroup.FileGate)); @@ -887,8 +890,10 @@ int tic_group_doc(FILE *fp, FILE *toc, int page) fprintf(fp, " BBS group %s\n", fgroup.BbsGroup); fprintf(fp, " Newfiles group %s\n", fgroup.AnnGroup); fprintf(fp, " Upload area %d\n", fgroup.Upload); - fprintf(fp, " Start date %s", ctime(&fgroup.StartDate)); - fprintf(fp, " Last date %s\n", ctime(&fgroup.LastDate)); + tt = (time_t)fgroup.StartDate; + fprintf(fp, " Start date %s", ctime(&tt)); + tt = (time_t)fgroup.LastDate; + fprintf(fp, " Last date %s\n", ctime(&tt)); } fprintf(ip, "\n"); diff --git a/mbsetup/m_fido.c b/mbsetup/m_fido.c index fee4c2ae..6c1c600b 100644 --- a/mbsetup/m_fido.c +++ b/mbsetup/m_fido.c @@ -106,7 +106,7 @@ int OpenFidonet(void) { FILE *fin, *fout; char fnin[PATH_MAX], fnout[PATH_MAX]; - long oldsize; + int oldsize; snprintf(fnin, PATH_MAX, "%s/etc/fidonet.data", getenv("MBSE_ROOT")); snprintf(fnout, PATH_MAX, "%s/etc/fidonet.temp", getenv("MBSE_ROOT")); @@ -226,9 +226,9 @@ int EditFidoRec(int Area) { FILE *fil; char mfile[PATH_MAX], *temp; - long offset; + int offset; int i, j = 0; - unsigned long crc, crc1; + unsigned int crc, crc1; clr_index(); working(1, 0, 0); @@ -378,7 +378,7 @@ void EditFidonet(void) char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; clr_index(); working(1, 0, 0); diff --git a/mbsetup/m_global.c b/mbsetup/m_global.c index de878622..1e76c155 100644 --- a/mbsetup/m_global.c +++ b/mbsetup/m_global.c @@ -49,7 +49,7 @@ int some_fd; extern int exp_golded; -#define WRLONG cnt = write(some_fd, &longvar, sizeof(longvar)); +// #define WRLONG cnt = write(some_fd, &longvar, sizeof(longvar)); @@ -1442,7 +1442,7 @@ void e_html(void) void global_menu(void) { - unsigned long crc, crc1; + unsigned int crc, crc1; int i; char *temp; @@ -2100,9 +2100,9 @@ int global_doc(FILE *fp, FILE *toc, int page) addtoc(fp, toc, 1, 11, page, (char *)"Fileecho processing"); fprintf(fp, " Keep days on hold %d\n", CFG.tic_days); fprintf(fp, " Hatch password %s\n", CFG.hatchpasswd); - fprintf(fp, " Max. systems %ld\n", CFG.tic_systems); - fprintf(fp, " Max. groups %ld\n", CFG.tic_groups); - fprintf(fp, " Max. dupes %ld\n", CFG.tic_dupes); + fprintf(fp, " Max. systems %d\n", CFG.tic_systems); + fprintf(fp, " Max. groups %d\n", CFG.tic_groups); + fprintf(fp, " Max. dupes %d\n", CFG.tic_dupes); fprintf(fp, " Keep filedate %s\n", getboolean(CFG.ct_KeepDate)); fprintf(fp, " Keep mgr netmail %s\n", getboolean(CFG.ct_KeepMgr)); fprintf(fp, " Local requests %s\n", getboolean(CFG.ct_LocalRep)); @@ -2150,8 +2150,8 @@ int global_doc(FILE *fp, FILE *toc, int page) fprintf(fp, " Default max msgs %d\n", CFG.defmsgs); fprintf(fp, " Default days %d\n", CFG.defdays); fprintf(fp, " Reject older then %d days\n", CFG.toss_old); - fprintf(fp, " Maximum systems %ld\n", CFG.toss_systems); - fprintf(fp, " Maximum groups %ld\n", CFG.toss_groups); + fprintf(fp, " Maximum systems %d\n", CFG.toss_systems); + fprintf(fp, " Maximum groups %d\n", CFG.toss_groups); fprintf(fp, " Use 4d addressing %s\n", getboolean(CFG.addr4d)); fprintf(fp, " AreaMgr: allow +%%* %s\n", getboolean(CFG.ca_PlusAll)); fprintf(fp, " AreaMgr: notify %s\n", getboolean(CFG.ca_Notify)); @@ -2223,7 +2223,7 @@ int global_doc(FILE *fp, FILE *toc, int page) addtoc(fp, toc, 1, 14, page, (char *)"Newfile reports"); fprintf(fp, " New files days %d\n", CFG.newdays); fprintf(fp, " Highest sec. level %s\n", get_secstr(CFG.security)); - fprintf(fp, " Max. newfile grps %ld\n", CFG.new_groups); + fprintf(fp, " Max. newfile grps %d\n", CFG.new_groups); fprintf(fp, " WWW logfile %s\n", CFG.www_logfile); fprintf(fp, " FTP logfile %s\n", CFG.ftp_logfile); fprintf(wp, "\n"); @@ -2260,11 +2260,11 @@ int global_doc(FILE *fp, FILE *toc, int page) p = getloglevel(CFG.cico_loglevel); fprintf(fp, " Mailer loglevel %s\n", p); free(p); - fprintf(fp, " Res. modem timeout %ld\n", CFG.timeoutreset); - fprintf(fp, " Connect timeout %ld\n", CFG.timeoutconnect); - fprintf(fp, " Random dialdelay %ld\n", CFG.dialdelay); + fprintf(fp, " Res. modem timeout %d\n", CFG.timeoutreset); + fprintf(fp, " Connect timeout %d\n", CFG.timeoutconnect); + fprintf(fp, " Random dialdelay %d\n", CFG.dialdelay); fprintf(fp, " TCP/IP phone nr. %s\n", CFG.IP_Phone); - fprintf(fp, " TCP/IP speed %lu\n", CFG.IP_Speed); + fprintf(fp, " TCP/IP speed %u\n", CFG.IP_Speed); fprintf(fp, " TCP/IP flags %s\n", CFG.IP_Flags); fprintf(fp, " No Filerequests %s\n", getboolean(CFG.NoFreqs)); fprintf(fp, " No Calls %s\n", getboolean(CFG.NoCall)); diff --git a/mbsetup/m_hatch.c b/mbsetup/m_hatch.c index 06de55f3..67059fc7 100644 --- a/mbsetup/m_hatch.c +++ b/mbsetup/m_hatch.c @@ -97,7 +97,7 @@ int OpenHatch(void) { FILE *fin, *fout; char fnin[PATH_MAX], fnout[PATH_MAX]; - long oldsize; + int oldsize; int FieldPatch = FALSE; snprintf(fnin, PATH_MAX, "%s/etc/hatch.data", getenv("MBSE_ROOT")); @@ -332,8 +332,8 @@ int EditHatchRec(int Area) FILE *fil; char mfile[PATH_MAX]; static char *tmp = NULL; - long offset; - unsigned long crc, crc1; + int offset; + unsigned int crc, crc1; int i, All; clr_index(); @@ -456,7 +456,7 @@ void EditHatch(void) char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; clr_index(); working(1, 0, 0); diff --git a/mbsetup/m_ibc.c b/mbsetup/m_ibc.c index d5402791..f801eeba 100644 --- a/mbsetup/m_ibc.c +++ b/mbsetup/m_ibc.c @@ -86,7 +86,7 @@ int OpenIBC(void) { FILE *fin, *fout; char fnin[PATH_MAX], fnout[PATH_MAX]; - long oldsize; + int oldsize; snprintf(fnin, PATH_MAX, "%s/etc/ibcsrv.data", getenv("MBSE_ROOT")); snprintf(fnout, PATH_MAX, "%s/etc/ibcsrv.temp", getenv("MBSE_ROOT")); @@ -202,9 +202,9 @@ int EditIBCRec(int Area) { FILE *fil; char mfile[PATH_MAX]; - long offset; + int offset; int j; - unsigned long crc, crc1; + unsigned int crc, crc1; clr_index(); working(1, 0, 0); @@ -289,7 +289,7 @@ void EditIBC(void) char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; clr_index(); working(1, 0, 0); diff --git a/mbsetup/m_lang.c b/mbsetup/m_lang.c index 0bfd0dce..94fcb9d9 100644 --- a/mbsetup/m_lang.c +++ b/mbsetup/m_lang.c @@ -114,7 +114,7 @@ int OpenLanguage(void) { FILE *fin, *fout; char fnin[PATH_MAX], fnout[PATH_MAX]; - long oldsize; + int oldsize; snprintf(fnin, PATH_MAX, "%s/etc/language.data", getenv("MBSE_ROOT")); snprintf(fnout, PATH_MAX, "%s/etc/language.temp", getenv("MBSE_ROOT")); @@ -249,11 +249,11 @@ void s_lang(void) */ int EditLangRec(int Area) { - FILE *fil; - char mfile[PATH_MAX]; - long offset; - int j; - unsigned long crc, crc1; + FILE *fil; + char mfile[PATH_MAX]; + int offset; + int j; + unsigned int crc, crc1; clr_index(); working(1, 0, 0); @@ -332,7 +332,7 @@ void EditLanguage(void) char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; clr_index(); working(1, 0, 0); @@ -420,7 +420,7 @@ int PickLanguage(char *nr) char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; clr_index(); diff --git a/mbsetup/m_limits.c b/mbsetup/m_limits.c index e02507ff..0f3cfcca 100644 --- a/mbsetup/m_limits.c +++ b/mbsetup/m_limits.c @@ -151,7 +151,7 @@ int OpenLimits(void) { FILE *fin, *fout; char fnin[PATH_MAX], fnout[PATH_MAX]; - long oldsize; + int oldsize; snprintf(fnin, PATH_MAX, "%s/etc/limits.data", getenv("MBSE_ROOT")); snprintf(fnout, PATH_MAX, "%s/etc/limits.temp", getenv("MBSE_ROOT")); @@ -215,7 +215,7 @@ void CloseLimits(int force) while (fread(&LIMIT, LIMIThdr.recsize, 1, fi) == 1) if (!LIMIT.Deleted) { - snprintf(temp, 20, "%014ld", LIMIT.Security); + snprintf(temp, 20, "%014d", LIMIT.Security); fill_stlist(&lim, temp, ftell(fi) - LIMIThdr.recsize); } sort_stlist(&lim); @@ -269,9 +269,9 @@ int EditLimRec(int Area) { FILE *fil; char mfile[PATH_MAX]; - long offset; + int offset; int j; - unsigned long crc, crc1; + unsigned int crc, crc1; clr_index(); working(1, 0, 0); @@ -356,7 +356,7 @@ void EditLimits(void) char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; clr_index(); working(1, 0, 0); @@ -401,7 +401,7 @@ void EditLimits(void) set_color(CYAN, BLACK); else set_color(LIGHTBLUE, BLACK); - snprintf(temp, 81, "%3d. %-6ld %-40s", i, LIMIT.Security, LIMIT.Description); + snprintf(temp, 81, "%3d. %-6d %-40s", i, LIMIT.Security, LIMIT.Description); temp[37] = '\0'; mbse_mvprintw(y, x, temp); y++; @@ -448,7 +448,7 @@ char *PickLimits(int nr) char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; clr_index(); @@ -489,7 +489,7 @@ char *PickLimits(int nr) set_color(CYAN, BLACK); else set_color(LIGHTBLUE, BLACK); - snprintf(temp, 81, "%3d. %-6ld %-40s", i, LIMIT.Security, LIMIT.Description); + snprintf(temp, 81, "%3d. %-6d %-40s", i, LIMIT.Security, LIMIT.Description); temp[37] = '\0'; mbse_mvprintw(y, x, temp); y++; @@ -500,7 +500,7 @@ char *PickLimits(int nr) offset = sizeof(LIMIThdr) + ((atoi(pick) - 1) * LIMIThdr.recsize); fseek(fil, offset, 0); fread(&LIMIT, LIMIThdr.recsize, 1, fil); - snprintf(Lim, 21, "%ld", LIMIT.Security); + snprintf(Lim, 21, "%d", LIMIT.Security); } fclose(fil); } @@ -563,9 +563,9 @@ int bbs_limits_doc(FILE *fp, FILE *toc, int page) fprintf(fp, " ------ ------ ------ ------ ------ ------------------------------\n"); while ((fread(&LIMIT, LIMIThdr.recsize, 1, no)) == 1) { - fprintf(fp, " %6ld %6ld %6ld %6d %s %s\n", + fprintf(fp, " %6d %6d %6d %6d %s %s\n", LIMIT.Security, LIMIT.Time, LIMIT.DownK, LIMIT.DownF, getboolean(LIMIT.Available), LIMIT.Description); - fprintf(ip, "%ld%ld%ld%d%s%s\n", + fprintf(ip, "%d%d%d%d%s%s\n", LIMIT.Security, LIMIT.Time, LIMIT.DownK, LIMIT.DownF, getboolean(LIMIT.Available), LIMIT.Description); } @@ -589,7 +589,7 @@ int bbs_limits_doc(FILE *fp, FILE *toc, int page) while (fread(&usrconfig, usrconfighdr.recsize, 1, up) == 1) { nr++; if (strlen(usrconfig.sUserName) && (usrconfig.Security.level == LIMIT.Security)) { - fprintf(ip, "%ld%s%s\n", + fprintf(ip, "%d%s%s\n", LIMIT.Security, nr, usrconfig.sUserName, usrconfig.sLocation); } } diff --git a/mbsetup/m_magic.c b/mbsetup/m_magic.c index 2b282ef1..52f5e05f 100644 --- a/mbsetup/m_magic.c +++ b/mbsetup/m_magic.c @@ -87,7 +87,7 @@ int OpenMagics(void) { FILE *fin, *fout; char fnin[PATH_MAX], fnout[PATH_MAX]; - long oldsize; + int oldsize; int FieldPatch = FALSE; snprintf(fnin, PATH_MAX, "%s/etc/magic.data", getenv("MBSE_ROOT")); @@ -281,9 +281,9 @@ int EditMagicRec(int Area) { FILE *fil; char mfile[PATH_MAX]; - long offset; + int offset; int j, choices; - unsigned long crc, crc1; + unsigned int crc, crc1; clr_index(); working(1, 0, 0); @@ -386,7 +386,7 @@ void EditMagics(void) char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; clr_index(); working(1, 0, 0); diff --git a/mbsetup/m_marea.c b/mbsetup/m_marea.c index 3ca70dba..7e70e03a 100644 --- a/mbsetup/m_marea.c +++ b/mbsetup/m_marea.c @@ -44,7 +44,7 @@ int MsgUpdated = 0; -unsigned long MsgCrc; +unsigned int MsgCrc; FILE *tfil = NULL; extern int exp_golded; int MailForced = FALSE; @@ -176,7 +176,7 @@ int OpenMsgarea(void) { FILE *fin, *fout; char fnin[PATH_MAX], fnout[PATH_MAX]; - long oldsize, oldsys; + int oldsize, oldsys; struct _sysconnect syscon; int i, oldsystems; time_t start = 900000000; /* Faked startdate of 09-07-1998 17:00:00 */ @@ -427,7 +427,7 @@ int EditConnections(FILE *); int EditConnections(FILE *fil) { int systems, o = 0, i, y, x; - long offset; + int offset; char pick[12]; sysconnect System; char status[5]; @@ -554,12 +554,12 @@ void SetScreen() -long LoadMsgRec(int, int); -long LoadMsgRec(int Area, int work) +int LoadMsgRec(int, int); +int LoadMsgRec(int Area, int work) { FILE *fil; char mfile[PATH_MAX]; - long offset; + int offset; sysconnect System; int i; @@ -603,7 +603,7 @@ int SaveMsgRec(int Area, int work) { int i; FILE *fil; - long offset; + int offset; char mfile[PATH_MAX]; sysconnect System; @@ -708,7 +708,7 @@ void MsgGlobal(void) fidoaddr a1, a2; int menu = 0, marea, Areas, akan = 0, Found, charset = FTNC_CP437; int Total, Done, netbrd, daysold, maxmsgs, maxarticles; - long offset; + int offset; securityrec rs, ws, ss, as; sysconnect S, Sc; @@ -1085,7 +1085,7 @@ void MsgGlobal(void) int EditMsgRec(int); int EditMsgRec(int Area) { - unsigned long crc1; + unsigned int crc1; int tmp, i, connections = 0, changed = FALSE, Active, Forced = FALSE; sysconnect System; char *temp, oldpath[81]; @@ -1411,7 +1411,7 @@ void EditMsgarea(void) int records, rc, i, o, y, from, too; char pick[12], temp[PATH_MAX]; FILE *fil; - long offset; + int offset; sysconnect System; clr_index(); @@ -1577,7 +1577,7 @@ char *PickMsgarea(char *shdr) char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; static char Buf[81]; clr_index(); @@ -1842,7 +1842,7 @@ int mail_area_doc(FILE *fp, FILE *toc, int page) int i = 0, j, k, systems, refs, First = TRUE, LMiy; sysconnect System; struct tm *t; - time_t Now; + time_t Now, tt; Now = time(NULL); t = localtime(&Now); @@ -1921,9 +1921,12 @@ int mail_area_doc(FILE *fp, FILE *toc, int page) add_webtable(wp, (char *)"Append quotes", getboolean(msgs.Quotes)); add_webtable(wp, (char *)"Nodes mandatory", getboolean(msgs.Mandatory)); add_webtable(wp, (char *)"UnSecure toss", getboolean(msgs.UnSecure)); - add_webtable(wp, (char *)"Last msg rcvd", ctime(&msgs.LastRcvd)); - add_webtable(wp, (char *)"Last msg posted", ctime(&msgs.LastPosted)); - add_webtable(wp, (char *)"Area created at", ctime(&msgs.Created)); + tt = (time_t)msgs.LastRcvd; + add_webtable(wp, (char *)"Last msg rcvd", ctime(&tt)); + tt = (time_t)msgs.LastPosted; + add_webtable(wp, (char *)"Last msg posted", ctime(&tt)); + tt = (time_t)msgs.Created; + add_webtable(wp, (char *)"Area created at", ctime(&tt)); fprintf(wp, "\n"); fprintf(wp, "\n"); fprintf(wp, "
\n"); @@ -1959,9 +1962,12 @@ int mail_area_doc(FILE *fp, FILE *toc, int page) fprintf(fp, " Append quotes %s\n", getboolean(msgs.Quotes)); fprintf(fp, " Nodes mandatory %s\n", getboolean(msgs.Mandatory)); fprintf(fp, " UnSecure toss %s\n", getboolean(msgs.UnSecure)); - fprintf(fp, " Last msg rcvd. %s", ctime(&msgs.LastRcvd)); - fprintf(fp, " Last msg posted %s", ctime(&msgs.LastPosted)); - fprintf(fp, " Area created at %s", ctime(&msgs.Created)); + tt = (time_t)msgs.LastRcvd; + fprintf(fp, " Last msg rcvd. %s", ctime(&tt)); + tt = (time_t)msgs.LastPosted; + fprintf(fp, " Last msg posted %s", ctime(&tt)); + tt = (time_t)msgs.Created; + fprintf(fp, " Area created at %s", ctime(&tt)); refs = 0; for (j = 0; j < systems; j++) { @@ -2026,8 +2032,8 @@ int mail_area_doc(FILE *fp, FILE *toc, int page) fprintf(fp, "\n"); fprintf(fp, " Total This Month Last Month\n"); fprintf(fp, " ---------- ---------- ----------\n"); - fprintf(fp, " Msgs received %-10ld %-10ld %-10ld\n", msgs.Received.total, msgs.Received.month[Miy], msgs.Received.month[LMiy]); - fprintf(fp, " Msgs posted %-10ld %-10ld %-10ld\n", msgs.Posted.total, msgs.Posted.month[Miy], msgs.Posted.month[LMiy]); + fprintf(fp, " Msgs received %-10d %-10d %-10d\n", msgs.Received.total, msgs.Received.month[Miy], msgs.Received.month[LMiy]); + fprintf(fp, " Msgs posted %-10d %-10d %-10d\n", msgs.Posted.total, msgs.Posted.month[Miy], msgs.Posted.month[LMiy]); } else fseek(no, msgshdr.syssize, SEEK_CUR); diff --git a/mbsetup/m_menu.c b/mbsetup/m_menu.c index eb1a510c..067f8619 100644 --- a/mbsetup/m_menu.c +++ b/mbsetup/m_menu.c @@ -308,8 +308,8 @@ void EditMenu(char *Name) char mtemp[PATH_MAX], temp[PATH_MAX], pick[12]; FILE *fil, *tmp; int records = 0, i, o, y, MenuUpdated = FALSE, from, too; - long offset; - unsigned long crc, crc1; + int offset; + unsigned int crc, crc1; struct menufile tmenus; clr_index(); diff --git a/mbsetup/m_mgroup.c b/mbsetup/m_mgroup.c index 8840f077..2e3decd8 100644 --- a/mbsetup/m_mgroup.c +++ b/mbsetup/m_mgroup.c @@ -100,7 +100,7 @@ int OpenMGroup(void) { FILE *fin, *fout; char fnin[PATH_MAX], fnout[PATH_MAX], temp[13]; - long oldsize; + int oldsize; int i; snprintf(fnin, PATH_MAX, "%s/etc/mgroups.data", getenv("MBSE_ROOT")); @@ -301,9 +301,9 @@ int EditMGrpRec(int Area) { FILE *fil; static char mfile[PATH_MAX], temp[13]; - static long offset; + static int offset; static int i, j, tmp; - unsigned long crc, crc1; + unsigned int crc, crc1; clr_index(); working(1, 0, 0); @@ -442,7 +442,7 @@ void EditMGroup(void) int records, i, o, x, y; char pick[12], temp[PATH_MAX]; FILE *fil; - long offset; + int offset; clr_index(); working(1, 0, 0); @@ -556,7 +556,7 @@ char *PickMGroup(char *shdr) char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; clr_index(); @@ -642,6 +642,7 @@ int mail_group_doc(FILE *fp, FILE *toc, int page) char temp[PATH_MAX], group[13]; FILE *ti, *wp, *ip, *no; int refs, i, j; + time_t tt; snprintf(temp, PATH_MAX, "%s/etc/mgroups.data", getenv("MBSE_ROOT")); if ((no = fopen(temp, "r")) == NULL) @@ -697,8 +698,10 @@ int mail_group_doc(FILE *fp, FILE *toc, int page) add_webtable(wp, (char *)"Auto add/del areas", getboolean(mgroup.AutoChange)); add_webtable(wp, (char *)"User add/del areas", getboolean(mgroup.UserChange)); add_webtable(wp, (char *)"Default charset", getftnchrs(mgroup.Charset)); - add_webtable(wp, (char *)"Start area date", ctime(&mgroup.StartDate)); - add_webtable(wp, (char *)"Last active date", ctime(&mgroup.LastDate)); + tt = (time_t)mgroup.StartDate; + add_webtable(wp, (char *)"Start area date", ctime(&tt)); + tt = (time_t)mgroup.LastDate; + add_webtable(wp, (char *)"Last active date", ctime(&tt)); fprintf(wp, "\n"); fprintf(wp, "\n"); fprintf(wp, "
\n"); @@ -790,8 +793,10 @@ int mail_group_doc(FILE *fp, FILE *toc, int page) fprintf(fp, " Auto add/del areas %s\n", getboolean(mgroup.AutoChange)); fprintf(fp, " User add/del areas %s\n", getboolean(mgroup.UserChange)); fprintf(fp, " Default charset %s\n", getftnchrs(mgroup.Charset)); - fprintf(fp, " Start area date %s", ctime(&mgroup.StartDate)); - fprintf(fp, " Last active date %s\n", ctime(&mgroup.LastDate)); + tt = (time_t)mgroup.StartDate; + fprintf(fp, " Start area date %s", ctime(&tt)); + tt = (time_t)mgroup.LastDate; + fprintf(fp, " Last active date %s\n", ctime(&tt)); fprintf(fp, "\n\n"); j++; } diff --git a/mbsetup/m_modem.c b/mbsetup/m_modem.c index 59ef2afb..0e93b006 100644 --- a/mbsetup/m_modem.c +++ b/mbsetup/m_modem.c @@ -167,7 +167,7 @@ int OpenModem(void) { FILE *fin, *fout; char fnin[PATH_MAX], fnout[PATH_MAX]; - long oldsize; + int oldsize; snprintf(fnin, PATH_MAX, "%s/etc/modem.data", getenv("MBSE_ROOT")); snprintf(fnout, PATH_MAX, "%s/etc/modem.temp", getenv("MBSE_ROOT")); @@ -401,9 +401,9 @@ int EditModemRec(int Area) { FILE *fil; char mfile[PATH_MAX]; - long offset; + int offset; int j; - unsigned long crc, crc1; + unsigned int crc, crc1; clr_index(); working(1, 0, 0); @@ -505,7 +505,7 @@ void EditModem(void) char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; clr_index(); working(1, 0, 0); @@ -597,7 +597,7 @@ char *PickModem(char *shdr) char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; static char buf[31]; clr_index(); diff --git a/mbsetup/m_new.c b/mbsetup/m_new.c index 239f3364..79cb41a1 100644 --- a/mbsetup/m_new.c +++ b/mbsetup/m_new.c @@ -107,9 +107,9 @@ int OpenNewfiles(void) { FILE *fin, *fout; char fnin[PATH_MAX], fnout[PATH_MAX]; - long oldsize; + int oldsize; int i, old_groups; - long oldgroup; + int oldgroup; char group[13]; snprintf(fnin, PATH_MAX, "%s/etc/newfiles.data", getenv("MBSE_ROOT")); @@ -293,8 +293,8 @@ int EditNewRec(int Area) { FILE *fil; char mfile[PATH_MAX], temp1[2]; - long offset; - unsigned long crc, crc1; + int offset; + unsigned int crc, crc1; gr_list *fgr = NULL, *tmp; char group[13]; int groups, i, j, GrpChanged = FALSE; @@ -435,7 +435,7 @@ void EditNewfiles(void) int records, i, o, x, y; char pick[12], temp[PATH_MAX]; FILE *fil; - long offset; + int offset; clr_index(); working(1, 0, 0); diff --git a/mbsetup/m_ngroup.c b/mbsetup/m_ngroup.c index b05bc202..e263b92a 100644 --- a/mbsetup/m_ngroup.c +++ b/mbsetup/m_ngroup.c @@ -98,7 +98,7 @@ int OpenNGroup(void) { FILE *fin, *fout; char fnin[PATH_MAX], fnout[PATH_MAX]; - long oldsize; + int oldsize; snprintf(fnin, PATH_MAX, "%s/etc/ngroups.data", getenv("MBSE_ROOT")); snprintf(fnout, PATH_MAX, "%s/etc/ngroups.temp", getenv("MBSE_ROOT")); @@ -235,9 +235,9 @@ int EditNGrpRec(int Area) { FILE *fil; char mfile[PATH_MAX]; - long offset; + int offset; int j; - unsigned long crc, crc1; + unsigned int crc, crc1; clr_index(); working(1, 0, 0); @@ -307,7 +307,7 @@ void EditNGroup(void) char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; clr_index(); working(1, 0, 0); @@ -413,7 +413,7 @@ char *PickNGroup(char *shdr) char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; clr_index(); diff --git a/mbsetup/m_node.c b/mbsetup/m_node.c index 015829b3..2cf4fb98 100644 --- a/mbsetup/m_node.c +++ b/mbsetup/m_node.c @@ -93,7 +93,7 @@ int OpenNoderec(void) FILE *fin, *fout; char *fnin, *fnout, group[13]; int i, old_fgroups, old_mgroups; - long oldsize, oldfilegrp, oldmailgrp; + int oldsize, oldfilegrp, oldmailgrp; fnin = calloc(PATH_MAX, sizeof(char)); fnout = calloc(PATH_MAX, sizeof(char)); @@ -211,7 +211,7 @@ void CloseNoderec(int Force) FILE *fi, *fo; int i; st_list *nod = NULL, *tmp; - unsigned long crc1, crc2; + unsigned int crc1, crc2; fin = calloc(PATH_MAX, sizeof(char)); fout = calloc(PATH_MAX, sizeof(char)); @@ -1025,8 +1025,8 @@ int EditNodeRec(int Area) { FILE *fil; char mfile[PATH_MAX]; - long offset; - unsigned long crc, crc1; + int offset; + unsigned int crc, crc1; gr_list *fgr = NULL, *egr = NULL, *tmp; char group[13]; int groups, i, j, GrpChanged = FALSE; @@ -1204,7 +1204,7 @@ void EditNodes(void) int records, i, o, x, y; char pick[12], temp[PATH_MAX]; FILE *fil; - long offset; + int offset; clr_index(); working(1, 0, 0); @@ -1321,7 +1321,7 @@ fidoaddr PullUplink(char *Hdr) char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; memset(&uplink, 0, sizeof(uplink)); clr_index(); @@ -1441,6 +1441,7 @@ int node_doc(FILE *fp, FILE *toc, int page) int systems, groups, nr, refs, i, j, k, First = TRUE; char group[13]; sysconnect System; + time_t tt; snprintf(temp, PATH_MAX, "%s/etc/nodes.data", getenv("MBSE_ROOT")); if ((no = fopen(temp, "r")) == NULL) @@ -1485,10 +1486,12 @@ int node_doc(FILE *fp, FILE *toc, int page) fprintf(fp, " Outbox dir %s\n", nodes.OutBox); add_webtable(wp, (char *)"Outbox directory", nodes.OutBox); } - fprintf(fp, " First date %s", ctime(&nodes.StartDate)); - add_webtable(wp, (char *)"First date", ctime(&nodes.StartDate)); - fprintf(fp, " Last date %s", ctime(&nodes.LastDate)); - add_webtable(wp, (char *)"Last date", ctime(&nodes.LastDate)); + tt = (time_t)nodes.StartDate; + fprintf(fp, " First date %s", ctime(&tt)); + add_webtable(wp, (char *)"First date", ctime(&tt)); + tt = (time_t)nodes.LastDate; + fprintf(fp, " Last date %s", ctime(&tt)); + add_webtable(wp, (char *)"Last date", ctime(&tt)); for (i = 0; i < 20; i++) if (nodes.Aka[i].zone) { fprintf(fp, " Aka %2d %s\n", i+1, aka2str(nodes.Aka[i])); @@ -1656,9 +1659,9 @@ int node_doc(FILE *fp, FILE *toc, int page) add_statcnt(wp, (char *)"sent messages", nodes.MailSent); fprintf(fp, " Statistics Send KBytes Received KBytes\n"); fprintf(fp, " ------------ -------- -------- -------- --------\n"); - fprintf(fp, " Total files %-8lu %-8lu %-8lu %-8lu\n", nodes.FilesSent.total, nodes.F_KbSent.total, + fprintf(fp, " Total files %-8u %-8u %-8u %-8u\n", nodes.FilesSent.total, nodes.F_KbSent.total, nodes.FilesRcvd.total, nodes.F_KbSent.total); - fprintf(fp, " Total mail %-8lu %-8lu\n\n", nodes.MailSent.total, nodes.MailRcvd.total); + fprintf(fp, " Total mail %-8u %-8u\n\n", nodes.MailSent.total, nodes.MailRcvd.total); fprintf(wp, "
\n"); fprintf(wp, "

Private data

\n"); diff --git a/mbsetup/m_ol.c b/mbsetup/m_ol.c index 60f4af94..0439d9fc 100644 --- a/mbsetup/m_ol.c +++ b/mbsetup/m_ol.c @@ -120,7 +120,7 @@ int OpenOneline(void) { FILE *fin, *fout; char fnin[PATH_MAX], fnout[PATH_MAX]; - long oldsize; + int oldsize; snprintf(fnin, PATH_MAX, "%s/etc/oneline.data", getenv("MBSE_ROOT")); snprintf(fnout, PATH_MAX, "%s/etc/oneline.temp", getenv("MBSE_ROOT")); @@ -216,9 +216,9 @@ int EditOnelRec(int Area) { FILE *fil; char mfile[PATH_MAX]; - long offset; + int offset; int j; - unsigned long crc, crc1; + unsigned int crc, crc1; clr_index(); working(1, 0, 0); @@ -294,7 +294,7 @@ void EditOneline(void) char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; clr_index(); working(1, 0, 0); diff --git a/mbsetup/m_protocol.c b/mbsetup/m_protocol.c index 82aeb774..e05dc3a6 100644 --- a/mbsetup/m_protocol.c +++ b/mbsetup/m_protocol.c @@ -179,7 +179,7 @@ int OpenProtocol(void) { FILE *fin, *fout; char fnin[PATH_MAX], fnout[PATH_MAX], newkey = 'A', *usedkeys; - long oldsize; + int oldsize; int AddInt = TRUE; snprintf(fnin, PATH_MAX, "%s/etc/protocol.data", getenv("MBSE_ROOT")); @@ -394,9 +394,9 @@ int EditProtRec(int Area) { FILE *fil; char mfile[PATH_MAX]; - long offset; + int offset; int j; - unsigned long crc, crc1; + unsigned int crc, crc1; clr_index(); working(1, 0, 0); @@ -508,7 +508,7 @@ void EditProtocol(void) char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; clr_index(); working(1, 0, 0); @@ -611,7 +611,7 @@ char *PickProtocol(int nr) char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; clr_index(); working(1, 0, 0); diff --git a/mbsetup/m_route.c b/mbsetup/m_route.c index 88327653..e851eb67 100644 --- a/mbsetup/m_route.c +++ b/mbsetup/m_route.c @@ -91,7 +91,7 @@ int OpenRoute(void) { FILE *fin, *fout; char *fnin, *fnout; - long oldsize; + int oldsize; fnin = calloc(PATH_MAX, sizeof(char)); fnout = calloc(PATH_MAX, sizeof(char)); @@ -310,8 +310,8 @@ int EditRouteRec(int Area) { FILE *fil; char *mfile, newmask[25]; - long offset; - unsigned long crc, crc1; + int offset; + unsigned int crc, crc1; int i; clr_index(); @@ -409,7 +409,7 @@ void EditRoute(void) int records, i, o, x, y; char pick[12], *temp; FILE *fil; - long offset; + int offset; clr_index(); working(1, 0, 0); diff --git a/mbsetup/m_service.c b/mbsetup/m_service.c index aea4e9f1..b13b34c0 100644 --- a/mbsetup/m_service.c +++ b/mbsetup/m_service.c @@ -110,7 +110,7 @@ int OpenService(void) { FILE *fin, *fout; char fnin[PATH_MAX], fnout[PATH_MAX]; - long oldsize; + int oldsize; snprintf(fnin, PATH_MAX, "%s/etc/service.data", getenv("MBSE_ROOT")); snprintf(fnout, PATH_MAX, "%s/etc/service.temp", getenv("MBSE_ROOT")); @@ -242,8 +242,8 @@ int EditServiceRec(int Area) { FILE *fil; char mfile[PATH_MAX]; - long offset; - unsigned long crc, crc1; + int offset; + unsigned int crc, crc1; clr_index(); working(1, 0, 0); @@ -313,7 +313,7 @@ void EditService(void) char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; clr_index(); working(1, 0, 0); diff --git a/mbsetup/m_task.c b/mbsetup/m_task.c index e212407c..dee54982 100644 --- a/mbsetup/m_task.c +++ b/mbsetup/m_task.c @@ -38,7 +38,7 @@ struct taskrec TCFG; -unsigned long crc1, crc2; +unsigned int crc1, crc2; diff --git a/mbsetup/m_ticarea.c b/mbsetup/m_ticarea.c index 5d97dac2..14e58a99 100644 --- a/mbsetup/m_ticarea.c +++ b/mbsetup/m_ticarea.c @@ -44,7 +44,7 @@ int TicUpdated = 0; -unsigned long TicCrc; +unsigned int TicCrc; FILE *ttfil = NULL; @@ -96,7 +96,7 @@ int OpenTicarea(void) { FILE *fin, *fout; char fnin[PATH_MAX], fnout[PATH_MAX]; - long oldsize, oldsys; + int oldsize, oldsys; struct _sysconnect syscon; int i, oldsystems; @@ -333,7 +333,7 @@ int EditTicConnections(FILE *); int EditTicConnections(FILE *fil) { int systems, o = 0, i, y, x; - long offset; + int offset; char pick[12]; sysconnect System; char status[4]; @@ -446,12 +446,12 @@ void SetTicScreen(void) -long LoadTicRec(int, int); -long LoadTicRec(int Area, int work) +int LoadTicRec(int, int); +int LoadTicRec(int Area, int work) { FILE *fil; char mfile[PATH_MAX]; - long offset; + int offset; sysconnect System; int i; @@ -496,7 +496,7 @@ int SaveTicRec(int Area, int work) { int i; FILE *fil; - long offset; + int offset; char mfile[PATH_MAX]; sysconnect System; @@ -557,7 +557,7 @@ void TicGlobal(void) fidoaddr a1, a2; int menu = 0, areanr, Areas, akan = 0, Found; int Total, Done; - long offset; + int offset; sysconnect S, Sc; securityrec as; @@ -811,7 +811,7 @@ void TicGlobal(void) int EditTicRec(int); int EditTicRec(int Area) { - unsigned long crc1; + unsigned int crc1; int tmp, i, connections = 0, changed = FALSE; sysconnect System; char *temp; @@ -833,11 +833,11 @@ int EditTicRec(int Area) fread(&areahdr, sizeof(areahdr), 1, fp); fseek(fp, ((tic.FileArea - 1) * areahdr.recsize) + areahdr.hdrsize, SEEK_SET); fread(&area, areahdr.recsize, 1, fp); - snprintf(temp, 81, "%ld: %s", tic.FileArea, area.Name); + snprintf(temp, 81, "%d: %s", tic.FileArea, area.Name); temp[24] = '\0'; fclose(fp); } else { - snprintf(temp, 81, "%ld", tic.FileArea); + snprintf(temp, 81, "%d", tic.FileArea); } set_color(WHITE, BLACK); @@ -1001,7 +1001,7 @@ void EditTicarea(void) char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; clr_index(); working(1, 0, 0); @@ -1113,7 +1113,7 @@ char *PickTicarea(char *shdr) char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; static char Buf[81]; clr_index(); @@ -1312,7 +1312,7 @@ int tic_areas_doc(FILE *fp, FILE *toc, int page) fread(&areahdr, sizeof(areahdr), 1, ti); fseek(ti, areahdr.hdrsize + (areahdr.recsize * (tic.FileArea -1)), SEEK_SET); if (fread(&area, areahdr.recsize, 1, ti) == 1) { - fprintf(wp, "BBS area%ld %s\n", + fprintf(wp, "BBS area%d %s\n", tic.FileArea, tic.FileArea, area.Name); } fclose(ti); @@ -1351,7 +1351,7 @@ int tic_areas_doc(FILE *fp, FILE *toc, int page) fprintf(fp, " Area tag %s\n", tic.Name); fprintf(fp, " Active %s\n", getboolean(tic.Active)); fprintf(fp, " Comment %s\n", tic.Comment); - fprintf(fp, " BBS area %ld\n", tic.FileArea); + fprintf(fp, " BBS area %d\n", tic.FileArea); fprintf(fp, " Message %s\n", tic.Message); fprintf(fp, " Group %s\n", tic.Group); fprintf(fp, " Keep Numbe %d\n", tic.KeepLatest); diff --git a/mbsetup/m_tty.c b/mbsetup/m_tty.c index 2fd443cf..cb4b79af 100644 --- a/mbsetup/m_tty.c +++ b/mbsetup/m_tty.c @@ -195,7 +195,7 @@ int OpenTtyinfo(void) { FILE *fin, *fout; char *fnin, *fnout; - long oldsize; + int oldsize; fnin = calloc(PATH_MAX, sizeof(char)); fnout = calloc(PATH_MAX, sizeof(char)); @@ -363,9 +363,9 @@ int EditTtyRec(int Area) { FILE *fil; char *mfile; - long offset; + int offset; int j; - unsigned long crc, crc1; + unsigned int crc, crc1; clr_index(); working(1, 0, 0); @@ -483,7 +483,7 @@ void EditTtyinfo(void) char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; clr_index(); working(1, 0, 0); @@ -657,7 +657,7 @@ int tty_doc(FILE *fp, FILE *toc, int page) fprintf(fp, " Honor ZMH %s\n", getboolean(ttyinfo.honor_zmh)); fprintf(fp, " Callout %s\n", getboolean(ttyinfo.callout)); fprintf(fp, " Modem type %s\n", ttyinfo.modem); - fprintf(fp, " Locked speed %ld\n", ttyinfo.portspeed); + fprintf(fp, " Locked speed %d\n", ttyinfo.portspeed); fprintf(fp, " EMSI name %s\n", ttyinfo.name); fprintf(fp, "\n\n"); j++; diff --git a/mbsetup/m_users.c b/mbsetup/m_users.c index cf5146ae..f853ea89 100644 --- a/mbsetup/m_users.c +++ b/mbsetup/m_users.c @@ -92,7 +92,7 @@ int OpenUsers(void) { FILE *fin, *fout; char fnin[PATH_MAX], fnout[PATH_MAX]; - long oldsize; + int oldsize; snprintf(fnin, PATH_MAX, "%s/etc/users.data", getenv("MBSE_ROOT")); snprintf(fnout, PATH_MAX, "%s/etc/users.temp", getenv("MBSE_ROOT")); @@ -480,9 +480,9 @@ int EditUsrRec(int Area) { FILE *fil; char mfile[PATH_MAX]; - long offset; + int offset; int j = 0; - unsigned long crc, crc1, level; + unsigned int crc, crc1, level; clr_index(); working(1, 0, 0); @@ -574,7 +574,7 @@ void EditUsers(void) char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; clr_index(); working(1, 0, 0); @@ -681,6 +681,7 @@ void users_doc(void) char temp[PATH_MAX]; FILE *wp, *ip, *fp; int nr = 0; + time_t tt; snprintf(temp, PATH_MAX, "%s/etc/users.data", getenv("MBSE_ROOT")); if ((fp = fopen(temp, "r")) == NULL) @@ -707,9 +708,12 @@ void users_doc(void) web_secflags(wp, (char *)"Security level", usrconfig.Security); add_webtable(wp, (char *)"Expiry date", usrconfig.sExpiryDate); web_secflags(wp, (char *)"Expiry security level", usrconfig.ExpirySec); - add_webtable(wp, (char *)"First login date", ctime(&usrconfig.tFirstLoginDate)); - add_webtable(wp, (char *)"Last login date", ctime(&usrconfig.tLastLoginDate)); - add_webtable(wp, (char *)"Last password change", ctime(&usrconfig.tLastPwdChange)); + tt = (time_t)usrconfig.tFirstLoginDate; + add_webtable(wp, (char *)"First login date", ctime(&tt)); + tt = (time_t)usrconfig.tLastLoginDate; + add_webtable(wp, (char *)"Last login date", ctime(&tt)); + tt = (time_t)usrconfig.tLastPwdChange; + add_webtable(wp, (char *)"Last password change", ctime(&tt)); add_webdigit(wp, (char *)"Credit", usrconfig.Credit); add_webtable(wp, (char *)"Hidden from lists", getboolean(usrconfig.Hidden)); add_webtable(wp, (char *)"Never delete", getboolean(usrconfig.NeverDelete)); diff --git a/mbsetup/m_virus.c b/mbsetup/m_virus.c index 69861938..559df8ba 100644 --- a/mbsetup/m_virus.c +++ b/mbsetup/m_virus.c @@ -139,7 +139,7 @@ int OpenVirus(void) { FILE *fin, *fout; char fnin[PATH_MAX], fnout[PATH_MAX]; - long oldsize; + int oldsize; snprintf(fnin, PATH_MAX, "%s/etc/virscan.data", getenv("MBSE_ROOT")); snprintf(fnout, PATH_MAX, "%s/etc/virscan.temp", getenv("MBSE_ROOT")); @@ -254,9 +254,9 @@ int EditVirRec(int Area) { FILE *fil; char mfile[PATH_MAX]; - long offset; + int offset; int j; - unsigned long crc, crc1; + unsigned int crc, crc1; clr_index(); working(1, 0, 0); @@ -338,7 +338,7 @@ void EditVirus(void) char pick[12]; FILE *fil; char temp[PATH_MAX]; - long offset; + int offset; clr_index(); working(1, 0, 0); diff --git a/mbsetup/mutil.c b/mbsetup/mutil.c index 1f2c1b00..bbc3d2a0 100644 --- a/mbsetup/mutil.c +++ b/mbsetup/mutil.c @@ -244,8 +244,8 @@ void add_statcnt(FILE *fp, char * hstr, statcnt st) fprintf(fp, "\n"); fprintf(fp, "Weekdays overview of %s\n", hstr); fprintf(fp, " SunMonTueWedThuFriSatTotal\n"); - fprintf(fp, "This week%ld%ld%ld%ld%ld%ld%ld%ld\n", st.tdow[0], st.tdow[1], st.tdow[2], st.tdow[3], st.tdow[4], st.tdow[5], st.tdow[6], st.tweek); - fprintf(fp, "Last week%ld%ld%ld%ld%ld%ld%ld%ld\n", st.ldow[0], st.ldow[1], st.ldow[2], st.ldow[3], st.ldow[4], st.ldow[5], st.ldow[6], st.lweek); + fprintf(fp, "This week%d%d%d%d%d%d%d%d\n", st.tdow[0], st.tdow[1], st.tdow[2], st.tdow[3], st.tdow[4], st.tdow[5], st.tdow[6], st.tweek); + fprintf(fp, "Last week%d%d%d%d%d%d%d%d\n", st.ldow[0], st.ldow[1], st.ldow[2], st.ldow[3], st.ldow[4], st.ldow[5], st.ldow[6], st.lweek); fprintf(fp, "\n"); fprintf(fp, "\n"); fprintf(fp, "

\n"); @@ -253,7 +253,7 @@ void add_statcnt(FILE *fp, char * hstr, statcnt st) fprintf(fp, "\n"); fprintf(fp, "Monthly overview of %sTotal ever\n", hstr); fprintf(fp, "JanFebMarAprMayJunJulAugSepOctNovDec\n"); - fprintf(fp, "%ld%ld%ld%ld%ld%ld%ld%ld%ld%ld%ld%ld%ld\n", + fprintf(fp, "%d%d%d%d%d%d%d%d%d%d%d%d%d\n", st.month[0], st.month[1], st.month[2], st.month[3], st.month[4], st.month[5], st.month[6], st.month[7], st.month[8], st.month[0], st.month[10], st.month[11], st.total); fprintf(fp, "\n"); fprintf(fp, "\n"); diff --git a/mbsetup/stlist.c b/mbsetup/stlist.c index 7061c29e..7dc76596 100644 --- a/mbsetup/stlist.c +++ b/mbsetup/stlist.c @@ -53,7 +53,7 @@ void tidy_stlist(st_list ** fdp) /* * Add a string to the array */ -void fill_stlist(st_list **fdp, char *stringname, long pos) +void fill_stlist(st_list **fdp, char *stringname, int pos) { st_list *tmp; diff --git a/mbsetup/stlist.h b/mbsetup/stlist.h index 4e08f459..831a03d2 100644 --- a/mbsetup/stlist.h +++ b/mbsetup/stlist.h @@ -1,15 +1,17 @@ #ifndef _STLIST_H #define _STLIST_H +/* $Id$ */ + typedef struct _st_list { struct _st_list *next; char string[81]; - long pos; + int pos; } st_list; void tidy_stlist(st_list **); -void fill_stlist(st_list **, char *, long); +void fill_stlist(st_list **, char *, int); void sort_stlist(st_list **); diff --git a/mbtask/calllist.h b/mbtask/calllist.h index 7b6dc198..5ed47d2a 100644 --- a/mbtask/calllist.h +++ b/mbtask/calllist.h @@ -14,9 +14,9 @@ typedef struct _tocall { callstat cst; /* Last call status */ int calling; /* Is calling */ pid_t taskpid; /* Task pid number */ - unsigned long moflags; /* Modem flags */ - unsigned long diflags; /* ISDN flags */ - unsigned long ipflags; /* TCP/IP flags */ + unsigned int moflags; /* Modem flags */ + unsigned int diflags; /* ISDN flags */ + unsigned int ipflags; /* TCP/IP flags */ } tocall; diff --git a/mbtask/crc.c b/mbtask/crc.c index 4265dba0..60af5f0e 100644 --- a/mbtask/crc.c +++ b/mbtask/crc.c @@ -4,7 +4,7 @@ * Purpose ...............: Crc32 calculations * ***************************************************************************** - * Copyright (C) 1993-2004 + * Copyright (C) 1993-2005 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -70,7 +70,7 @@ /* using byte-swap instructions. */ -unsigned long crc32tab[] = { /* CRC polynomial 0xedb88320 */ +unsigned int crc32tab[] = { /* CRC polynomial 0xedb88320 */ 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, @@ -108,9 +108,9 @@ unsigned long crc32tab[] = { /* CRC polynomial 0xedb88320 */ -unsigned long StringCRC32(char *str) +unsigned int StringCRC32(char *str) { - unsigned long crc; + unsigned int crc; for (crc = 0xffffffff; *str; str++) crc = crc32tab[((int)crc^(*str)) & 0xff] ^ ((crc>>8) & 0x00ffffff); diff --git a/mbtask/outstat.c b/mbtask/outstat.c index 35c31376..dc3e533f 100644 --- a/mbtask/outstat.c +++ b/mbtask/outstat.c @@ -96,15 +96,15 @@ int load_node(fidoaddr n) -char *size_str(long); -char *size_str(long size) +char *size_str(int); +char *size_str(int size) { static char fmt[25]; if (size > 1048575) { - snprintf(fmt, 25, "%ldK", size / 1024); + snprintf(fmt, 25, "%dK", size / 1024); } else { - snprintf(fmt, 25, "%ld ", size); + snprintf(fmt, 25, "%d ", size); } return fmt; } @@ -268,7 +268,7 @@ int outstat() DIR *dp = NULL; struct dirent *de; struct stat sb; - unsigned long ibnmask = 0, ifcmask = 0, itnmask = 0; + unsigned int ibnmask = 0, ifcmask = 0, itnmask = 0; nodelist_modem **tmpm; for (tmpm = &nl_tcpip; *tmpm; tmpm=&((*tmpm)->next)) { diff --git a/mbtask/outstat.h b/mbtask/outstat.h index f6a46133..f3e14c6d 100644 --- a/mbtask/outstat.h +++ b/mbtask/outstat.h @@ -21,10 +21,10 @@ typedef struct _alist time_t time; /* Date/time of mail/files */ off_t size; /* Total size of mail/files */ callstat cst; /* Last call status */ - unsigned long olflags; /* Nodelist online flags */ - unsigned long moflags; /* Nodelist modem flags */ - unsigned long diflags; /* Nodelist ISDN flags */ - unsigned long ipflags; /* Nodelist TCP/IP flags */ + unsigned int olflags; /* Nodelist online flags */ + unsigned int moflags; /* Nodelist modem flags */ + unsigned int diflags; /* Nodelist ISDN flags */ + unsigned int ipflags; /* Nodelist TCP/IP flags */ int t1; /* First Txx flag */ int t2; /* Second Txx flag */ int callmode; /* Call method */ diff --git a/mbtask/ping.c b/mbtask/ping.c index bdb92df7..62cc187a 100644 --- a/mbtask/ping.c +++ b/mbtask/ping.c @@ -161,7 +161,7 @@ int ping_send(struct in_addr addr) struct protoent *pe; int SOL_IP; #endif - unsigned long sum; + unsigned int sum; unsigned short *ptr; #ifndef __linux__ @@ -269,7 +269,7 @@ int ping_receive(struct in_addr addr) if (len > sizeof(struct iphdr)) { memcpy(&iph, buf, sizeof(iph)); if (len - iph.ip_hl * 4 >= ICMP_BASEHDR_LEN) { - memcpy(&icmpp, ((unsigned long int *)buf)+iph.ip_hl, sizeof(icmpp)); + memcpy(&icmpp, ((uint32_t *)buf)+iph.ip_hl, sizeof(icmpp)); if (iph.ip_saddr == addr.s_addr && icmpp.icmp_type == ICMP_ECHOREPLY && ntohs(icmpp.icmp_id) == id && ntohs(icmpp.icmp_seq) == p_sequence) { return 0; diff --git a/mbtask/ports.h b/mbtask/ports.h index 1bb5ed8c..3d5f6795 100644 --- a/mbtask/ports.h +++ b/mbtask/ports.h @@ -11,10 +11,10 @@ typedef struct _pp_list { struct _pp_list *next; char tty[7]; /* tty name of the port */ - unsigned long mflags; /* Analogue modem flags */ - unsigned long dflags; /* ISDN flags */ + unsigned int mflags; /* Analogue modem flags */ + unsigned int dflags; /* ISDN flags */ int locked; /* If port is locked */ - long locktime; /* Time it is locked */ + int locktime; /* Time it is locked */ } pp_list; diff --git a/mbtask/taskdisk.c b/mbtask/taskdisk.c index 4adc6715..d2c1fa8e 100644 --- a/mbtask/taskdisk.c +++ b/mbtask/taskdisk.c @@ -38,8 +38,8 @@ typedef struct _mfs_list { struct _mfs_list *next; /* Linked list */ char *mountpoint; /* Mountpoint */ char *fstype; /* FS type */ - unsigned long size; /* Size in MB */ - unsigned long avail; /* Available in MB */ + unsigned int size; /* Size in MB */ + unsigned int avail; /* Available in MB */ unsigned ro : 1; /* Read-Only fs. */ } mfs_list; @@ -253,7 +253,7 @@ char *disk_check(char *token) { static char buf[SS_BUFSIZE]; mfs_list *tmp; - unsigned long needed, lowest = 0xffffffff; + unsigned int needed, lowest = 0xffffffff; int rc; strtok(token, ","); @@ -279,9 +279,9 @@ char *disk_check(char *token) Syslog('!', "disk_check() mutex_unlock failed rc=%d", rc); if (lowest < needed) { - snprintf(buf, SS_BUFSIZE, "100:2,0,%ld;", lowest); + snprintf(buf, SS_BUFSIZE, "100:2,0,%d;", lowest); } else { - snprintf(buf, SS_BUFSIZE, "100:2,1,%ld;", lowest); + snprintf(buf, SS_BUFSIZE, "100:2,1,%d;", lowest); } return buf; } @@ -315,7 +315,7 @@ char *disk_getfs() else ans = xstrcat(ans, (char *)","); tt[0] = '\0'; - snprintf(tt, 80, "%lu %lu %s %s %d", tmp->size, tmp->avail, tmp->mountpoint, tmp->fstype, tmp->ro); + snprintf(tt, 80, "%u %u %s %s %d", tmp->size, tmp->avail, tmp->mountpoint, tmp->fstype, tmp->ro); ans = xstrcat(ans, tt); if (i == 10) /* No more then 10 filesystems */ break; @@ -343,14 +343,14 @@ char *disk_getfs() void update_diskstat(void) { struct statfs sfs; - unsigned long temp; + unsigned int temp; mfs_list *tmp; for (tmp = mfs; tmp; tmp = tmp->next) { if (statfs(tmp->mountpoint, &sfs) == 0) { - temp = (unsigned long)(sfs.f_bsize / 512L); - tmp->size = (unsigned long)(sfs.f_blocks * temp) / 2048L; - tmp->avail = (unsigned long)(sfs.f_bavail * temp) / 2048L; + temp = (unsigned int)(sfs.f_bsize / 512L); + tmp->size = (unsigned int)(sfs.f_blocks * temp) / 2048L; + tmp->avail = (unsigned int)(sfs.f_bavail * temp) / 2048L; #if defined(__linux__) /* * The struct statfs (or statvfs) seems to have no information @@ -385,7 +385,7 @@ void add_path(char *lpath) FILE *fp; #elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) struct statfs *mntbuf; - long mntsize; + int mntsize; int i; #else #error "Don't know how to get mount paths" diff --git a/mbtask/taskibc.c b/mbtask/taskibc.c index fbfa31fd..72727a17 100644 --- a/mbtask/taskibc.c +++ b/mbtask/taskibc.c @@ -895,7 +895,7 @@ int command_server(char *hostname, char *parameters) usr_list *tmp; chn_list *tmpc; char *name, *hops, *id, *prod, *vers, *fullname; - unsigned long token; + unsigned int token; int ihops, found = FALSE; name = strtok(parameters, " \0"); diff --git a/mbtask/taskibc.h b/mbtask/taskibc.h index 19ce3fca..b331b8d2 100644 --- a/mbtask/taskibc.h +++ b/mbtask/taskibc.h @@ -22,7 +22,7 @@ typedef struct _ncs_list { unsigned gotserver : 1; /* Received valid server */ struct sockaddr_in servaddr_in; /* Peer socketaddress */ int socket; /* Peer socket */ - unsigned long token; /* Server token */ + unsigned int token; /* Server token */ } ncs_list; diff --git a/mbtask/taskinfo.c b/mbtask/taskinfo.c index ea055b96..1c17dd2c 100644 --- a/mbtask/taskinfo.c +++ b/mbtask/taskinfo.c @@ -56,7 +56,7 @@ char *get_sysinfo(void) if (fread(&SYSINFO, sizeof(SYSINFO), 1, fp) == 1) { startdate = SYSINFO.StartDate; - snprintf(buf, SS_BUFSIZE, "100:7,%ld,%ld,%ld,%ld,%ld,%s,%s;", SYSINFO.SystemCalls, + snprintf(buf, SS_BUFSIZE, "100:7,%d,%d,%d,%d,%d,%s,%s;", SYSINFO.SystemCalls, SYSINFO.Pots, SYSINFO.ISDN, SYSINFO.Network, SYSINFO.Local, ctime(&startdate), SYSINFO.LastCaller); } @@ -131,7 +131,7 @@ char *get_lastcallerrec(int Rec) action[8] = '\0'; snprintf(buf, SS_BUFSIZE, "100:9,%s,%s,%d,%s,%s,%d,%d,%s,%s;", LCALL.UserName, LCALL.Location, LCALL.SecLevel, LCALL.Device, LCALL.TimeOn, - LCALL.CallTime, LCALL.Calls, LCALL.Speed, action); + (int)LCALL.CallTime, LCALL.Calls, LCALL.Speed, action); } free(temp); diff --git a/mbtask/taskstat.c b/mbtask/taskstat.c index e6d225dd..741fde9f 100644 --- a/mbtask/taskstat.c +++ b/mbtask/taskstat.c @@ -63,23 +63,23 @@ extern int ZMH; typedef struct { - long tot_clt; /* Total client connects */ - long peak_clt; /* Peak simultaneous tot_cltes */ - long s_error; /* Syntax errors from clients */ - long c_error; /* Comms errors from clients */ + int tot_clt; /* Total client connects */ + int peak_clt; /* Peak simultaneous tot_cltes */ + int s_error; /* Syntax errors from clients */ + int c_error; /* Comms errors from clients */ } cl_stat; typedef struct { - time_t start; /* Start date/time */ - time_t laststart; /* Last start date/time */ - time_t daily; /* Last daily update */ - long startups; /* Total starts */ - long clients; /* Connected clients */ + int start; /* Start date/time */ + int laststart; /* Last start date/time */ + int daily; /* Last daily update */ + int startups; /* Total starts */ + int clients; /* Connected clients */ cl_stat total; /* Total statistics */ cl_stat today; /* Todays statistics */ unsigned open : 1; /* Is BBS open */ - unsigned long sequence; /* Sequencer counter */ + unsigned int sequence; /* Sequencer counter */ } status_r; @@ -114,7 +114,7 @@ void status_init() memset((char *)&status, 0, sizeof(status_r)); status.start = time(NULL); status.daily = time(NULL); - status.sequence = (unsigned long)time(NULL); + status.sequence = (unsigned int)time(NULL); stat_fd = open(stat_fn, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR); cnt = write(stat_fd, &status, sizeof(status_r)); Syslog('+', "New statusfile created"); @@ -319,8 +319,8 @@ char *stat_status() chncnt++; for (tmpu = users; tmpu; tmpu = tmpu->next) usrcnt++; - snprintf(buf, 160, "100:23,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%ld,%d,%d,%d,%d,%d,%2.2f,%lu,%d,%d,%d;", - (long)status.start, (long)status.laststart, (long)status.daily, + snprintf(buf, 160, "100:23,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%2.2f,%u,%d,%d,%d;", + (int)status.start, (int)status.laststart, (int)status.daily, status.startups, status.clients, status.total.tot_clt, status.total.peak_clt, status.total.s_error, status.total.c_error, @@ -360,13 +360,13 @@ char *getseq(void) buf[0] = '\0'; status.sequence++; status_write(); - snprintf(buf, 80, "100:1,%lu;", status.sequence); + snprintf(buf, 80, "100:1,%u;", status.sequence); return buf; } -unsigned long gettoken(void) +unsigned int gettoken(void) { status.sequence++; status_write(); diff --git a/mbtask/taskstat.h b/mbtask/taskstat.h index 5a742a41..665286d8 100644 --- a/mbtask/taskstat.h +++ b/mbtask/taskstat.h @@ -17,7 +17,7 @@ void stat_inc_cerr(void); /* Increase comms error */ char *stat_status(void); /* Return status record */ int stat_bbs_stat(void); /* Get BBS open status */ char *getseq(void); /* Get next sequence number */ -unsigned long gettoken(void); /* Get next sequence number */ +unsigned int gettoken(void); /* Get next sequence number */ int get_zmh(void); /* Check Zone Mail Hour */ int sem_set(char *, int); /* Set/Reset semafore */ char *sem_status(char *); /* Get semafore status */ diff --git a/mbtask/taskutil.c b/mbtask/taskutil.c index 74fd5577..01532292 100644 --- a/mbtask/taskutil.c +++ b/mbtask/taskutil.c @@ -42,7 +42,7 @@ extern struct sysconfig CFG; extern struct _fidonethdr fidonethdr; extern struct _fidonet fidonet; extern struct taskrec TCFG; -unsigned long lcrc = 0, tcrc = 1; +unsigned int lcrc = 0, tcrc = 1; int lcnt = 0, lchr; static char *pbuff = NULL; @@ -409,7 +409,7 @@ int mkdirs(char *name, mode_t mode) /* * Return size of file, or -1 if file doesn't exist */ -long file_size(char *path) +int file_size(char *path) { static struct stat sb; diff --git a/mbtask/taskutil.h b/mbtask/taskutil.h index 2494b9b5..2d9be291 100644 --- a/mbtask/taskutil.h +++ b/mbtask/taskutil.h @@ -33,7 +33,7 @@ void RemoveSema(char *); int IsSema(char *); int file_exist(char *, int); int mkdirs(char *, mode_t); -long file_size(char *); +int file_size(char *); time_t file_time(char *); char *ascfnode(faddr *, int); char *fido2str(fidoaddr, int); diff --git a/mbutils/mball.c b/mbutils/mball.c index efe66a2c..63518dd5 100644 --- a/mbutils/mball.c +++ b/mbutils/mball.c @@ -272,8 +272,8 @@ void Masterlist() { FILE *fp, *np, *pAreas, *pHeader; int AreaNr = 0, z, x = 0, New; - unsigned long AllFiles = 0, AllKBytes = 0, NewFiles = 0, NewKBytes = 0; - unsigned long AllAreaFiles, AllAreaBytes, popdown, down, NewAreaFiles, NewAreaBytes; + unsigned int AllFiles = 0, AllKBytes = 0, NewFiles = 0, NewKBytes = 0; + unsigned int AllAreaFiles, AllAreaBytes, popdown, down, NewAreaFiles, NewAreaBytes; char *sAreas, temp[PATH_MAX], pop[81]; struct _fdbarea *fdb_area = NULL; @@ -381,9 +381,9 @@ void Masterlist() MidLine(temp, fp, area.FileReq); MidLine(temp, np, area.FileReq && NewAreaFiles); - snprintf(temp, 81, "%ld KBytes in %ld files", AllAreaBytes / 1024, AllAreaFiles); + snprintf(temp, 81, "%d KBytes in %d files", AllAreaBytes / 1024, AllAreaFiles); MidLine(temp, fp, TRUE); - snprintf(temp, 81, "%ld KBytes in %ld files", NewAreaBytes / 1024, NewAreaFiles); + snprintf(temp, 81, "%d KBytes in %d files", NewAreaBytes / 1024, NewAreaFiles); MidLine(temp, np, NewAreaFiles); if (popdown) { snprintf(temp, 81, "Most popular file is %s", pop); @@ -397,8 +397,8 @@ void Masterlist() while (fread(&fdb, fdbhdr.recsize, 1, fdb_area->fp) == 1) { if (!fdb.Deleted) { New = (((t_start - fdb.UploadDate) / 84400) <= CFG.newdays); - snprintf(temp, 81, "%-12s%10lu K %s [%04ld] Uploader: %s", - fdb.Name, (long)(fdb.Size / 1024), StrDateDMY(fdb.UploadDate), fdb.TimesDL, + snprintf(temp, 81, "%-12s%10u K %s [%04d] Uploader: %s", + fdb.Name, (int)(fdb.Size / 1024), StrDateDMY(fdb.UploadDate), fdb.TimesDL, strlen(fdb.Uploader)?fdb.Uploader:""); fprintf(fp, "%s\r\n", temp); if (New) @@ -434,9 +434,9 @@ void Masterlist() TopBox(fp, TRUE); TopBox(np, TRUE); - snprintf(temp, 81, "Total %ld files, %ld KBytes", AllFiles, AllKBytes); + snprintf(temp, 81, "Total %d files, %d KBytes", AllFiles, AllKBytes); MidLine(temp, fp, TRUE); - snprintf(temp, 81, "Total %ld files, %ld KBytes", NewFiles, NewKBytes); + snprintf(temp, 81, "Total %d files, %d KBytes", NewFiles, NewKBytes); MidLine(temp, np, TRUE); MidLine((char *)"", fp, TRUE); diff --git a/mbutils/mbtoberep.c b/mbutils/mbtoberep.c index efbe4956..27e6ccf1 100644 --- a/mbutils/mbtoberep.c +++ b/mbutils/mbtoberep.c @@ -39,6 +39,7 @@ int main(int argc, char **argv) FILE *fp; struct _filerecord rep; int i; + time_t tt; if ((BBSpath = getenv("MBSE_ROOT")) == NULL) { printf("MBSE_ROOT variable not set\n"); @@ -60,9 +61,10 @@ int main(int argc, char **argv) printf("Group %s\n", rep.Group); printf("Short name %s\n", rep.Name); printf("Long name %s\n", rep.LName); - printf("File size %lu\n", (long)(rep.Size)); - printf("File size Kb %lu\n", rep.SizeKb); - printf("File date %s", ctime(&rep.Fdate)); + printf("File size %u\n", (int)rep.Size); + printf("File size Kb %u\n", rep.SizeKb); + tt = (time_t)rep.Fdate; + printf("File date %s", ctime(&tt)); printf("File CRC %s\n", rep.Crc); printf("Origin system %s\n", rep.Origin); printf("From system %s\n", rep.From); diff --git a/mbutils/mbuser.c b/mbutils/mbuser.c index a0a3e117..edb733b4 100644 --- a/mbutils/mbuser.c +++ b/mbutils/mbuser.c @@ -175,7 +175,7 @@ void UserPack(int days, int level, int pack) { FILE *fin, *fout; char *fnin, *fnout, *cmd; - long oldsize, curpos; + int oldsize, curpos; int updated, delete = 0, rc, highest = 0, record = 0, sysop = FALSE; time_t Last;