diff options
author | jbj <devnull@localhost> | 2001-10-13 22:01:38 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2001-10-13 22:01:38 +0000 |
commit | 4b67d7621c20e1f2c5aa1ebdf7bb26eb3a6ae0d5 (patch) | |
tree | e9f6fa3bae9cc045fdd4f716ac747c1cad5e103e /rpmio | |
parent | 525f4cb8b1317120c36a75f47f796d285f69078c (diff) | |
download | librpm-tizen-4b67d7621c20e1f2c5aa1ebdf7bb26eb3a6ae0d5.tar.gz librpm-tizen-4b67d7621c20e1f2c5aa1ebdf7bb26eb3a6ae0d5.tar.bz2 librpm-tizen-4b67d7621c20e1f2c5aa1ebdf7bb26eb3a6ae0d5.zip |
More lclint annotations.
CVS patchset: 5105
CVS date: 2001/10/13 22:01:38
Diffstat (limited to 'rpmio')
-rw-r--r-- | rpmio/macro.c | 34 | ||||
-rw-r--r-- | rpmio/rpmio.c | 44 | ||||
-rw-r--r-- | rpmio/rpmio_internal.h | 8 | ||||
-rw-r--r-- | rpmio/rpmpgp.c | 64 | ||||
-rw-r--r-- | rpmio/rpmrpc.c | 17 |
5 files changed, 87 insertions, 80 deletions
diff --git a/rpmio/macro.c b/rpmio/macro.c index c29985a26..1db21cc8f 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -1093,13 +1093,13 @@ expandMacro(MacroBuf mb) switch(c) { case '%': if (*s != '%') - break; + /*@switchbreak@*/ break; s++; /* skip first % in %% */ /*@fallthrough@*/ default: SAVECHAR(mb, c); continue; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; } /* Expand next macro */ @@ -1116,10 +1116,10 @@ expandMacro(MacroBuf mb) switch(*s++) { case '!': negate = ((negate + 1) % 2); - break; + /*@switchbreak@*/ break; case '?': chkexist++; - break; + /*@switchbreak@*/ break; } } f = se = s; @@ -1143,7 +1143,7 @@ expandMacro(MacroBuf mb) /* For "%name " macros ... */ if ((c = *fe) && isblank(c)) grab = '\n'; - break; + /*@switchbreak@*/ break; case '(': /* %(...) shell escape */ if ((se = matchchar(s, c, ')')) == NULL) { rpmError(RPMERR_BADSPEC, @@ -1160,7 +1160,7 @@ expandMacro(MacroBuf mb) s = se; continue; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; case '{': /* %{...}/%{...:...} substitution */ if ((se = matchchar(s, c, '}')) == NULL) { rpmError(RPMERR_BADSPEC, @@ -1174,10 +1174,10 @@ expandMacro(MacroBuf mb) switch(*f++) { case '!': negate = ((negate + 1) % 2); - break; + /*@switchbreak@*/ break; case '?': chkexist++; - break; + /*@switchbreak@*/ break; } } for (fe = f; (c = *fe) && !strchr(" :}", c);) @@ -1193,7 +1193,7 @@ expandMacro(MacroBuf mb) default: /*@innerbreak@*/ break; } - break; + /*@switchbreak@*/ break; } /* XXX Everything below expects fe > f */ @@ -1544,7 +1544,7 @@ rpmInitMacros(MacroContext mc, const char *macrofiles) SKIPBLANK(n, c); if (c != '%') - continue; + /*@innercontinue@*/ continue; n++; /* skip % */ (void)rpmDefineMacro(NULL, n, RMIL_MACROFILES); } @@ -1703,10 +1703,10 @@ char *rpmCleanPath(char * path) if (s[1] == '/' && s[2] == '/') { *t++ = *s++; *t++ = *s++; - break; + /*@switchbreak@*/ break; } begin=1; - break; + /*@switchbreak@*/ break; case '/': /* Move parent dir forward */ for (se = te + 1; se < t && *se != '/'; se++) @@ -1719,17 +1719,17 @@ char *rpmCleanPath(char * path) s++; while (t > path && t[-1] == '/') t--; - break; + /*@switchbreak@*/ break; case '.': /* Leading .. is special */ if (begin && s[1] == '.') { /*fprintf(stderr, " leading \"..\"\n"); */ *t++ = *s++; - break; + /*@switchbreak@*/ break; } /* Single . is special */ if (begin && s[1] == '\0') { - break; + /*@switchbreak@*/ break; } /* Trim embedded ./ , trailing /. */ if ((t[-1] == '/' && s[1] == '\0') || (t != path && s[1] == '/')) { @@ -1748,10 +1748,10 @@ char *rpmCleanPath(char * path) s++; continue; } - break; + /*@switchbreak@*/ break; default: begin = 0; - break; + /*@switchbreak@*/ break; } *t++ = *s++; } diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c index b52b1deda..23fec6c03 100644 --- a/rpmio/rpmio.c +++ b/rpmio/rpmio.c @@ -467,10 +467,10 @@ fprintf(stderr, "*** fdWritable fdno %d rc %d %s\n", fdno, rc, strerror(errno)); switch (errno) { case EINTR: continue; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; default: return rc; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; } } return rc; @@ -505,10 +505,10 @@ int fdReadable(FD_t fd, int secs) switch (errno) { case EINTR: continue; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; default: return rc; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; } } return rc; @@ -537,13 +537,13 @@ int fdFgets(FD_t fd, char * buf, size_t len) case -1: /* error */ ec = -1; continue; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; case 0: /* timeout */ ec = -1; continue; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; default: /* data to read */ - break; + /*@switchbreak@*/ break; } errno = 0; @@ -557,9 +557,9 @@ int fdFgets(FD_t fd, char * buf, size_t len) switch (errno) { case EWOULDBLOCK: continue; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } if (_rpmio_debug) fprintf(stderr, "*** read: fd %p rc %d errno %d %s \"%s\"\n", fd, rc, errno, strerror(errno), buf); @@ -814,7 +814,7 @@ fprintf(stderr, "<- %s\n", s); strncpy(errorCode, e, 3); errorCode[3] = '\0'; } - continue; + /*@innercontinue@*/ continue; } /* HTTP: look for "token: ..." */ @@ -860,7 +860,7 @@ fprintf(stderr, "<- %s\n", s); if (!strncmp(s, "Allow:", ne)) { } #endif - continue; + /*@innercontinue@*/ continue; } /* HTTP: look for "<TITLE>501 ... </TITLE>" */ @@ -1564,9 +1564,9 @@ static ssize_t ufdRead(void * cookie, /*@out@*/ char * buf, size_t count) case -1: /* error */ case 0: /* timeout */ return total; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; default: /* data to read */ - break; + /*@switchbreak@*/ break; } rc = fdRead(fd, buf + total, count - total); @@ -1575,9 +1575,9 @@ static ssize_t ufdRead(void * cookie, /*@out@*/ char * buf, size_t count) switch (errno) { case EWOULDBLOCK: continue; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } if (_rpmio_debug) fprintf(stderr, "*** read: rc %d errno %d %s \"%s\"\n", rc, errno, strerror(errno), buf); @@ -1628,9 +1628,9 @@ fprintf(stderr, "*** ufdWrite fd %p WRITE PAST END OF CONTENT\n", fd); case -1: /* error */ case 0: /* timeout */ return total; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; default: /* data to write */ - break; + /*@switchbreak@*/ break; } rc = fdWrite(fd, buf + total, count - total); @@ -1639,9 +1639,9 @@ fprintf(stderr, "*** ufdWrite fd %p WRITE PAST END OF CONTENT\n", fd); switch (errno) { case EWOULDBLOCK: continue; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } if (_rpmio_debug) fprintf(stderr, "*** write: rc %d errno %d %s \"%s\"\n", rc, errno, strerror(errno), buf); @@ -2577,22 +2577,26 @@ static inline void cvtfmode (const char *m, while ((c = *m++) != '\0') { switch (c) { case '.': - break; + /*@switchbreak@*/ break; case '+': flags &= ~(O_RDONLY|O_WRONLY); flags |= O_RDWR; if (--nstdio > 0) *stdio++ = c; continue; + /*@notreached@*/ /*@switchbreak@*/ break; case 'b': if (--nstdio > 0) *stdio++ = c; continue; + /*@notreached@*/ /*@switchbreak@*/ break; case 'x': flags |= O_EXCL; if (--nstdio > 0) *stdio++ = c; continue; + /*@notreached@*/ /*@switchbreak@*/ break; default: if (--nother > 0) *other++ = c; continue; + /*@notreached@*/ /*@switchbreak@*/ break; } break; } diff --git a/rpmio/rpmio_internal.h b/rpmio/rpmio_internal.h index 2483bcca0..ff5be7135 100644 --- a/rpmio/rpmio_internal.h +++ b/rpmio/rpmio_internal.h @@ -367,17 +367,17 @@ void fdstat_print(/*@null@*/ FD_t fd, const char * msg, FILE * fp) fprintf(fp, "%8d reads, %8ld total bytes in %d.%03d secs\n", ops->count, (long)ops->bytes, (int)(ops->msecs/1000), (int)(ops->msecs%1000)); - break; + /*@switchbreak@*/ break; case FDSTAT_WRITE: if (msg) fprintf(fp, "%s:", msg); fprintf(fp, "%8d writes, %8ld total bytes in %d.%03d secs\n", ops->count, (long)ops->bytes, (int)(ops->msecs/1000), (int)(ops->msecs%1000)); - break; + /*@switchbreak@*/ break; case FDSTAT_SEEK: - break; + /*@switchbreak@*/ break; case FDSTAT_CLOSE: - break; + /*@switchbreak@*/ break; } } } diff --git a/rpmio/rpmpgp.c b/rpmio/rpmpgp.c index be36fe8c8..06e5bc25c 100644 --- a/rpmio/rpmpgp.c +++ b/rpmio/rpmpgp.c @@ -339,9 +339,9 @@ int pgpPrtPktSigV3(pgpPkt pkt, const byte *h, unsigned int hlen) mp32nsethex(&_dig->c, pgpMpiHex(p)); if (_debug && _print) printf("\t m**d = "), mp32println(_dig->c.size, _dig->c.data); - break; + /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } } pgpPrtStr("", pgpSigRSA[i]); @@ -353,12 +353,12 @@ printf("\t m**d = "), mp32println(_dig->c.size, _dig->c.data); switch (i) { case 0: /* r */ pgpHexSet(pgpSigDSA[i], 160, &_dig->r, p); - break; + /*@switchbreak@*/ break; case 1: /* s */ pgpHexSet(pgpSigDSA[i], 160, &_dig->s, p); - break; + /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } } pgpPrtStr("", pgpSigDSA[i]); @@ -390,22 +390,22 @@ int pgpPrtSubType(const byte *h, unsigned int hlen) for (i = 1; i < plen; i++) pgpPrtVal(" ", pgpSymkeyTbl, p[i]); pgpPrtNL(); - break; + /*@switchbreak@*/ break; case PGPSUBTYPE_PREFER_HASH: /* preferred hash algorithms */ for (i = 1; i < plen; i++) pgpPrtVal(" ", pgpHashTbl, p[i]); pgpPrtNL(); - break; + /*@switchbreak@*/ break; case PGPSUBTYPE_PREFER_COMPRESS:/* preferred compression algorithms */ for (i = 1; i < plen; i++) pgpPrtVal(" ", pgpCompressionTbl, p[i]); pgpPrtNL(); - break; + /*@switchbreak@*/ break; case PGPSUBTYPE_KEYSERVER_PREFERS:/* key server preferences */ for (i = 1; i < plen; i++) pgpPrtVal(" ", pgpKeyServerPrefsTbl, p[i]); pgpPrtNL(); - break; + /*@switchbreak@*/ break; case PGPSUBTYPE_SIG_CREATE_TIME: case PGPSUBTYPE_SIG_EXPIRE_TIME: case PGPSUBTYPE_KEY_EXPIRE_TIME: @@ -416,7 +416,7 @@ int pgpPrtSubType(const byte *h, unsigned int hlen) } else pgpPrtHex("", p+1, plen-1); pgpPrtNL(); - break; + /*@switchbreak@*/ break; case PGPSUBTYPE_ISSUER_KEYID: /* issuer key ID */ case PGPSUBTYPE_EXPORTABLE_CERT: @@ -446,7 +446,7 @@ int pgpPrtSubType(const byte *h, unsigned int hlen) default: pgpPrtHex("", p+1, plen-1); pgpPrtNL(); - break; + /*@switchbreak@*/ break; } p += plen; hlen -= plen; @@ -513,9 +513,9 @@ fprintf(stderr, " unhash[%u] -- %s\n", plen, pgpHexStr(p, plen)); mp32nsethex(&_dig->c, pgpMpiHex(p)); if (_debug && _print) printf("\t m**d = "), mp32println(_dig->c.size, _dig->c.data); - break; + /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } } pgpPrtStr("", pgpSigRSA[i]); @@ -527,12 +527,12 @@ printf("\t m**d = "), mp32println(_dig->c.size, _dig->c.data); switch (i) { case 0: /* r */ pgpHexSet(pgpSigDSA[i], 160, &_dig->r, p); - break; + /*@switchbreak@*/ break; case 1: /* s */ pgpHexSet(pgpSigDSA[i], 160, &_dig->s, p); - break; + /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } } pgpPrtStr("", pgpSigDSA[i]); @@ -636,14 +636,14 @@ int pgpPrtKeyV3(pgpPkt pkt, const byte *h, unsigned int hlen) mp32bsethex(&_dig->rsa_pk.n, pgpMpiHex(p)); if (_debug && _print) printf("\t n = "), mp32println(_dig->rsa_pk.n.size, _dig->rsa_pk.n.modl); - break; + /*@switchbreak@*/ break; case 1: /* e */ mp32nsethex(&_dig->rsa_pk.e, pgpMpiHex(p)); if (_debug && _print) printf("\t e = "), mp32println(_dig->rsa_pk.e.size, _dig->rsa_pk.e.data); - break; + /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } } pgpPrtStr("", pgpPublicRSA[i]); @@ -655,24 +655,24 @@ printf("\t e = "), mp32println(_dig->rsa_pk.e.size, _dig->rsa_pk.e.data); mp32bsethex(&_dig->p, pgpMpiHex(p)); if (_debug && _print) printf("\t p = "), mp32println(_dig->p.size, _dig->p.modl); - break; + /*@switchbreak@*/ break; case 1: /* q */ mp32bsethex(&_dig->q, pgpMpiHex(p)); if (_debug && _print) printf("\t q = "), mp32println(_dig->q.size, _dig->q.modl); - break; + /*@switchbreak@*/ break; case 2: /* g */ mp32nsethex(&_dig->g, pgpMpiHex(p)); if (_debug && _print) printf("\t g = "), mp32println(_dig->g.size, _dig->g.data); - break; + /*@switchbreak@*/ break; case 3: /* y */ mp32nsethex(&_dig->y, pgpMpiHex(p)); if (_debug && _print) printf("\t y = "), mp32println(_dig->y.size, _dig->y.data); - break; + /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } } pgpPrtStr("", pgpPublicDSA[i]); @@ -718,14 +718,14 @@ int pgpPrtKeyV4(pgpPkt pkt, const byte *h, unsigned int hlen) mp32bsethex(&_dig->rsa_pk.n, pgpMpiHex(p)); if (_debug && _print) printf("\t n = "), mp32println(_dig->rsa_pk.n.size, _dig->rsa_pk.n.modl); - break; + /*@switchbreak@*/ break; case 1: /* e */ mp32nsethex(&_dig->rsa_pk.e, pgpMpiHex(p)); if (_debug && _print) printf("\t e = "), mp32println(_dig->rsa_pk.e.size, _dig->rsa_pk.e.data); - break; + /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } } pgpPrtStr("", pgpPublicRSA[i]); @@ -737,24 +737,24 @@ printf("\t e = "), mp32println(_dig->rsa_pk.e.size, _dig->rsa_pk.e.data); mp32bsethex(&_dig->p, pgpMpiHex(p)); if (_debug && _print) printf("\t p = "), mp32println(_dig->p.size, _dig->p.modl); - break; + /*@switchbreak@*/ break; case 1: /* q */ mp32bsethex(&_dig->q, pgpMpiHex(p)); if (_debug && _print) printf("\t q = "), mp32println(_dig->q.size, _dig->q.modl); - break; + /*@switchbreak@*/ break; case 2: /* g */ mp32nsethex(&_dig->g, pgpMpiHex(p)); if (_debug && _print) printf("\t g = "), mp32println(_dig->g.size, _dig->g.data); - break; + /*@switchbreak@*/ break; case 3: /* y */ mp32nsethex(&_dig->y, pgpMpiHex(p)); if (_debug && _print) printf("\t y = "), mp32println(_dig->y.size, _dig->y.data); - break; + /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } } pgpPrtStr("", pgpPublicDSA[i]); diff --git a/rpmio/rpmrpc.c b/rpmio/rpmrpc.c index c94769740..b52d172d3 100644 --- a/rpmio/rpmrpc.c +++ b/rpmio/rpmrpc.c @@ -890,35 +890,38 @@ static int ftpNLST(const char * url, ftpSysCall_t ftpSysCall, /*@innerbreak@*/ break; *se++ = '\0'; - if (!strncmp(s, "total ", sizeof("total ")-1)) continue; + if (!strncmp(s, "total ", sizeof("total ")-1)) + /*@innercontinue@*/ continue; o = NULL; for (bingo = 0, n = se; n >= s; n--) { switch (*n) { case '\0': oe = ne = n; - break; + /*@switchbreak@*/ break; case ' ': if (o || !(n[-3] == ' ' && n[-2] == '-' && n[-1] == '>')) { while (*(++n) == ' ') {}; bingo++; - break; + /*@switchbreak@*/ break; } for (o = n + 1; *o == ' '; o++) {}; n -= 3; ne = n; - break; + /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } if (bingo) /*@innerbreak@*/ break; } - if (nbn != (ne - n)) continue; /* Same name length? */ - if (strncmp(n, bn, nbn)) continue; /* Same name? */ + if (nbn != (ne - n)) /* Same name length? */ + /*@innercontinue@*/ continue; + if (strncmp(n, bn, nbn)) /* Same name? */ + /*@innercontinue@*/ continue; moretodo = 0; /*@innerbreak@*/ break; |