Procházet zdrojové kódy

Several more gcc -W<foo> fixes.

Adam Heath před 24 roky
rodič
revize
a1d9dc46c5
8 změnil soubory, kde provedl 26 přidání a 18 odebrání
  1. 6 0
      ChangeLog
  2. 11 10
      lib/showpkg.c
  3. 1 0
      lib/utils.c
  4. 3 3
      main/archives.c
  5. 2 2
      main/configure.c
  6. 1 1
      main/main.c
  7. 1 1
      main/query.c
  8. 1 1
      optlib/long-options.c

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+Sun May 19 20:25:05 CDT 2002 Adam Heath <doogie@debian.org>
+
+  * 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<foo> fixes.
+
 Sun May 19 18:48:39 CDT 2002 Adam Heath <doogie@debian.org>
 
   * debian/rules: Fix overzealous running of autoheader for every build.

+ 11 - 10
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) {

+ 1 - 0
lib/utils.c

@@ -19,6 +19,7 @@
  */
 
 #include <config.h>
+#include <dpkg.h>
 
 /* 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

+ 3 - 3
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);

+ 2 - 2
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;
 

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;