Explorar el Código

Fix some gcc 3.0 warnings.

Adam Heath hace 25 años
padre
commit
796c9b08ba
Se han modificado 8 ficheros con 17 adiciones y 9 borrados
  1. 6 0
      ChangeLog
  2. 2 2
      dpkg-deb/extract.c
  3. 2 0
      dselect/main.cc
  4. 1 1
      lib/database.c
  5. 1 1
      main/help.c
  6. 2 2
      main/main.c
  7. 2 2
      split/info.c
  8. 1 1
      utils/start-stop-daemon.c

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+Mon May 28 16:19:51 CDT 2001  Adam Heath <doogie@debian.org>
+
+  * dpkg-deb/extract.c, dselect/main.cc, lib/database.c, main/help.c,
+    main/main.c, split/info.c, utils/start-stop-daemon.c: Fix some
+    gcc 3.0 warnings.
+
 Mon May  7 23:07:01 CEST 2001 Wichert Akkerman <wakkerma@debian.org>
 
   * main/depcon.c: restore previous statement to break reverse cycles 

+ 2 - 2
dpkg-deb/extract.c

@@ -191,9 +191,9 @@ void extracthalf(const char *debar, const char *directory,
 
     if (admininfo >= 2)
       if (printf(_(" old debian package, version %s.\n"
-                 " size %ld bytes: control archive= %ld, main archive= %zi.\n"),
+                 " size %ld bytes: control archive= %zd, main archive= %li.\n"),
                  versionbuf, (long)stab.st_size, ctrllennum,
-                 (long) (stab.st_size - ctrllennum - strlen(ctrllenbuf) - l)) == EOF ||
+                 (stab.st_size - ctrllennum - strlen(ctrllenbuf) - l)) == EOF ||
           fflush(stdout)) werr("stdout");
     
     ctrlarea= malloc(ctrllennum); if (!ctrlarea) ohshite("malloc ctrlarea failed");

+ 2 - 0
dselect/main.cc

@@ -110,9 +110,11 @@ static void usage(void) {
 /* These are called by C code, so need to have C calling convention */
 extern "C" {
 
+  static void helponly(const struct cmdinfo*, const char*) NONRETURNING;
   static void helponly(const struct cmdinfo*, const char*) {
     usage(); exit(0);
   }
+  static void versiononly(const struct cmdinfo*, const char*) NONRETURNING;
   static void versiononly(const struct cmdinfo*, const char*) {
     printversion(); exit(0);
   }

+ 1 - 1
lib/database.c

@@ -176,7 +176,7 @@ struct pkginfo *findpackage(const char *inname) {
   if (name == NULL)
     ohshite(_("couldn't allocate memory for strdup in findpackage(%s)"),inname);
   p= name;
-  while(*p) *p++= tolower(*p);
+  while(*p) { *p= tolower(*p); p++; }
   
   pointerp= bins + (hash(name) & (BINS-1));
   while (*pointerp && strcasecmp((*pointerp)->name,name))

+ 1 - 1
main/help.c

@@ -91,7 +91,7 @@ void checkpath(void) {
     s= path;
     while (s) {
       p= strchr(s,':');
-      l= p ? p-s : strlen(s);
+      l= p ? p-s : (long)strlen(s);
       memcpy(buf,s,l);
       if (l) buf[l++]= '/';
       strcpy(buf+l,*clp);

+ 2 - 2
main/main.c

@@ -430,7 +430,7 @@ static const struct cmdinfo cmdinfos[]= {
 void execbackend(const char *const *argv) {
   char **nargv;
   int i, argc = 1;
-  char **arg = argv;
+  const char *const *arg = argv;
   while(*arg != 0) { arg++; argc++; }
   nargv= malloc(sizeof(char *) * argc + 2);
 
@@ -447,7 +447,7 @@ void execbackend(const char *const *argv) {
   }
   nargv[i]= 0;
   execvp(cipaction->parg, nargv);
-  ohshite(_("failed to exec %s"),cipaction->parg);
+  ohshite(_("failed to exec %s"),(char *)cipaction->parg);
 }
 void commandfd(const char *const *argv) {
   jmp_buf ejbuf;

+ 2 - 2
split/info.c

@@ -193,9 +193,9 @@ void print_info(const struct partinfo *pi) {
          "        ... length:                 %lu bytes\n"
          "        ... split every:            %lu bytes\n"
          "    Part number:                    %d/%d\n"
-         "    Part length:                    %lu bytes\n"
+         "    Part length:                    %zu bytes\n"
          "    Part offset:                    %lu bytes\n"
-         "    Part file size (used portion):  %zi bytes\n\n"),
+         "    Part file size (used portion):  %li bytes\n\n"),
          pi->filename,
          pi->fmtversion,
          pi->package,

+ 1 - 1
utils/start-stop-daemon.c

@@ -402,7 +402,7 @@ parse_schedule(const char *schedule_str) {
 		repeatat = -1;
 		while (schedule_str != NULL) {
 			slash = strchr(schedule_str,'/');
-			str_len = slash ? slash - schedule_str : strlen(schedule_str);
+			str_len = slash ? slash - schedule_str : (ptrdiff_t)strlen(schedule_str);
 			if (str_len >= (ptrdiff_t)sizeof(item_buf))
 				badusage("invalid schedule item: far too long"
 					 " (you must delimit items with slashes)");