]> err.no Git - dpkg/commitdiff
Use NULL instead of '(char *)0'.
authorGuillem Jover <guillem@debian.org>
Wed, 8 Aug 2007 02:25:06 +0000 (05:25 +0300)
committerGuillem Jover <guillem@debian.org>
Wed, 8 Aug 2007 02:25:06 +0000 (05:25 +0300)
ChangeLog
dpkg-deb/build.c
dpkg-deb/extract.c
dpkg-deb/info.c
src/cleanup.c
src/configure.c
src/help.c
src/processarc.c
src/remove.c

index 41a56ee722bf55bf74939e530b5691d0b4e359fb..8afa435e79113e2eaad4c347cd7cd7a3823ce63e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2007-08-08  Guillem Jover  <guillem@debian.org>
+
+       * dpkg-deb/build.c (do_build): Use NULL instead of '(char *)0'.
+       * dpkg-deb/extract.c (movecontrolfiles, extracthalf): Likewise.
+       * dpkg-deb/info.c (cu_info_prepare, info_prepare): Likewise.
+       * src/cleanup.c (cu_prermupgrade, cu_prermdeconfigure)
+       (cu_prerminfavour, cu_preinstverynew, cu_preinstnew)
+       (cu_preinstupgrade, cu_postrmupgrade, cu_prermremove): Likewise.
+       * src/configure.c (deferred_configure, suspend): Likewise.
+       * src/help.c (maintainer_script_alternative)
+       (ensure_pathname_nonexisting): Likewise.
+       * src/processarc.c (process_archive): Likewise.
+       * src/remove.c (deferred_remove, removal_bulk_remove_files)
+       (removal_bulk_remove_configfiles): Likewise.
+
 2007-08-08  Guillem Jover  <guillem@debian.org>
 
        * src/cleanup.c (cu_prermdeconfigure): Split call to
