From b1157ad1ecd2048249fd0e6018cba600c7bd3c84 Mon Sep 17 00:00:00 2001 From: deuce <> Date: Wed, 19 Oct 2011 04:07:46 +0000 Subject: [PATCH] Fix warnings and make curchannel unsigned. --- src/doors/top/global.c | 4 ++-- src/doors/top/main.c | 2 +- src/doors/top/moderate.c | 4 ++-- src/doors/top/top.h | 4 ++-- src/doors/top/topact.c | 8 ++++---- src/doors/top/topmaint.c | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/doors/top/global.c b/src/doors/top/global.c index 2dc8ee1b0b..b848ed3d36 100644 --- a/src/doors/top/global.c +++ b/src/doors/top/global.c @@ -29,7 +29,7 @@ contains comments describing each variable. #define TOP_REVISION "A321" /* Borland global variable that sets the stack size. */ -extern unsigned _stklen = 8192L; +unsigned _stklen = 8192L; /* Variables below are mostly listed in the order added to TOP. */ @@ -101,7 +101,7 @@ XINT usedcmdlen = 0; a binary node configuration file. */ XINT nodecfgfil = -1; /* Current channel the user is on. */ -long curchannel = 0; +unsigned long curchannel = 0; /* getword functions return buffer. */ unsigned char *wordret = NULL; /* Node index data for this node. */ diff --git a/src/doors/top/main.c b/src/doors/top/main.c index 67915232a5..c2f783b46b 100644 --- a/src/doors/top/main.c +++ b/src/doors/top/main.c @@ -37,7 +37,7 @@ in Win32) and the main input loop. Notes: This function never returns. exit() is always used to quit TOP. */ #ifndef __WIN32__ -extern void main(XINT ac, char *av[]) +extern int main(XINT ac, char *av[]) #else extern int pascal WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdParam, int nCmdShow) diff --git a/src/doors/top/moderate.c b/src/doors/top/moderate.c index 4771977fa6..016d86a2dc 100644 --- a/src/doors/top/moderate.c +++ b/src/doors/top/moderate.c @@ -158,7 +158,7 @@ void mod_proc(void) /* The user can't ban in a personal channel. The test is done using hardcoded internal channel numbers but probably should use the CHAN_ channel type constants instead. */ - if (curchannel >= 4000000000 && curchannel <= 4000999999 && + if (curchannel >= 4000000000UL && curchannel <= 4000999999UL && baninvflg >= 1 && baninvflg <= 2) { top_output(OUT_SCREEN, getlang("CantBanFromHere")); @@ -166,7 +166,7 @@ void mod_proc(void) } /* The user can't invite in normal channels or conferences. Again the test uses hardcoded channel numbers. */ - if ((curchannel <= 3999999999 || curchannel >= 4001000000) && + if ((curchannel <= 3999999999UL || curchannel >= 4001000000UL) && baninvflg >= 3 && baninvflg <= 4) { top_output(OUT_SCREEN, getlang("CantInvFromHere")); diff --git a/src/doors/top/top.h b/src/doors/top/top.h index 324b3a732e..82e4b3ff7f 100644 --- a/src/doors/top/top.h +++ b/src/doors/top/top.h @@ -540,7 +540,7 @@ typedef struct file_stats_str //|#include "toppoker.h" #ifndef __WIN32__ -extern void main(XINT ac, char *av[]); +extern int main(XINT ac, char *av[]); #else extern int pascal WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdParam, int nCmdShow); @@ -772,7 +772,7 @@ extern XINT lowestnode; extern lang_text_typ XFAR **langptrs; extern XINT usedcmdlen; extern XINT nodecfgfil; -extern long curchannel; +extern unsigned long curchannel; extern unsigned char *wordret; extern long numlang; extern node_idx_typ *node; diff --git a/src/doors/top/topact.c b/src/doors/top/topact.c index 5b387db020..443df582fa 100644 --- a/src/doors/top/topact.c +++ b/src/doors/top/topact.c @@ -71,13 +71,13 @@ typedef struct unsigned char *pluraltext; } action_ptr_typ; -void main(XINT argc, char *argv[]); +int main(XINT argc, char *argv[]); void actfile_compile(unsigned char *ifname, unsigned char *ofname); unsigned char loadbuf[513]; unsigned char iname[256], oname[256]; -void main(XINT argc, char *argv[]) +int main(XINT argc, char *argv[]) { printf("\nTOPACT - Action Compiler for TOP 2.00.\n\n"); @@ -93,7 +93,7 @@ void main(XINT argc, char *argv[]) printf("be used. If <outfile> is not specified, the\n " "base name of <infile> will be used with the extension of " ".TAC.\n"); - exit(0); + return(0); } strcpy(iname, argv[1]); @@ -123,7 +123,7 @@ void main(XINT argc, char *argv[]) actfile_compile(iname, oname); - exit(0); + return(0); } diff --git a/src/doors/top/topmaint.c b/src/doors/top/topmaint.c index daad0f065d..d78613e41f 100644 --- a/src/doors/top/topmaint.c +++ b/src/doors/top/topmaint.c @@ -16,7 +16,7 @@ user_data_typ ubuf; -void main(XINT argc, char *argv[]); +int main(XINT argc, char *argv[]); void showcmdline(XINT cmd); void deleteuser(char *nam); void packusers(void); @@ -24,7 +24,7 @@ void purgeusers(unsigned XINT sec, unsigned XINT days); XINT calc_days_ago(XDATE *lastdate); void setusersec(unsigned XINT sec, char *nam); -void main(XINT argc, char *argv[]) +int main(XINT argc, char *argv[]) { XINT d; -- GitLab