From: Guillem Jover Date: Wed, 2 Jul 2008 04:48:11 +0000 (+0300) Subject: Use NULL instead of 0 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31d38939de9f34b5af0c70adb8c81d035f698d8d;p=dpkg Use NULL instead of 0 --- diff --git a/ChangeLog b/ChangeLog index 8b5cdc5f..33a6345a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-07-02 Guillem Jover + + * src/query.c (limiteddescription): Use NULL instead of 0. + (list1package, searchfiles, enqperpackage, main): Likewise. + (cipaction, ignoredependss, cmdinfos): Likewise. + (ACTION, OBSOLETE): Likewise. + * src/select.c (setselections): Likewise. + * src/trigcmd.c (cmdinfos): Likewise. + 2008-07-02 Guillem Jover * src/remove.c (removal_bulk_remove_configfiles): Remove wrong comment diff --git a/src/query.c b/src/query.c index 973e6830..e6151ab5 100644 --- a/src/query.c +++ b/src/query.c @@ -58,7 +58,7 @@ static void limiteddescription(struct pkginfo *pkg, int maxl, const char *pdesc, *p; int l; - pdesc= pkg->installed.valid ? pkg->installed.description : 0; + pdesc = pkg->installed.valid ? pkg->installed.description : NULL; if (!pdesc) pdesc= _("(no description available)"); p= strchr(pdesc,'\n'); if (!p) p= pdesc+strlen(pdesc); @@ -101,7 +101,7 @@ static void list1package(struct pkginfo *pkg, int *head, const char *pdesc; int plen, vlen, dlen; - pdesc= pkg->installed.valid ? pkg->installed.description : 0; + pdesc = pkg->installed.valid ? pkg->installed.description : NULL; if (!pdesc) pdesc= _("(no description available)"); plen= strlen(pkgl[i]->name); @@ -255,7 +255,7 @@ void searchfiles(const char *const *argv) { ensure_allinstfiles_available_quiet(); ensure_diversions(); - while ((thisarg= *argv++) != 0) { + while ((thisarg = *argv++) != NULL) { found= 0; /* Trim trailing slash and slash dot from the argument if it's @@ -283,7 +283,7 @@ void searchfiles(const char *const *argv) { found += searchoutput(namenode); } else { it= iterfilestart(); - while ((namenode= iterfilenext(it)) != 0) { + while ((namenode = iterfilenext(it)) != NULL) { if (fnmatch(thisarg,namenode->name,0)) continue; found+= searchoutput(namenode); } @@ -318,7 +318,7 @@ void enqperpackage(const char *const *argv) { else modstatdb_init(admindir,msdbrw_readonly); - while ((thisarg= *argv++) != 0) { + while ((thisarg = *argv++) != NULL) { pkg= findpackage(thisarg); switch (cipaction->arg) { @@ -386,7 +386,7 @@ void enqperpackage(const char *const *argv) { internerr("unknown action"); } - if (*(argv + 1) == 0) + if (*(argv + 1) == NULL) putchar('\n'); if (ferror(stdout)) werr("stdout"); } @@ -524,7 +524,7 @@ const char printforhelp[]= N_("\ Use --help for help about querying packages;\n\ Use --license for copyright license and lack of warranty (GNU GPL)."); -const struct cmdinfo *cipaction= 0; +const struct cmdinfo *cipaction = NULL; int f_pending=0, f_recursive=0, f_alsoselect=1, f_skipsame=0, f_noact=0; int f_autodeconf=0, f_nodebsig=0; unsigned long f_debug=0; @@ -536,7 +536,7 @@ int fc_badpath=0; int errabort = 50; const char *admindir= ADMINDIR; const char *instdir= ""; -struct packageinlist *ignoredependss=0; +struct packageinlist *ignoredependss = NULL; static void setaction(const struct cmdinfo *cip, const char *value) { if (cipaction) @@ -551,9 +551,9 @@ static const struct cmdinfo cmdinfos[]= { * have a very similar structure. */ #define ACTION(longopt,shortopt,code,function) \ - { longopt, shortopt, 0,0,0, setaction, code, 0, (voidfnp)function } + { longopt, shortopt, 0, NULL, NULL, setaction, code, NULL, (voidfnp)function } #define OBSOLETE(longopt,shortopt) \ - { longopt, shortopt, 0,0,0, setobsolete, 0, 0, 0 } + { longopt, shortopt, 0, NULL, NULL, setobsolete, 0, NULL, NULL } ACTION( "listfiles", 'L', act_listfiles, enqperpackage ), ACTION( "status", 's', act_status, enqperpackage ), @@ -562,13 +562,15 @@ static const struct cmdinfo cmdinfos[]= { ACTION( "search", 'S', act_searchfiles, searchfiles ), ACTION( "show", 'W', act_listpackages, showpackages ), - { "admindir", 0, 1, 0, &admindir, 0 }, - { "showformat", 'f', 1, 0, &showformat, 0 }, - { "help", 'h', 0, 0, 0, helponly }, - { "version", 0, 0, 0, 0, versiononly }, - { "licence",/* UK spelling */ 0,0,0,0, showcopyright }, - { "license",/* US spelling */ 0,0,0,0, showcopyright }, - { 0, 0 } + { "admindir", 0, 1, NULL, &admindir, NULL }, + { "showformat", 'f', 1, NULL, &showformat, NULL }, + { "help", 'h', 0, NULL, NULL, helponly }, + { "version", 0, 0, NULL, NULL, versiononly }, + /* UK spelling. */ + { "licence", 0, 0, NULL, NULL, showcopyright }, + /* US spelling */ + { "license", 0, 0, NULL, NULL, showcopyright }, + { NULL, 0, 0, NULL, NULL, NULL } }; int main(int argc, const char *const *argv) { @@ -578,7 +580,7 @@ int main(int argc, const char *const *argv) { standard_startup(&ejbuf, argc, &argv, NULL, 0, cmdinfos); if (!cipaction) badusage(_("need an action option")); - setvbuf(stdout,0,_IONBF,0); + setvbuf(stdout, NULL, _IONBF, 0); filesdbinit(); actionfunction= (void (*)(const char* const*))cipaction->farg; diff --git a/src/select.c b/src/select.c index a023d5db..12a72012 100644 --- a/src/select.c +++ b/src/select.c @@ -129,7 +129,7 @@ void setselections(const char *const *argv) { } varbufaddc(&namevb,0); varbufaddc(&selvb,0); - e= illegal_packagename(namevb.buf,0); + e = illegal_packagename(namevb.buf, NULL); if (e) ohshit(_("illegal package name at line %d: %.250s"),lno,e); for (nvp=wantinfos; nvp->name && strcmp(nvp->name,selvb.buf); nvp++); if (!nvp->name) ohshit(_("unknown wanted status at line %d: %.250s"),lno,selvb.buf); diff --git a/src/trigcmd.c b/src/trigcmd.c index 47720cbf..a97c61c1 100644 --- a/src/trigcmd.c +++ b/src/trigcmd.c @@ -50,8 +50,8 @@ static const struct cmdinfo cmdinfos[] = { { "admindir", 0, 1, NULL, &admindir }, { "by-package", 'f', 1, NULL, &bypackage }, { "no-await", 0, 0, NULL, &bypackage, noawait }, - { "no-act", 0, 0, &f_noact, NULL, 0, 1 }, - { "check-supported", 0, 0, &f_check, NULL, 0, 1 }, + { "no-act", 0, 0, &f_noact, NULL, NULL, 1 }, + { "check-supported", 0, 0, &f_check, NULL, NULL, 1 }, { "help", 'h', 0, NULL, NULL, helponly }, { "version", 0, 0, NULL, NULL, versiononly }, /* UK spelling */