index 31e6604546146cc790e730c29677a33939ca95c3..0177a743da1be101fbb598a2ab99f64ca4302a97 100644 (file)
@@ -324,7 +324,8 @@ void do_build(const char *const *argv) {
     m_dup2(p1[1],1); close(p1[0]); close(p1[1]);
     if (chdir(directory)) ohshite(_("failed to chdir to `%.255s'"),directory);
     if (chdir(BUILDCONTROLDIR)) ohshite(_("failed to chdir to .../DEBIAN"));
-    execlp(TAR,"tar","-cf","-",".",(char*)0); ohshite(_("failed to exec tar -cf"));
+    execlp(TAR, "tar", "-cf", "-", ".", NULL);
+    ohshite(_("failed to exec tar -cf"));
   }
   close(p1[1]);
   /* Create a temporary file to store the control data in. Immediately unlink
@@ -396,7 +397,7 @@ void do_build(const char *const *argv) {
     m_dup2(p1[0],0); close(p1[0]); close(p1[1]);
     m_dup2(p2[1],1); close(p2[0]); close(p2[1]);
     if (chdir(directory)) ohshite(_("failed to chdir to `%.255s'"),directory);
-    execlp(TAR,"tar","-cf", "-", "--null", "-T", "-", "--no-recursion", (char*)0);
+    execlp(TAR, "tar", "-cf", "-", "--null", "-T", "-", "--no-recursion", NULL);
     ohshite(_("failed to exec tar -cf"));
   }
   close(p1[0]);
@@ -417,7 +418,8 @@ void do_build(const char *const *argv) {
   if (!(c3= m_fork())) {
     m_dup2(p3[1],1); close(p3[0]); close(p3[1]);
     if (chdir(directory)) ohshite(_("failed to chdir to `%.255s'"),directory);
-    execlp(FIND,"find",".","-path","./" BUILDCONTROLDIR,"-prune","-o","-print0",(char*)0);
+    execlp(FIND, "find", ".", "-path", "./" BUILDCONTROLDIR, "-prune", "-o",
+           "-print0", NULL);
     ohshite(_("failed to exec find"));
   }
   close(p3[1]);
index 1541980e4a71941edd251e810ce5404c583cad24..24cc1c13cdd7f291df7da24dd64517f55f251e99 100644 (file)
@@ -48,7 +48,8 @@ static void movecontrolfiles(const char *thing) {
   
   sprintf(buf, "mv %s/* . && rmdir %s", thing, thing);
   if (!(c1= m_fork())) {
-    execlp("sh","sh","-c",buf,(char*)0); ohshite(_("failed to exec sh -c mv foo/* &c"));
+    execlp("sh", "sh", "-c", buf, NULL);
+    ohshite(_("failed to exec sh -c mv foo/* &c"));
   }
   waitsubproc(c1,"sh -c mv foo/* &c",0);
 }
@@ -299,7 +300,7 @@ void extracthalf(const char *debar, const char *directory,
       strcat(buffer, "f");
       m_dup2(p2[0],0);
       close(p2[0]);
-      execlp(TAR,"tar",buffer,"-",(char*)0);
+      execlp(TAR, "tar", buffer, "-", NULL);
       ohshite(_("failed to exec tar"));
     }
     close(p2[0]);
index 0cebf669ceeddafe65929a1197721c0aed62ebb2..4024d0296ae9b12698868ff62192b1088c6cfdbe 100644 (file)
@@ -50,7 +50,7 @@ static void cu_info_prepare(int argc, void **argv) {
   if (lstat(directory,&stab) && errno==ENOENT) return;
   if ((c1= fork()) == -1) { perror(_("failed to fork for cleanup")); return; }
   if (!c1) {
-    execlp(RM,"rm","-rf",directory,(char*)0);
+    execlp(RM, "rm", "-rf", directory, NULL);
     perror(_("failed to exec rm for cleanup")); _exit(1);
   }
   if (waitpid(c1,&status,0) != c1) { perror(_("failed to wait for rm cleanup")); return; }
@@ -72,7 +72,8 @@ static void info_prepare(const char *const **argvp,
   *directoryp= dbuf;
 
   if (!(c1= m_fork())) {
-    execlp(RM,"rm","-rf",dbuf,(char*)0); ohshite(_("failed to exec rm -rf"));
+    execlp(RM, "rm", "-rf", dbuf, NULL);
+    ohshite(_("failed to exec rm -rf"));
   }
   waitsubproc(c1,"rm -rf",0);
   push_cleanup(cu_info_prepare,-1, 0,0, 1, (void*)dbuf);
index 096199298d1ca5cc8a2f8df92a0ae1c8ed3dc758..108ee2c1daf50cfdbbc1457306dccb36d4a98181 100644 (file)
@@ -111,7 +111,7 @@ void cu_prermupgrade(int argc, void **argv) {
                               "abort-upgrade",
                               versiondescribe(&pkg->available.version,
                                               vdew_nonambig),
-                              (char*)0);
+                              NULL);
   pkg->status= stat_installed;
   pkg->eflag &= ~eflagf_reinstreq;
   modstatdb_note(pkg);
@@ -141,14 +141,14 @@ void cu_prermdeconfigure(int argc, void **argv) {
                                 "removing", conflictor->name,
                                 versiondescribe(&conflictor->installed.version,
                                                 vdew_nonambig),
-                                (char*)0);
+                                NULL);
   } else {
     maintainer_script_installed(deconf, POSTINSTFILE, "post-installation",
                                 "abort-deconfigure",
                                 "in-favour", infavour->name,
                                 versiondescribe(&infavour->available.version,
                                                 vdew_nonambig),
-                                (char*)0);
+                                NULL);
   }
 
   deconf->status= stat_installed;
@@ -164,7 +164,7 @@ void cu_prerminfavour(int argc, void **argv) {
                               "abort-remove", "in-favour", infavour->name,
                               versiondescribe(&infavour->available.version,
                                               vdew_nonambig),
-                              (char*)0);
+                              NULL);
   conflictor->status= stat_installed;
   conflictor->eflag &= ~eflagf_reinstreq;
   modstatdb_note(conflictor);
@@ -178,7 +178,7 @@ void cu_preinstverynew(int argc, void **argv) {
 
   if (cleanup_pkg_failed++) return;
   maintainer_script_new(pkg->name, POSTRMFILE,"post-removal",cidir,cidirrest,
-                        "abort-install",(char*)0);
+                        "abort-install", NULL);
   pkg->status= stat_notinstalled;
   pkg->eflag &= ~eflagf_reinstreq;
   blankpackageperfile(&pkg->installed);
@@ -195,7 +195,7 @@ void cu_preinstnew(int argc, void **argv) {
   maintainer_script_new(pkg->name, POSTRMFILE,"post-removal",cidir,cidirrest,
                         "abort-install", versiondescribe(&pkg->installed.version,
                                                          vdew_nonambig),
-                        (char*)0);
+                        NULL);
   pkg->status= stat_configfiles;
   pkg->eflag &= ~eflagf_reinstreq;
   modstatdb_note(pkg);
@@ -213,7 +213,7 @@ void cu_preinstupgrade(int argc, void **argv) {
                         "abort-upgrade",
                         versiondescribe(&pkg->installed.version,
                                         vdew_nonambig),
-                        (char*)0);
+                        NULL);
   pkg->status= *oldstatusp;
   pkg->eflag &= ~eflagf_reinstreq;
   modstatdb_note(pkg);
@@ -227,7 +227,7 @@ void cu_postrmupgrade(int argc, void **argv) {
   maintainer_script_installed(pkg,PREINSTFILE,"pre-installation",
                               "abort-upgrade", versiondescribe(&pkg->available.version,
                                                                vdew_nonambig),
-                              (char*)0);
+                              NULL);
   cleanup_pkg_failed--;
 }
 
@@ -236,7 +236,7 @@ void cu_prermremove(int argc, void **argv) {
 
   if (cleanup_pkg_failed++) return;
   maintainer_script_installed(pkg,POSTINSTFILE,"post-installation",
-                              "abort-remove", (char*)0);
+                              "abort-remove", NULL);
   pkg->status= stat_installed;
   pkg->eflag &= ~eflagf_reinstreq;
   modstatdb_note(pkg);
index 0615728a44e7faff01cae08d418b95a45044589b..c1a70a74730ba23a1e25169885361416db6c8896 100644 (file)
@@ -303,7 +303,7 @@ void deferred_configure(struct pkginfo *pkg) {
                                ? versiondescribe(&pkg->configversion,
                                        vdew_nonambig)
                                : "",
-                               (char*)0))
+                               NULL))
                putchar('\n');
 
        pkg->status= stat_installed;
@@ -504,7 +504,7 @@ static void suspend(void) {
                        if (!s || !*s)
                                s=DEFAULTSHELL;
 
-                       execlp(s,s,"-i",(char*)0);
+                       execlp(s, s, "-i", NULL);
                        ohshite(_("failed to exec shell (%.250s)"),s);
                }
 
index ba4a84550c2cc14979a5e57cf3aa3c9a6a3f8b70..7f29543b7d77bb4fdf400a659cf98c1a909c1782 100644 (file)
@@ -348,7 +348,7 @@ int maintainer_script_alternative(struct pkginfo *pkg,
   arglist= buildarglist(scriptname,
                         ifok,versiondescribe(&pkg->available.version,
                                              vdew_nonambig),
-                        (char*)0);
+                        NULL);
   sprintf(buf,_("old %s script"),description);
   if (stat(oldscriptpath,&stab)) {
     if (errno == ENOENT) {
@@ -369,7 +369,7 @@ int maintainer_script_alternative(struct pkginfo *pkg,
   arglist= buildarglist(scriptname,
                         iffallback,versiondescribe(&pkg->installed.version,
                                                    vdew_nonambig),
-                        (char*)0);
+                        NULL);
   strcpy(cidirrest,scriptname);
   sprintf(buf,_("new %s script"),description);
 
@@ -515,7 +515,7 @@ void ensure_pathname_nonexisting(const char *pathname) {
   }
   c1= m_fork();
   if (!c1) {
-    execlp(RM,"rm","-rf","--",pathname,(char*)0);
+    execlp(RM, "rm", "-rf", "--", pathname, NULL);
     ohshite(_("failed to exec rm for cleanup"));
   }
   debug(dbg_eachfile,"ensure_pathname_nonexisting running rm -rf");
index 4c1d0573f91f5b0af8d3e7dd83eb425ffcef1475..cb69504b2f2f7f81b233ed656fbc503cb210d230 100644 (file)
@@ -113,7 +113,7 @@ void process_archive(const char *filename) {
     push_cleanup(cu_pathname,~0, 0,0, 1,(void*)reasmbuf);
     c1= m_fork();
     if (!c1) {
-      execlp(SPLITTER, SPLITTER,"-Qao",reasmbuf,filename,(char*)0);
+      execlp(SPLITTER, SPLITTER, "-Qao", reasmbuf, filename, NULL);
       ohshite(_("failed to exec dpkg-split to see if it's part of a multiparter"));
     }
     while ((r= waitpid(c1,&status,0)) == -1 && errno == EINTR);
@@ -184,7 +184,7 @@ void process_archive(const char *filename) {
   c1= m_fork();
   if (!c1) {
     cidirrest[-1]= 0;
-    execlp(BACKEND, BACKEND,"--control",filename,cidir,(char*)0);
+    execlp(BACKEND, BACKEND, "--control", filename, cidir, NULL);
     ohshite(_("failed to exec dpkg-deb to extract control information"));
   }
   waitsubproc(c1,BACKEND " --control",0);
@@ -426,13 +426,13 @@ void process_archive(const char *filename) {
                                   "removing", removing->name,
                                   versiondescribe(&removing->installed.version,
                                                   vdew_nonambig),
-                                  (char*)0);
+                                  NULL);
     } else {
       maintainer_script_installed(deconpil->pkg, PRERMFILE, "pre-removal",
                                   "deconfigure", "in-favour", pkg->name,
                                   versiondescribe(&pkg->available.version,
                                                   vdew_nonambig),
-                                  (char*)0);
+                                  NULL);
     }
   }
 
@@ -447,7 +447,7 @@ void process_archive(const char *filename) {
                                 "remove", "in-favour", pkg->name,
                                 versiondescribe(&pkg->available.version,
                                                 vdew_nonambig),
-                                (char*)0);
+                                NULL);
     conflictor[i]->status= stat_halfinstalled;
     modstatdb_note(conflictor[i]);
   }
@@ -461,21 +461,21 @@ void process_archive(const char *filename) {
     push_cleanup(cu_preinstverynew,~ehflag_normaltidy, 0,0,
                  3,(void*)pkg,(void*)cidir,(void*)cidirrest);
     maintainer_script_new(pkg->name, PREINSTFILE, "pre-installation", cidir, cidirrest,
-                          "install", (char*)0);
+                          "install", NULL);
   } else if (oldversionstatus == stat_configfiles) {
     push_cleanup(cu_preinstnew,~ehflag_normaltidy, 0,0,
                  3,(void*)pkg,(void*)cidir,(void*)cidirrest);
     maintainer_script_new(pkg->name, PREINSTFILE, "pre-installation", cidir, cidirrest,
                           "install", versiondescribe(&pkg->installed.version,
                                                      vdew_nonambig),
-                          (char*)0);
+                          NULL);
   } else {
     push_cleanup(cu_preinstupgrade,~ehflag_normaltidy, 0,0,
                  4,(void*)pkg,(void*)cidir,(void*)cidirrest,(void*)&oldversionstatus);
     maintainer_script_new(pkg->name, PREINSTFILE, "pre-installation", cidir, cidirrest,
                           "upgrade", versiondescribe(&pkg->installed.version,
                                                      vdew_nonambig),
-                          (char*)0);
+                          NULL);
     printf(_("Unpacking replacement %.250s ...\n"),pkg->name);
   }
   
@@ -556,7 +556,7 @@ void process_archive(const char *filename) {
   c1= m_fork();
   if (!c1) {
     m_dup2(p1[1],1); close(p1[0]); close(p1[1]);
-    execlp(BACKEND, BACKEND, "--fsys-tarfile", filename, (char*)0);
+    execlp(BACKEND, BACKEND, "--fsys-tarfile", filename, NULL);
     ohshite(_("unable to exec dpkg-deb to get filesystem archive"));
   }
   close(p1[1]);
@@ -981,7 +981,7 @@ void process_archive(const char *filename) {
                                 "disappear", pkg->name, 
                                 versiondescribe(&pkg->available.version,
                                                 vdew_nonambig),
-                                (char*)0);
+                                NULL);
 
     /* OK, now we delete all the stuff in the `info' directory .. */
     varbufreset(&fnvb);
