diff options
author | jbj <devnull@localhost> | 2000-07-07 19:46:05 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2000-07-07 19:46:05 +0000 |
commit | dc421620ffedebd5d0f9cb24790d72610c0c09b2 (patch) | |
tree | 3afec52421566975e17f2ebe4de2ce06f589dc88 | |
parent | a463744b6d4e6e5c0f05730cc77039f4a2e17fd7 (diff) | |
download | rpm-dc421620ffedebd5d0f9cb24790d72610c0c09b2.tar.gz rpm-dc421620ffedebd5d0f9cb24790d72610c0c09b2.tar.bz2 rpm-dc421620ffedebd5d0f9cb24790d72610c0c09b2.zip |
lclint fiddles.
CVS patchset: 3921
CVS date: 2000/07/07 19:46:05
-rw-r--r-- | rpmio/.lclintrc | 43 | ||||
-rw-r--r-- | rpmio/rpmio.c | 18 | ||||
-rw-r--r-- | rpmio/rpmio_api.c | 1 | ||||
-rw-r--r-- | rpmio/rpmio_internal.h | 44 |
4 files changed, 76 insertions, 30 deletions
diff --git a/rpmio/.lclintrc b/rpmio/.lclintrc new file mode 100644 index 000000000..c5e1d3e49 --- /dev/null +++ b/rpmio/.lclintrc @@ -0,0 +1,43 @@ +-I. -I.. -I../popt -DHAVE_CONFIG_H -D_GNU_SOURCE + ++partial + +-warnunixlib +-warnposix + ++unixlib + +# XXX ignore doxygen markings +-unrecogcomments + +# don't-bother-me-yet parameters +-branchstate +#-immediatetrans +-mustfree +#-observertrans +#-statictrans + +# not-yet normal parameters +-boolops # w->n +-fixedformalarray +-null +-predboolint # w->n +-predboolothers # w->n +-retvalint # w->n +-type + +# not-yet -weak paramaters +#+boolint +#-boolops +#+ignorequals +#+ignoresigns +#-mustfree +#+longintegral +#+matchanyintegral +#-nullpass +#-observertrans +#-predboolint +#-predboolothers +#-retvalint +#-retvalother +#-shiftsigned diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c index 2300470b9..afe7a9531 100644 --- a/rpmio/rpmio.c +++ b/rpmio/rpmio.c @@ -182,7 +182,7 @@ FD_t fdDup(int fdno) { fd = fdNew("open (fdDup)"); fdSetFdno(fd, nfdno); DBGIO(fd, (stderr, "==> fdDup(%d) fd %p %s\n", fdno, fd, fdbg(fd))); - return fd; + /*@-refcounttrans@*/ return fd; /*@=refcounttrans@*/ } #ifdef USE_COOKIE_SEEK_POINTER @@ -372,7 +372,7 @@ DBGIO(fd, (stderr, "==>\tfdClose(%p) rc %lx %s\n", fd, (long)rc, fdbg(fd))); fdSetFdno(fd, fdno); fd->flags = flags; DBGIO(fd, (stderr, "==>\tfdOpen(\"%s\",%x,0%o) %s\n", path, flags, (unsigned)mode, fdbg(fd))); - return fd; + /*@-refcounttrans@*/ return fd; /*@=refcounttrans@*/ } static struct FDIO_s fdio_s = { @@ -769,8 +769,9 @@ fprintf(stderr, "<- %s\n", s); if (!strncmp(s, "Connection:", ne)) { if (!strcmp(e, "close")) ctrl->persist = 0; - } else + } #if 0 + else if (!strncmp(s, "Content-Type:", ne)) { } else if (!strncmp(s, "Transfer-Encoding:", ne)) { @@ -780,9 +781,8 @@ fprintf(stderr, "<- %s\n", s); ctrl->wr_chunked = 0; } else if (!strncmp(s, "Allow:", ne)) { - } else + } #endif - ; continue; } @@ -1630,7 +1630,7 @@ int ufdClose( /*@only@*/ void * cookie) if (fd->wr_chunked) { int rc; /* XXX HTTP PUT requires terminating 0 length chunk. */ - fdWrite(fd, NULL, 0); + (void) fdWrite(fd, NULL, 0); fd->wr_chunked = 0; /* XXX HTTP PUT requires terminating entity-header. */ if (_ftp_debug) @@ -2253,10 +2253,10 @@ int Fseek(FD_t fd, off_t offset, int whence) { DBGIO(fd, (stderr, "==> Fseek(%p,%ld,%d) %s\n", fd, (long)offset, whence, fdbg(fd))); if (fdGetIo(fd) == fpio) { - FILE *f; + FILE *fp; - f = fdGetFILE(fd); - rc = fseek(f, offset, whence); + fp = fdGetFILE(fd); + rc = fseek(fp, offset, whence); return rc; } diff --git a/rpmio/rpmio_api.c b/rpmio/rpmio_api.c index b57717ff6..166c843fd 100644 --- a/rpmio/rpmio_api.c +++ b/rpmio/rpmio_api.c @@ -4,6 +4,7 @@ #define fdFileno _fdFileno #include <rpmio_internal.h> #undef fdFileno +/*@access FD_t@*/ int fdFileno(void * cookie) { FD_t fd; diff --git a/rpmio/rpmio_internal.h b/rpmio/rpmio_internal.h index 1ca0b8a94..88171a59a 100644 --- a/rpmio/rpmio_internal.h +++ b/rpmio/rpmio_internal.h @@ -84,48 +84,50 @@ int ftpCmd(const char * cmd, const char * url, const char * arg2); int ufdClose( /*@only@*/ void * cookie); -static inline /*@null@*/ const FDIO_t fdGetIo(FD_t fd) { +/*@unused@*/ static inline /*@null@*/ const FDIO_t fdGetIo(FD_t fd) { FDSANE(fd); return fd->fps[fd->nfps].io; } -static inline void fdSetIo(FD_t fd, FDIO_t io) { +/*@unused@*/ static inline void fdSetIo(FD_t fd, FDIO_t io) { FDSANE(fd); fd->fps[fd->nfps].io = io; } -static inline /*@dependent@*/ /*@null@*/ FILE * fdGetFILE(FD_t fd) { +/*@unused@*/ static inline /*@dependent@*/ /*@null@*/ FILE * fdGetFILE(FD_t fd) { FDSANE(fd); return ((FILE *)fd->fps[fd->nfps].fp); } -static inline /*@dependent@*/ /*@null@*/ void * fdGetFp(FD_t fd) { +/*@unused@*/ static inline /*@dependent@*/ /*@null@*/ void * fdGetFp(FD_t fd) { FDSANE(fd); return fd->fps[fd->nfps].fp; } -static inline void fdSetFp(FD_t fd, /*@keep@*/ void * fp) { +/*@unused@*/ static inline void fdSetFp(FD_t fd, void * fp) { FDSANE(fd); fd->fps[fd->nfps].fp = fp; } -static inline int fdGetFdno(FD_t fd) { +/*@unused@*/ static inline int fdGetFdno(FD_t fd) { FDSANE(fd); return fd->fps[fd->nfps].fdno; } -static inline void fdSetFdno(FD_t fd, int fdno) { +/*@unused@*/ static inline void fdSetFdno(FD_t fd, int fdno) { FDSANE(fd); fd->fps[fd->nfps].fdno = fdno; } -static inline void fdSetContentLength(FD_t fd, ssize_t contentLength) +/*@unused@*/ static inline void fdSetContentLength(FD_t fd, ssize_t contentLength) { FDSANE(fd); fd->contentLength = fd->bytesRemain = contentLength; } -static inline void fdPush(FD_t fd, FDIO_t io, void * fp, int fdno) { +/*@unused@*/ static inline void fdPush(FD_t fd, FDIO_t io, + void * fp, int fdno) +{ FDSANE(fd); if (fd->nfps >= (sizeof(fd->fps)/sizeof(fd->fps[0]) - 1)) return; @@ -135,7 +137,7 @@ static inline void fdPush(FD_t fd, FDIO_t io, void * fp, int fdno) { fdSetFdno(fd, fdno); } -static inline void fdPop(FD_t fd) { +/*@unused@*/ static inline void fdPop(FD_t fd) { FDSANE(fd); if (fd->nfps < 0) return; fdSetIo(fd, NULL); @@ -144,14 +146,14 @@ static inline void fdPop(FD_t fd) { fd->nfps--; } -static inline void fdstat_enter(FD_t fd, int opx) +/*@unused@*/ static inline void fdstat_enter(FD_t fd, int opx) { if (fd->stats == NULL) return; fd->stats->ops[opx].count++; gettimeofday(&fd->stats->begin, NULL); } -static inline time_t tvsub(struct timeval *etv, struct timeval *btv) { +/*@unused@*/ static inline time_t tvsub(struct timeval *etv, struct timeval *btv) { time_t secs, usecs; if (!(etv && btv)) return 0; secs = etv->tv_sec - btv->tv_sec; @@ -163,7 +165,7 @@ static inline time_t tvsub(struct timeval *etv, struct timeval *btv) { return ((secs * 1000) + (usecs/1000)); } -static inline void fdstat_exit(FD_t fd, int opx, ssize_t rc) +/*@unused@*/ static inline void fdstat_exit(FD_t fd, int opx, ssize_t rc) { struct timeval end; if (rc == -1) fd->syserrno = errno; @@ -184,7 +186,7 @@ static inline void fdstat_exit(FD_t fd, int opx, ssize_t rc) fd->stats->begin = end; /* structure assignment */ } -static inline void fdstat_print(FD_t fd, const char * msg, FILE * fp) { +/*@unused@*/ static inline void fdstat_print(FD_t fd, const char * msg, FILE * fp) { int opx; if (fd->stats == NULL) return; for (opx = 0; opx < 4; opx++) { @@ -211,34 +213,34 @@ static inline void fdstat_print(FD_t fd, const char * msg, FILE * fp) { } } -static inline void fdSetSyserrno(FD_t fd, int syserrno, const void * errcookie) { +/*@unused@*/ static inline void fdSetSyserrno(FD_t fd, int syserrno, /*@kept@*/ const void * errcookie) { FDSANE(fd); fd->syserrno = syserrno; fd->errcookie = errcookie; } -static inline int fdGetRdTimeoutSecs(FD_t fd) { +/*@unused@*/ static inline int fdGetRdTimeoutSecs(FD_t fd) { FDSANE(fd); return fd->rd_timeoutsecs; } -static inline long int fdGetCpioPos(FD_t fd) { +/*@unused@*/ static inline long int fdGetCpioPos(FD_t fd) { FDSANE(fd); return fd->fd_cpioPos; } -static inline void fdSetCpioPos(FD_t fd, long int cpioPos) { +/*@unused@*/ static inline void fdSetCpioPos(FD_t fd, long int cpioPos) { FDSANE(fd); fd->fd_cpioPos = cpioPos; } -static inline FD_t c2f(void * cookie) { +/*@unused@*/ static inline FD_t c2f(void * cookie) { FD_t fd = (FD_t) cookie; FDSANE(fd); - return fd; + /*@-refcounttrans@*/ return fd; /*@=refcounttrans@*/ } -static inline int fdFileno(void * cookie) { +/*@unused@*/ static inline int fdFileno(void * cookie) { FD_t fd; if (cookie == NULL) return -2; fd = c2f(cookie); |