Silence warnings :

Use static as necessary.
   Use __unused as necessary.
   sizeof(int) != sizeof(void *)
This commit is contained in:
Murray Stokely 2001-09-22 22:21:01 +00:00
parent dde96c9933
commit 9838440951
6 changed files with 19 additions and 16 deletions

View File

@ -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;
}

View File

@ -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);

View File

@ -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;

View File

@ -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();

View File

@ -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;
}

View File

@ -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);