From: jbj Date: Thu, 21 Oct 1999 20:36:16 +0000 (+0000) Subject: lclint annotations and compiler cruft. X-Git-Tag: tznext/4.11.0.1.tizen20130304~8755 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bd34f27bb4617a172b1fee3be70b040e041858a1;p=tools%2Flibrpm-tizen.git lclint annotations and compiler cruft. CVS patchset: 3394 CVS date: 1999/10/21 20:36:16 --- diff --git a/.lclintrc b/.lclintrc index acd378b..14fa236 100644 --- a/.lclintrc +++ b/.lclintrc @@ -7,15 +7,23 @@ +unixlib +# don't-bother-me-yet parameters +#-branchstate +#-immediatetrans +-mustfree +#-observertrans +#-statictrans + # not-yet normal parameters --boolops # w->n +-boolops # w->n -fixedformalarray -null --predboolint # w->n --predboolothers # w->n --retvalint # w->n +-predboolint # w->n +-predboolothers # w->n +-retvalint # w->n -type + # -weak paramaters #+boolint #-boolops diff --git a/build.c b/build.c index b4e9fa4..4336793 100644 --- a/build.c +++ b/build.c @@ -294,9 +294,9 @@ extern int noLang; static int noBuild = 0; static int useCatalog = 0; -static void buildArgCallback(poptContext con, enum poptCallbackReason reason, - const struct poptOption * opt, const char * arg, - const void * data) +static void buildArgCallback( /*@unused@*/ poptContext con, + /*@unused@*/ enum poptCallbackReason reason, + const struct poptOption * opt, const char * arg, const void * data) { struct rpmBuildArguments * rba = (struct rpmBuildArguments *) data; diff --git a/build/parsePrep.c b/build/parsePrep.c index 7911158..7aa17f5 100644 --- a/build/parsePrep.c +++ b/build/parsePrep.c @@ -179,7 +179,6 @@ static int doSetupMacro(Spec spec, char *line) char ** argv; int arg; char * optArg; - char * chptr; int rc; int num; @@ -212,15 +211,12 @@ static int doSetupMacro(Spec spec, char *line) return RPMERR_BADSPEC; } - chptr = doUntar(spec, num, quietly); - if (!chptr) { - return RPMERR_BADSPEC; - } + { const char *chptr = doUntar(spec, num, quietly); + if (chptr == NULL) + return RPMERR_BADSPEC; - if (arg == 'a') - appendLineStringBuf(after, chptr); - else - appendLineStringBuf(before, chptr); + appendLineStringBuf((arg == 'a' ? after : before), chptr); + } } if (arg < -1) { @@ -269,10 +265,9 @@ static int doSetupMacro(Spec spec, char *line) /* do the default action */ if (!createDir && !skipDefaultAction) { - chptr = doUntar(spec, 0, quietly); - if (!chptr) { + const char *chptr = doUntar(spec, 0, quietly); + if (!chptr) return RPMERR_BADSPEC; - } appendLineStringBuf(spec->prep, chptr); } @@ -285,10 +280,9 @@ static int doSetupMacro(Spec spec, char *line) } if (createDir && !skipDefaultAction) { - chptr = doUntar(spec, 0, quietly); - if (!chptr) { + const char * chptr = doUntar(spec, 0, quietly); + if (chptr == NULL) return RPMERR_BADSPEC; - } appendLineStringBuf(spec->prep, chptr); } diff --git a/lib/ftp.c b/lib/ftp.c index 79b865e..ff2ede4 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -660,7 +660,7 @@ int ftpClose(FD_t fd) { return 0; } -const char *ftpStrerror(int errorNumber) { +const char *const ftpStrerror(int errorNumber) { switch (errorNumber) { case 0: return _("Success"); diff --git a/lib/header.c b/lib/header.c index 317281f..05e6406 100644 --- a/lib/header.c +++ b/lib/header.c @@ -87,26 +87,26 @@ struct sprintfToken { enum { PTOK_NONE = 0, PTOK_TAG, PTOK_ARRAY, PTOK_STRING, PTOK_COND } type; union { struct { - struct sprintfToken * format; + /*@only@*/ struct sprintfToken * format; int numTokens; } array; struct sprintfTag tag; struct { - char * string; + /*@dependent@*/ char * string; int len; } string; struct { - struct sprintfToken * ifFormat; + /*@only@*/ struct sprintfToken * ifFormat; int numIfTokens; - struct sprintfToken * elseFormat; + /*@only@*/ struct sprintfToken * elseFormat; int numElseTokens; struct sprintfTag tag; } cond; } u; }; -static void copyEntry(struct indexEntry * entry, /*@out@*/int_32 *type, - /*@out@*/void **p, /*@out@*/int_32 *c, int minimizeMemory) +static void copyEntry(struct indexEntry * entry, /*@out@*/ int_32 * type, + /*@out@*/ void ** p, /*@out@*/ int_32 * c, int minimizeMemory) { int i, tableSize; char ** ptrEntry; @@ -907,7 +907,8 @@ static int headerMatchLocale(const char *td, const char *l, const char *le) return 0; } -static char *headerFindI18NString(Header h, struct indexEntry *entry) +/*@dependent@*/ static char * +headerFindI18NString(Header h, struct indexEntry *entry) { const char *lang, *l, *le; struct indexEntry * table; @@ -1016,7 +1017,7 @@ void headerFree(Header h) free(h->index[i].data); free(h->index); - free(h); + /*@-refcounttrans@*/ free(h); /*@=refcounttrans@*/ } Header headerLink(Header h) @@ -1165,7 +1166,6 @@ headerGetLangs(Header h) int headerAddI18NString(Header h, int_32 tag, char * string, char * lang) { struct indexEntry * table, * entry; - char * charArray[2]; char * chptr; char ** strArray; int length; @@ -1181,16 +1181,17 @@ int headerAddI18NString(Header h, int_32 tag, char * string, char * lang) } if (!table && !entry) { + char * charArray[2]; + int count = 0; if (!lang || (lang[0] == 'C' && lang[1] == '\0')) { - charArray[0] = "C"; - if (!headerAddEntry(h, HEADER_I18NTABLE, RPM_STRING_ARRAY_TYPE, - &charArray, 1)) return 0; + charArray[count++] = "C"; } else { - charArray[0] = "C"; - charArray[1] = lang; - if (!headerAddEntry(h, HEADER_I18NTABLE, RPM_STRING_ARRAY_TYPE, - &charArray, 2)) return 0; + charArray[count++] = "C"; + charArray[count++] = lang; } + if (!headerAddEntry(h, HEADER_I18NTABLE, RPM_STRING_ARRAY_TYPE, + &charArray, count)) + return 0; table = findEntry(h, HEADER_I18NTABLE, RPM_STRING_ARRAY_TYPE); } @@ -1386,13 +1387,21 @@ static void freeFormat( /*@only@*/ struct sprintfToken * format, int num) int i; for (i = 0; i < num; i++) { - if (format[i].type == PTOK_ARRAY) + switch (format[i].type) { + case PTOK_ARRAY: freeFormat(format[i].u.array.format, format[i].u.array.numTokens); - if (format[i].type == PTOK_COND) { + break; + case PTOK_COND: freeFormat(format[i].u.cond.ifFormat, format[i].u.cond.numIfTokens); freeFormat(format[i].u.cond.elseFormat, format[i].u.cond.numElseTokens); + break; + case PTOK_NONE: + case PTOK_TAG: + case PTOK_STRING: + default: + break; } } free(format); @@ -1669,12 +1678,13 @@ static int parseFormat(char * str, const struct headerTagTableEntry * tags, static int parseExpression(struct sprintfToken * token, char * str, const struct headerTagTableEntry * tags, const struct headerSprintfExtension * extensions, - /*@out@*/char ** endPtr, /*@out@*/const char ** error) + /*@out@*/ char ** endPtr, /*@out@*/ const char ** error) { char * chptr, * end; const struct headerTagTableEntry * tag; const struct headerSprintfExtension * ext; + *error = NULL; chptr = str; while (*chptr && *chptr != '?') chptr++; @@ -1698,6 +1708,7 @@ static int parseExpression(struct sprintfToken * token, char * str, if (!*end) { *error = _("} expected in expression"); freeFormat(token->u.cond.ifFormat, token->u.cond.numIfTokens); + token->u.cond.ifFormat = NULL; return 1; } @@ -1705,6 +1716,7 @@ static int parseExpression(struct sprintfToken * token, char * str, if (*chptr != ':' && *chptr != '|') { *error = _(": expected following ? subexpression"); freeFormat(token->u.cond.ifFormat, token->u.cond.numIfTokens); + token->u.cond.ifFormat = NULL; return 1; } @@ -1718,6 +1730,7 @@ static int parseExpression(struct sprintfToken * token, char * str, if (*chptr != '{') { *error = _("{ expected after : in expression"); freeFormat(token->u.cond.ifFormat, token->u.cond.numIfTokens); + token->u.cond.ifFormat = NULL; return 1; } @@ -1730,6 +1743,7 @@ static int parseExpression(struct sprintfToken * token, char * str, if (!*end) { *error = _("} expected in expression"); freeFormat(token->u.cond.ifFormat, token->u.cond.numIfTokens); + token->u.cond.ifFormat = NULL; return 1; } @@ -1737,7 +1751,9 @@ static int parseExpression(struct sprintfToken * token, char * str, if (*chptr != '|') { *error = _("| expected at end of expression"); freeFormat(token->u.cond.ifFormat, token->u.cond.numIfTokens); + token->u.cond.ifFormat = NULL; freeFormat(token->u.cond.elseFormat, token->u.cond.numElseTokens); + token->u.cond.elseFormat = NULL; return 1; } } diff --git a/lib/misc.c b/lib/misc.c index 4c8eb75..d94ea9c 100644 --- a/lib/misc.c +++ b/lib/misc.c @@ -464,8 +464,8 @@ void compressFilelist(Header h) { /* this is pretty straight-forward. The only thing that even resembles a trick is getting all of this into a single xmalloc'd block */ -static void doBuildFileList(Header h, char *** fileListPtr, - int * fileCountPtr, int baseNameTag, +static void doBuildFileList(Header h, /*@out@*/ char *** fileListPtr, + /*@out@*/ int * fileCountPtr, int baseNameTag, int dirListTag, int dirIndexesTag) { int * dirList; char ** dirs; diff --git a/lib/rpmlib.h b/lib/rpmlib.h index 690c87c..d1f46e6 100644 --- a/lib/rpmlib.h +++ b/lib/rpmlib.h @@ -683,7 +683,7 @@ int showMatches(QVA_t *qva, rpmdb db, dbiIndexSet matches, QVF_t showPackage); #define QUERY_FOR_CONFIG (1 << 4) #define QUERY_FOR_DUMPFILES (1 << 8) -const char *tagName(int tag); +/*@observer@*/ const char *const tagName(int tag); extern char *specedit; extern struct poptOption rpmQueryPoptTable[]; diff --git a/lib/rpmurl.h b/lib/rpmurl.h index 2959eea..e8b3fa4 100644 --- a/lib/rpmurl.h +++ b/lib/rpmurl.h @@ -50,7 +50,7 @@ typedef struct urlinfo { extern "C" { #endif -/*@only@*/ /*@observer@*/ const char * ftpStrerror(int ftpErrno); +/*@observer@*/ const char *const ftpStrerror(int ftpErrno); void urlSetCallback(rpmCallbackFunction notify, void *notifyData, int notifyCount); int httpOpen(urlinfo *u); diff --git a/lib/tagName.c b/lib/tagName.c index b5f5a7c..2682ece 100644 --- a/lib/tagName.c +++ b/lib/tagName.c @@ -2,7 +2,7 @@ #include -const char *tagName(int tag) +const char *const tagName(int tag) { int i; static char nameBuf[128]; /* XXX yuk */ diff --git a/lib/verify.c b/lib/verify.c index 5a429ea..4a4e70d 100644 --- a/lib/verify.c +++ b/lib/verify.c @@ -247,7 +247,7 @@ int rpmVerifyScript(const char * root, Header h, FD_t err) /* ======================================================================== */ static int verifyHeader(QVA_t *qva, Header h) { - const char ** fileList; + char ** fileList; int count; int verifyResult; int i, ec, rc; diff --git a/po/rpm.pot b/po/rpm.pot index 194f871..7bb0b68 100644 --- a/po/rpm.pot +++ b/po/rpm.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 1999-10-20 17:52-0400\n" +"POT-Creation-Date: 1999-10-21 16:34-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1184,35 +1184,35 @@ msgstr "" msgid "no packages files given for rebuild" msgstr "" -#: rpm.c:1230 +#: rpm.c:1234 msgid "no spec files given for build" msgstr "" -#: rpm.c:1232 +#: rpm.c:1236 msgid "no tar files given for build" msgstr "" -#: rpm.c:1244 +#: rpm.c:1248 msgid "no packages given for uninstall" msgstr "" -#: rpm.c:1294 +#: rpm.c:1298 msgid "no packages given for install" msgstr "" -#: rpm.c:1317 +#: rpm.c:1321 msgid "extra arguments given for query of all packages" msgstr "" -#: rpm.c:1322 +#: rpm.c:1326 msgid "no arguments given for query" msgstr "" -#: rpm.c:1339 +#: rpm.c:1343 msgid "extra arguments given for verify of all packages" msgstr "" -#: rpm.c:1343 +#: rpm.c:1347 msgid "no arguments given for verify" msgstr "" @@ -1243,56 +1243,56 @@ msgstr "" msgid "Bad exit status from %s (%s)" msgstr "" -#: build/expression.c:208 +#: build/expression.c:207 msgid "syntax error while parsing ==" msgstr "" -#: build/expression.c:238 +#: build/expression.c:237 msgid "syntax error while parsing &&" msgstr "" -#: build/expression.c:247 +#: build/expression.c:246 msgid "syntax error while parsing ||" msgstr "" -#: build/expression.c:289 +#: build/expression.c:288 msgid "parse error in expression" msgstr "" -#: build/expression.c:319 +#: build/expression.c:318 msgid "unmatched (" msgstr "" -#: build/expression.c:337 +#: build/expression.c:336 msgid "undefined identifier" msgstr "" -#: build/expression.c:356 +#: build/expression.c:355 msgid "- only on numbers" msgstr "" -#: build/expression.c:372 +#: build/expression.c:371 msgid "! only on numbers" msgstr "" -#: build/expression.c:411 build/expression.c:456 build/expression.c:513 -#: build/expression.c:600 +#: build/expression.c:410 build/expression.c:455 build/expression.c:512 +#: build/expression.c:599 msgid "types must match" msgstr "" -#: build/expression.c:424 +#: build/expression.c:423 msgid "* / not suported for strings" msgstr "" -#: build/expression.c:472 +#: build/expression.c:471 msgid "- not suported for strings" msgstr "" -#: build/expression.c:613 +#: build/expression.c:612 msgid "&& and || not suported for strings" msgstr "" -#: build/expression.c:644 build/expression.c:689 +#: build/expression.c:645 build/expression.c:692 msgid "syntax error in expression" msgstr "" @@ -1720,22 +1720,22 @@ msgstr "" msgid "Internal error: Bogus tag %d" msgstr "" -#: build/parsePreamble.c:657 +#: build/parsePreamble.c:656 #, c-format msgid "Bad package specification: %s" msgstr "" -#: build/parsePreamble.c:663 +#: build/parsePreamble.c:662 #, c-format msgid "Package already exists: %s" msgstr "" -#: build/parsePreamble.c:690 +#: build/parsePreamble.c:689 #, c-format msgid "line %d: Unknown tag: %s" msgstr "" -#: build/parsePreamble.c:715 +#: build/parsePreamble.c:714 msgid "Spec file can't use BuildRoot" msgstr "" @@ -1759,43 +1759,43 @@ msgstr "" msgid "Couldn't download nosource %s: %s" msgstr "" -#: build/parsePrep.c:191 +#: build/parsePrep.c:190 msgid "Error parsing %%setup: %s" msgstr "" -#: build/parsePrep.c:206 +#: build/parsePrep.c:205 msgid "line %d: Bad arg to %%setup %c: %s" msgstr "" -#: build/parsePrep.c:227 +#: build/parsePrep.c:223 msgid "line %d: Bad %%setup option %s: %s" msgstr "" -#: build/parsePrep.c:351 +#: build/parsePrep.c:346 msgid "line %d: Need arg to %%patch -b: %s" msgstr "" -#: build/parsePrep.c:359 +#: build/parsePrep.c:354 msgid "line %d: Need arg to %%patch -z: %s" msgstr "" -#: build/parsePrep.c:371 +#: build/parsePrep.c:366 msgid "line %d: Need arg to %%patch -p: %s" msgstr "" -#: build/parsePrep.c:377 +#: build/parsePrep.c:372 msgid "line %d: Bad arg to %%patch -p: %s" msgstr "" -#: build/parsePrep.c:384 +#: build/parsePrep.c:379 msgid "Too many patches!" msgstr "" -#: build/parsePrep.c:388 +#: build/parsePrep.c:383 msgid "line %d: Bad arg to %%patch: %s" msgstr "" -#: build/parsePrep.c:424 +#: build/parsePrep.c:419 msgid "line %d: second %%prep" msgstr "" @@ -2074,7 +2074,7 @@ msgid "" msgstr "" #: lib/formats.c:69 lib/formats.c:87 lib/formats.c:108 lib/formats.c:141 -#: lib/header.c:2122 lib/header.c:2139 lib/header.c:2159 +#: lib/header.c:2138 lib/header.c:2155 lib/header.c:2175 msgid "(not a number)" msgstr "" @@ -2169,173 +2169,173 @@ msgstr "" msgid "Data type %d not supprted\n" msgstr "" -#: lib/header.c:1119 +#: lib/header.c:1120 #, c-format msgid "Bad count for headerAddEntry(): %d\n" msgstr "" -#: lib/header.c:1520 +#: lib/header.c:1529 #, c-format msgid "missing { after %" msgstr "" -#: lib/header.c:1548 +#: lib/header.c:1557 msgid "missing } after %{" msgstr "" -#: lib/header.c:1560 +#: lib/header.c:1569 msgid "empty tag format" msgstr "" -#: lib/header.c:1570 +#: lib/header.c:1579 msgid "empty tag name" msgstr "" -#: lib/header.c:1585 +#: lib/header.c:1594 msgid "unknown tag" msgstr "" -#: lib/header.c:1611 +#: lib/header.c:1620 msgid "] expected at end of array" msgstr "" -#: lib/header.c:1627 +#: lib/header.c:1636 msgid "unexpected ]" msgstr "" -#: lib/header.c:1629 +#: lib/header.c:1638 msgid "unexpected }" msgstr "" -#: lib/header.c:1682 +#: lib/header.c:1692 msgid "? expected in expression" msgstr "" -#: lib/header.c:1689 +#: lib/header.c:1699 msgid "{ expected after ? in expression" msgstr "" -#: lib/header.c:1699 lib/header.c:1731 +#: lib/header.c:1709 lib/header.c:1744 msgid "} expected in expression" msgstr "" -#: lib/header.c:1706 +#: lib/header.c:1717 msgid ": expected following ? subexpression" msgstr "" -#: lib/header.c:1719 +#: lib/header.c:1731 msgid "{ expected after : in expression" msgstr "" -#: lib/header.c:1738 +#: lib/header.c:1752 msgid "| expected at end of expression" msgstr "" -#: lib/header.c:1905 +#: lib/header.c:1921 msgid "(unknown type)" msgstr "" -#: lib/install.c:143 lib/uninstall.c:193 +#: lib/install.c:141 lib/uninstall.c:193 #, c-format msgid " file: %s action: %s\n" msgstr "" -#: lib/install.c:161 +#: lib/install.c:159 #, c-format msgid "user %s does not exist - using root" msgstr "" -#: lib/install.c:169 +#: lib/install.c:167 #, c-format msgid "group %s does not exist - using root" msgstr "" -#: lib/install.c:197 +#: lib/install.c:195 msgid "%%instchangelog value in macro file should be a number, but isn't" msgstr "" #. this would probably be a good place to check if disk space #. was used up - if so, we should return a different error -#: lib/install.c:360 +#: lib/install.c:358 #, c-format msgid "unpacking of archive failed%s%s: %s" msgstr "" -#: lib/install.c:361 +#: lib/install.c:359 msgid " on file " msgstr "" -#: lib/install.c:404 +#: lib/install.c:402 msgid "installing a source package\n" msgstr "" -#: lib/install.c:415 +#: lib/install.c:413 #, c-format msgid "cannot create %s: %s" msgstr "" -#: lib/install.c:423 lib/install.c:445 +#: lib/install.c:421 lib/install.c:443 #, c-format msgid "cannot write to %s" msgstr "" -#: lib/install.c:427 +#: lib/install.c:425 #, c-format msgid "sources in: %s\n" msgstr "" -#: lib/install.c:438 +#: lib/install.c:436 #, c-format msgid "cannot create %s" msgstr "" -#: lib/install.c:449 +#: lib/install.c:447 #, c-format msgid "spec file in: %s\n" msgstr "" -#: lib/install.c:483 lib/install.c:511 +#: lib/install.c:481 lib/install.c:509 msgid "source package contains no .spec file" msgstr "" -#: lib/install.c:532 +#: lib/install.c:530 #, c-format msgid "renaming %s to %s\n" msgstr "" -#: lib/install.c:534 lib/install.c:812 lib/uninstall.c:26 +#: lib/install.c:532 lib/install.c:810 lib/uninstall.c:26 #, c-format msgid "rename of %s to %s failed: %s" msgstr "" -#: lib/install.c:624 +#: lib/install.c:622 msgid "source package expected, binary found" msgstr "" -#: lib/install.c:681 +#: lib/install.c:679 #, c-format msgid "package: %s-%s-%s files test = %d\n" msgstr "" -#: lib/install.c:742 +#: lib/install.c:740 msgid "stopping install as we're running --test\n" msgstr "" -#: lib/install.c:747 +#: lib/install.c:745 msgid "running preinstall script (if any)\n" msgstr "" -#: lib/install.c:772 +#: lib/install.c:770 #, c-format msgid "warning: %s created as %s" msgstr "" -#: lib/install.c:808 +#: lib/install.c:806 #, c-format msgid "warning: %s saved as %s" msgstr "" -#: lib/install.c:882 +#: lib/install.c:880 msgid "running postinstall scripts (if any)\n" msgstr "" @@ -3299,7 +3299,7 @@ msgstr "" msgid "excluding file %s%s\n" msgstr "" -#: lib/transaction.c:412 lib/transaction.c:495 +#: lib/transaction.c:412 lib/transaction.c:496 #, c-format msgid "excluding directory %s\n" msgstr "" @@ -3309,12 +3309,12 @@ msgstr "" msgid "relocating %s to %s\n" msgstr "" -#: lib/transaction.c:488 +#: lib/transaction.c:489 #, c-format msgid "relocating directory %s to %s\n" msgstr "" -#: lib/transaction.c:636 +#: lib/transaction.c:637 #, c-format msgid "%s skipped due to missingok flag\n" msgstr "" diff --git a/popt/po/popt.pot b/popt/po/popt.pot index 8848085..c7230f1 100644 --- a/popt/po/popt.pot +++ b/popt/po/popt.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 1999-09-21 14:38-0400\n" +"POT-Creation-Date: 1999-10-21 16:18-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -14,10 +14,10 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: ENCODING\n" -#: ../popthelp.c:35 +#: popthelp.c:36 msgid "Show this help message" msgstr "" -#: ../popthelp.c:36 +#: popthelp.c:37 msgid "Display brief usage message" msgstr "" diff --git a/popt/popt.c b/popt/popt.c index 9075899..df3b7f5 100644 --- a/popt/popt.c +++ b/popt/popt.c @@ -536,12 +536,12 @@ int poptAddAlias(poptContext con, struct poptAlias newAlias, sizeof(newAlias) * con->numAliases); alias = con->aliases + aliasNum; - alias->longName = (newAlias->longName) - ? strcpy(malloc(strlen(newAlias->longName) + 1), newAlias->longName) + alias->longName = (newAlias.longName) + ? strcpy(malloc(strlen(newAlias.longName) + 1), newAlias.longName) : NULL; - alias->shortName = newAlias->shortName; - alias->argc = newAlias->argc; - alias->argv = newAlias->argv; + alias->shortName = newAlias.shortName; + alias->argc = newAlias.argc; + alias->argv = newAlias.argv; return 0; } diff --git a/rpm.c b/rpm.c index b5572e6..cd3498d 100755 --- a/rpm.c +++ b/rpm.c @@ -1082,7 +1082,7 @@ int main(int argc, char ** argv) !rpmDetectPGPVersion(NULL)) { fprintf(stderr, _("pgp not found: ")); exit(EXIT_FAILURE); - } /* fall through */ + } /*@fallthrough@*/ case RPMSIGTAG_GPG: passPhrase = rpmGetPassPhrase(_("Enter pass phrase: "), sigTag); if (passPhrase == NULL) { @@ -1096,7 +1096,7 @@ int main(int argc, char ** argv) fprintf(stderr, _("Invalid %%_signature spec in macro file.\n")); exit(EXIT_FAILURE); - break; + /*@notreached@*/ break; } } } else { @@ -1153,7 +1153,7 @@ int main(int argc, char ** argv) /* XXX don't overflow single byte exit status */ if (ec > 255) ec = 255; exit(ec); - break; + /*@notreached@*/ break; case MODE_RESIGN: if (!poptPeekArg(optCon)) @@ -1162,7 +1162,7 @@ int main(int argc, char ** argv) /* XXX don't overflow single byte exit status */ if (ec > 255) ec = 255; exit(ec); - break; + /*@notreached@*/ break; case MODE_REBUILD: case MODE_RECOMPILE: @@ -1202,17 +1202,21 @@ int main(int argc, char ** argv) /* these fallthroughs are intentional */ case 'a': buildArgs.buildAmount |= RPMBUILD_PACKAGESOURCE; + /*@fallthrough@*/ case 'b': buildArgs.buildAmount |= RPMBUILD_PACKAGEBINARY; buildArgs.buildAmount |= RPMBUILD_CLEAN; + /*@fallthrough@*/ case 'i': buildArgs.buildAmount |= RPMBUILD_INSTALL; if ((buildArgs.buildChar == 'i') && buildArgs.shortCircuit) break; + /*@fallthrough@*/ case 'c': buildArgs.buildAmount |= RPMBUILD_BUILD; if ((buildArgs.buildChar == 'c') && buildArgs.shortCircuit) break; + /*@fallthrough@*/ case 'p': buildArgs.buildAmount |= RPMBUILD_PREP; break;