index 5fccac6ae7ca7bfcebee77a40a4844be2ed82c00..abcfc9ffaba10e4057ec5ddc5f2a4cc4e814627c 100644 (file)
@@ -170,7 +170,7 @@ void deferred_remove(struct pkginfo *pkg) {
       modstatdb_note(pkg);
       push_cleanup(cu_prermremove,~ehflag_normaltidy, 0,0, 1,(void*)pkg);
       maintainer_script_installed(pkg, PRERMFILE, "pre-removal",
-                                  "remove", (char*)0);
+                                  "remove", NULL);
     }
 
     pkg->status= stat_unpacked; /* Will turn into halfinstalled soon ... */
@@ -283,7 +283,7 @@ static void removal_bulk_remove_files(
     }
     write_filelist_except(pkg,leftover,0);
     maintainer_script_installed(pkg, POSTRMFILE, "post-removal",
-                                "remove", (char*)0);
+                                "remove", NULL);
     varbufreset(&fnvb);
     varbufaddstr(&fnvb,admindir);
     varbufaddstr(&fnvb,"/" INFODIR);
@@ -512,7 +512,7 @@ static void removal_bulk_remove_configfiles(struct pkginfo *pkg) {
     modstatdb_note(pkg);
         
     maintainer_script_installed(pkg, POSTRMFILE, "post-removal",
-                                "purge", (char*)0);
+                                "purge", NULL);
 }
 
 void removal_bulk(struct pkginfo *pkg) {