From 9838440951d3c1bb6d7bed226e52149f2deffd6b Mon Sep 17 00:00:00 2001 From: Murray Stokely Date: Sat, 22 Sep 2001 22:21:01 +0000 Subject: [PATCH] Silence warnings : Use static as necessary. Use __unused as necessary. sizeof(int) != sizeof(void *) --- usr.sbin/sade/misc.c | 8 ++++---- usr.sbin/sade/sade.h | 2 +- usr.sbin/sysinstall/anonFTP.c | 4 ++-- usr.sbin/sysinstall/index.c | 11 +++++++---- usr.sbin/sysinstall/misc.c | 8 ++++---- usr.sbin/sysinstall/sysinstall.h | 2 +- 6 files changed, 19 insertions(+), 16 deletions(-) diff --git a/usr.sbin/sade/misc.c b/usr.sbin/sade/misc.c index 4bba7e513dcb..0965828ccbe3 100644 --- a/usr.sbin/sade/misc.c +++ b/usr.sbin/sade/misc.c @@ -189,7 +189,7 @@ safe_malloc(size_t size) void *ptr; if (size <= 0) - msgFatal("Invalid malloc size of %d!", size); + msgFatal("Invalid malloc size of %ld!", (long)size); ptr = malloc(size); if (!ptr) msgFatal("Out of memory!"); @@ -204,7 +204,7 @@ safe_realloc(void *orig, size_t size) void *ptr; if (size <= 0) - msgFatal("Invalid realloc size of %d!", size); + msgFatal("Invalid realloc size of %ld!", (long)size); ptr = realloc(orig, size); if (!ptr) msgFatal("Out of memory!"); @@ -236,7 +236,7 @@ item_add(dialogMenuItem *list, char *prompt, char *title, int (*checked)(dialogMenuItem *self), int (*fire)(dialogMenuItem *self), void (*selected)(dialogMenuItem *self, int is_selected), - void *data, int aux, int *curr, int *max) + void *data, int *aux, int *curr, int *max) { dialogMenuItem *d; @@ -252,7 +252,7 @@ item_add(dialogMenuItem *list, char *prompt, char *title, d->fire = fire; d->selected = selected; d->data = data; - d->aux = aux; + d->aux = (long)aux; return list; } diff --git a/usr.sbin/sade/sade.h b/usr.sbin/sade/sade.h index 2b1a06dd5c9e..c6e2b9b9c01a 100644 --- a/usr.sbin/sade/sade.h +++ b/usr.sbin/sade/sade.h @@ -658,7 +658,7 @@ extern dialogMenuItem *item_add(dialogMenuItem *list, char *prompt, char *title, int (*checked)(dialogMenuItem *self), int (*fire)(dialogMenuItem *self), void (*selected)(dialogMenuItem *self, int is_selected), - void *data, int aux, int *curr, int *max); + void *data, int *aux, int *curr, int *max); extern void items_free(dialogMenuItem *list, int *curr, int *max); extern int Mkdir(char *); extern int Mount(char *, void *data); diff --git a/usr.sbin/sysinstall/anonFTP.c b/usr.sbin/sysinstall/anonFTP.c index 7606be23494f..1902a5dee581 100644 --- a/usr.sbin/sysinstall/anonFTP.c +++ b/usr.sbin/sysinstall/anonFTP.c @@ -118,7 +118,7 @@ static Layout layout[] = { { NULL }, }; -int +static int createFtpUser(void) { struct passwd *tpw; @@ -235,7 +235,7 @@ anonftpOpenDialog(void) } int -configAnonFTP(dialogMenuItem *self) +configAnonFTP(dialogMenuItem *self __unused) { int i; diff --git a/usr.sbin/sysinstall/index.c b/usr.sbin/sysinstall/index.c index ae6f6e41379d..b3ca29e2352e 100644 --- a/usr.sbin/sysinstall/index.c +++ b/usr.sbin/sysinstall/index.c @@ -576,8 +576,8 @@ index_menu(PkgNodePtr root, PkgNodePtr top, PkgNodePtr plist, int *pos, int *scr use_helpfile(NULL); kp = top->kids; if (!hasPackages && plist) { - nitems = item_add(nitems, "OK", NULL, NULL, NULL, NULL, NULL, 0, &curr, &max); - nitems = item_add(nitems, "Install", NULL, NULL, NULL, NULL, NULL, 0, &curr, &max); + nitems = item_add(nitems, "OK", NULL, NULL, NULL, NULL, NULL, NULL, &curr, &max); + nitems = item_add(nitems, "Install", NULL, NULL, NULL, NULL, NULL, NULL, &curr, &max); } while (kp && kp->name) { char buf[256]; @@ -590,12 +590,15 @@ index_menu(PkgNodePtr root, PkgNodePtr top, PkgNodePtr plist, int *pos, int *scr SAFE_STRCPY(buf, kp->desc); if (strlen(buf) > (_MAX_DESC - maxname)) buf[_MAX_DESC - maxname] = '\0'; - nitems = item_add(nitems, kp->name, buf, pkg_checked, pkg_fire, pkg_selected, kp, (int)&lists, &curr, &max); + nitems = item_add(nitems, kp->name, (char *)buf, pkg_checked, + pkg_fire, pkg_selected, kp, (int *)(&lists), + &curr, &max); ++n; kp = kp->next; } /* NULL delimiter so item_free() knows when to stop later */ - nitems = item_add(nitems, NULL, NULL, NULL, NULL, NULL, NULL, 0, &curr, &max); + nitems = item_add(nitems, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + &curr, &max); recycle: dialog_clear_norefresh(); diff --git a/usr.sbin/sysinstall/misc.c b/usr.sbin/sysinstall/misc.c index 4bba7e513dcb..0965828ccbe3 100644 --- a/usr.sbin/sysinstall/misc.c +++ b/usr.sbin/sysinstall/misc.c @@ -189,7 +189,7 @@ safe_malloc(size_t size) void *ptr; if (size <= 0) - msgFatal("Invalid malloc size of %d!", size); + msgFatal("Invalid malloc size of %ld!", (long)size); ptr = malloc(size); if (!ptr) msgFatal("Out of memory!"); @@ -204,7 +204,7 @@ safe_realloc(void *orig, size_t size) void *ptr; if (size <= 0) - msgFatal("Invalid realloc size of %d!", size); + msgFatal("Invalid realloc size of %ld!", (long)size); ptr = realloc(orig, size); if (!ptr) msgFatal("Out of memory!"); @@ -236,7 +236,7 @@ item_add(dialogMenuItem *list, char *prompt, char *title, int (*checked)(dialogMenuItem *self), int (*fire)(dialogMenuItem *self), void (*selected)(dialogMenuItem *self, int is_selected), - void *data, int aux, int *curr, int *max) + void *data, int *aux, int *curr, int *max) { dialogMenuItem *d; @@ -252,7 +252,7 @@ item_add(dialogMenuItem *list, char *prompt, char *title, d->fire = fire; d->selected = selected; d->data = data; - d->aux = aux; + d->aux = (long)aux; return list; } diff --git a/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h index 2b1a06dd5c9e..c6e2b9b9c01a 100644 --- a/usr.sbin/sysinstall/sysinstall.h +++ b/usr.sbin/sysinstall/sysinstall.h @@ -658,7 +658,7 @@ extern dialogMenuItem *item_add(dialogMenuItem *list, char *prompt, char *title, int (*checked)(dialogMenuItem *self), int (*fire)(dialogMenuItem *self), void (*selected)(dialogMenuItem *self, int is_selected), - void *data, int aux, int *curr, int *max); + void *data, int *aux, int *curr, int *max); extern void items_free(dialogMenuItem *list, int *curr, int *max); extern int Mkdir(char *); extern int Mount(char *, void *data);