From 8ee6f4c6311fe18a4f32c147d53475d831932d2a Mon Sep 17 00:00:00 2001 From: Manvendra Bhangui Date: Thu, 28 Dec 2023 23:46:39 +0530 Subject: [PATCH] fixed compiler warnings --- ezmlm-x/TARGETS | 1 - ezmlm-x/ezmlm-list.c | 2 +- ezmlm-x/ezmlm-make.c | 2 +- ezmlm-x/ezmlm-manage.c | 3 ++- ezmlm-x/ezmlm-reject.c | 2 +- ezmlm-x/ezmlm-return.c | 2 +- ezmlm-x/ezmlm-send.c | 3 ++- ezmlm-x/ezmlm-sub.c | 4 ++-- ezmlm-x/ezmlm-unsub.c | 4 ++-- ezmlm-x/ezmlm-warn.c | 4 ++-- ezmlm-x/ezmlm-weed.c | 2 +- ezmlm-x/install.c | 7 +++---- ezmlm-x/log.c | 5 ++--- 13 files changed, 20 insertions(+), 21 deletions(-) diff --git a/ezmlm-x/TARGETS b/ezmlm-x/TARGETS index 54f80d2..7ed7de8 100644 --- a/ezmlm-x/TARGETS +++ b/ezmlm-x/TARGETS @@ -18,7 +18,6 @@ ezmlm-sub ezmlm-unsub ezmlm-warn ezmlm-weed -ezmlm.spec find-systype load make-compile diff --git a/ezmlm-x/ezmlm-list.c b/ezmlm-x/ezmlm-list.c index c4f02b4..486a1fa 100644 --- a/ezmlm-x/ezmlm-list.c +++ b/ezmlm-x/ezmlm-list.c @@ -22,7 +22,7 @@ stralloc line = {0}; char fn[14] = "subscribers/?"; -void main(argc,argv) +int main(argc,argv) int argc; char **argv; { diff --git a/ezmlm-x/ezmlm-make.c b/ezmlm-x/ezmlm-make.c index d8651fb..8040c23 100644 --- a/ezmlm-x/ezmlm-make.c +++ b/ezmlm-x/ezmlm-make.c @@ -131,7 +131,7 @@ void ezfclose() keyaddtime(); } -void main(argc,argv) +int main(argc,argv) int argc; char **argv; { diff --git a/ezmlm-x/ezmlm-manage.c b/ezmlm-x/ezmlm-manage.c index 1aa02ae..7b60f85 100644 --- a/ezmlm-x/ezmlm-manage.c +++ b/ezmlm-x/ezmlm-manage.c @@ -132,7 +132,7 @@ char *fn; stralloc mydtline = {0}; -void main(argc,argv) +int main(argc,argv) int argc; char **argv; { @@ -403,4 +403,5 @@ char **argv; /* don't worry about undoing actions; everything is idempotent */ strerr_die2x(111,FATAL,"temporary qmail-queue error"); } + return 0; } diff --git a/ezmlm-x/ezmlm-reject.c b/ezmlm-x/ezmlm-reject.c index 8788bea..43782ad 100644 --- a/ezmlm-x/ezmlm-reject.c +++ b/ezmlm-x/ezmlm-reject.c @@ -16,7 +16,7 @@ char buf0[256]; substdio ss0 = SUBSTDIO_FDBUF(read,0,buf0,sizeof(buf0)); stralloc line = {0}; -void main(argc,argv) +int main(argc,argv) int argc; char **argv; { diff --git a/ezmlm-x/ezmlm-return.c b/ezmlm-x/ezmlm-return.c index 2ff8d1f..39c7f6b 100644 --- a/ezmlm-x/ezmlm-return.c +++ b/ezmlm-x/ezmlm-return.c @@ -186,7 +186,7 @@ stralloc outlocal = {0}; char msginbuf[1024]; substdio ssmsgin; -void main(argc,argv) +int main(argc,argv) int argc; char **argv; { diff --git a/ezmlm-x/ezmlm-send.c b/ezmlm-x/ezmlm-send.c index deb68fd..2949fbe 100644 --- a/ezmlm-x/ezmlm-send.c +++ b/ezmlm-x/ezmlm-send.c @@ -138,7 +138,7 @@ void numwrite() stralloc mydtline = {0}; -void main(argc,argv) +int main(argc,argv) int argc; char **argv; { @@ -320,4 +320,5 @@ char **argv; numwrite(); strerr_die2x(111,FATAL,"temporary qmail-queue error"); } + return 0; } diff --git a/ezmlm-x/ezmlm-sub.c b/ezmlm-x/ezmlm-sub.c index 82878c2..62160bf 100644 --- a/ezmlm-x/ezmlm-sub.c +++ b/ezmlm-x/ezmlm-sub.c @@ -6,7 +6,7 @@ #define FATAL "ezmlm-sub: fatal: " #define WARNING "ezmlm-sub: warning: " -void main(argc,argv) +int main(argc,argv) int argc; char **argv; { @@ -20,7 +20,7 @@ char **argv; strerr_die4sys(111,FATAL,"unable to switch to ",dir,": "); argv += 2; - while (addr = *argv++) + while ((addr = *argv++)) switch(subscribe(addr,1)) { case -1: strerr_die1(111,FATAL,&subscribe_err); diff --git a/ezmlm-x/ezmlm-unsub.c b/ezmlm-x/ezmlm-unsub.c index 16d646d..a078613 100644 --- a/ezmlm-x/ezmlm-unsub.c +++ b/ezmlm-x/ezmlm-unsub.c @@ -6,7 +6,7 @@ #define FATAL "ezmlm-unsub: fatal: " #define WARNING "ezmlm-unsub: warning: " -void main(argc,argv) +int main(argc,argv) int argc; char **argv; { @@ -20,7 +20,7 @@ char **argv; strerr_die4sys(111,FATAL,"unable to switch to ",dir,": "); argv += 2; - while (addr = *argv++) + while ((addr = *argv++)) switch(subscribe(addr,0)) { case -1: strerr_die1(111,FATAL,&subscribe_err); diff --git a/ezmlm-x/ezmlm-warn.c b/ezmlm-x/ezmlm-warn.c index ffc4c9e..abe01e8 100644 --- a/ezmlm-x/ezmlm-warn.c +++ b/ezmlm-x/ezmlm-warn.c @@ -190,7 +190,7 @@ int flagw; strerr_die6sys(111,FATAL,"unable to remove ",dir,"/",fn.s,": "); } -void main(argc,argv) +int main(argc,argv) int argc; char **argv; { @@ -229,7 +229,7 @@ char **argv; if (!bouncedir) strerr_die4sys(111,FATAL,"unable to open ",dir,"/bounce: "); - while (d = readdir(bouncedir)) { + while ((d = readdir(bouncedir))) { if (str_equal(d->d_name,".")) continue; if (str_equal(d->d_name,"..")) continue; diff --git a/ezmlm-x/ezmlm-weed.c b/ezmlm-x/ezmlm-weed.c index d0bd615..e61c189 100644 --- a/ezmlm-x/ezmlm-weed.c +++ b/ezmlm-x/ezmlm-weed.c @@ -41,7 +41,7 @@ int flagsr = 0; int flagas = 0; int flagbw = 0; -void main() +int main() { for (;;) { get(&line); diff --git a/ezmlm-x/install.c b/ezmlm-x/install.c index cd55d40..6919462 100644 --- a/ezmlm-x/install.c +++ b/ezmlm-x/install.c @@ -145,10 +145,8 @@ char buf[256]; substdio in = SUBSTDIO_FDBUF(read, 0, buf, sizeof (buf)); stralloc line = { 0 }; -void -main(argc, argv) - int argc; - char **argv; +int +main(int argc, char **argv) { int match; @@ -164,4 +162,5 @@ main(argc, argv) if (!match) _exit(0); } + return 0; } diff --git a/ezmlm-x/log.c b/ezmlm-x/log.c index d6d6386..7e51549 100644 --- a/ezmlm-x/log.c +++ b/ezmlm-x/log.c @@ -22,14 +22,13 @@ char *addr; if (!stralloc_cats(&line," ")) return; if (!stralloc_cats(&line,event)) return; if (!stralloc_cats(&line," ")) return; - while (ch = *addr++) { + while ((ch = *addr++)) { if ((ch < 33) || (ch > 126)) ch = '?'; if (!stralloc_append(&line,&ch)) return; } if (!stralloc_cats(&line,"\n")) return; - fd = open_append("Log"); - if (fd == -1) return; + if ((fd = open_append("Log")) == -1) return; substdio_fdbuf(&ss,write,fd,buf,sizeof(buf)); substdio_putflush(&ss,line.s,line.len); close(fd);