From a1d9dc46c55fcc012854f8aa99058d5bb14c2a8a Mon Sep 17 00:00:00 2001 From: Adam Heath Date: Mon, 20 May 2002 01:22:31 +0000 Subject: [PATCH] Several more gcc -W fixes. --- ChangeLog | 6 ++++++ lib/showpkg.c | 21 +++++++++++---------- lib/utils.c | 1 + main/archives.c | 6 +++--- main/configure.c | 4 ++-- main/main.c | 2 +- main/query.c | 2 +- optlib/long-options.c | 2 +- 8 files changed, 26 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4ea9e23d..d0adc3fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sun May 19 20:25:05 CDT 2002 Adam Heath + + * lib/showpkg.c, lib/utils.c, optlib/long-options.c, main/archives.c, + main/configure.c, main/main.c, main/query.c, optlib/long-options.c, + lib/showpkg.c, lib/utils.c: Several more gcc -W fixes. + Sun May 19 18:48:39 CDT 2002 Adam Heath * debian/rules: Fix overzealous running of autoheader for every build. diff --git a/lib/showpkg.c b/lib/showpkg.c index 6f26827f..329160bb 100644 --- a/lib/showpkg.c +++ b/lib/showpkg.c @@ -39,7 +39,7 @@ struct lstitem { }; -static struct lstitem* alloclstitem() { +static struct lstitem* alloclstitem(void) { struct lstitem* buf; buf=(struct lstitem*)malloc(sizeof(struct lstitem)); @@ -185,15 +185,16 @@ struct lstitem* parseformat(const char* fmt) { } -static void dumpchain(struct lstitem* head) { - while (head) { - printf("Type: %s\n", (head->type==string) ? "string" : "field"); - printf("Width: %d\n", head->width); - printf("Data: %s\n", head->data); - printf("\n"); - head=head->next; - } -} +#define dumpchain(head) {\ + const struct lstitem* ptr = head;\ + while (ptr) {\ + printf("Type: %s\n", (ptr->type==string) ? "string" : "field");\ + printf("Width: %d\n", ptr->width);\ + printf("Data: %s\n", ptr->data);\ + printf("\n");\ + ptr=ptr->next;\ + }\ +}\ void show1package(const struct lstitem* head, struct pkginfo *pkg) { diff --git a/lib/utils.c b/lib/utils.c index 5776c22c..f2a6a559 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -19,6 +19,7 @@ */ #include +#include /* Reimplementation of the standard ctype.h is* functions. Since gettext * has overloaded the meaning of LC_CTYPE we can't use that to force C diff --git a/main/archives.c b/main/archives.c index cb6e9b77..18dcb770 100644 --- a/main/archives.c +++ b/main/archives.c @@ -131,7 +131,7 @@ static struct obstack tar_obs; static int tarobs_init= 0; /* ensure the obstack is properly initialized */ -static void ensureobstackinit() { +static void ensureobstackinit(void) { if (!tarobs_init) { obstack_init(&tar_obs); @@ -140,7 +140,7 @@ static void ensureobstackinit() { } /* destroy the obstack */ -static void destroyobstack() { +static void destroyobstack(void) { if (tarobs_init) { obstack_free(&tar_obs, 0); tarobs_init= 0; @@ -692,7 +692,7 @@ void check_conflict(struct dependency *dep, struct pkginfo *pkg, (((fixbyrm->want != want_install && fixbyrm->want != want_hold) || does_replace(pkg,&pkg->available,fixbyrm)) && (!fixbyrm->installed.essential || fc_removeessential)))) { - assert(fixbyrm->clientdata->istobe == itb_normal); + assert(fixbyrm->clientdata->istobe == itb_normal || fixbyrm->clientdata->istobe == itb_deconfigure); fixbyrm->clientdata->istobe= itb_remove; fprintf(stderr, _("dpkg: considering removing %s in favour of %s ...\n"), fixbyrm->name, pkg->name); diff --git a/main/configure.c b/main/configure.c index 800ee438..970a8930 100644 --- a/main/configure.c +++ b/main/configure.c @@ -48,7 +48,7 @@ int conffoptcells[2][2]= { CONFFOPTCELLS }; static void md5hash(struct pkginfo *pkg, char **hashbuf, const char *fn); static void copyfileperm(const char* source, const char* target); static void showdiff(const char* old, const char* new); -static void suspend(); +static void suspend(void); static enum conffopt promptconfaction(const char* cfgfile, const char* realold, const char* realnew, int useredited, int distedited, enum conffopt what); @@ -472,7 +472,7 @@ static void showdiff(const char* old, const char* new) { /* Suspend dpkg temporarily */ -static void suspend() { +static void suspend(void) { const char* s; int pid; diff --git a/main/main.c b/main/main.c index 7aa4317d..8feb679e 100644 --- a/main/main.c +++ b/main/main.c @@ -283,7 +283,7 @@ static void setpipe(const struct cmdinfo *cip, const char *value) { (*lastpipe)->fd= v; } -void setforce(const struct cmdinfo *cip, const char *value) { +static void setforce(const struct cmdinfo *cip, const char *value) { const char *comma; size_t l; const struct forceinfo *fip; diff --git a/main/query.c b/main/query.c index c786079b..ac0a309e 100644 --- a/main/query.c +++ b/main/query.c @@ -100,7 +100,7 @@ static void limiteddescription(struct pkginfo *pkg, int maxl, *pdesc_r=pdesc; *l_r=l; } -static int getwidth() { +static int getwidth(void) { int fd; int res; struct winsize ws; diff --git a/optlib/long-options.c b/optlib/long-options.c index 1a2de79c..3cbd7b2a 100644 --- a/optlib/long-options.c +++ b/optlib/long-options.c @@ -44,7 +44,7 @@ parse_long_options (argc, argv, command_name, package, version, usage) const char *command_name; const char *package; const char *version; - void (*usage)(); + void (*usage)(int); { int c; int saved_opterr; -- 2.39.5