diff options
author | jbj <devnull@localhost> | 2001-05-05 19:28:32 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2001-05-05 19:28:32 +0000 |
commit | 8f75bbc17dab6c334583f33c7b912fb16d2ddc4b (patch) | |
tree | 145862352d95e2d391f0d65db0027d44bf236b39 /rpmio | |
parent | d78e027808deb6aef4e65338d160986d7e576a90 (diff) | |
download | librpm-tizen-8f75bbc17dab6c334583f33c7b912fb16d2ddc4b.tar.gz librpm-tizen-8f75bbc17dab6c334583f33c7b912fb16d2ddc4b.tar.bz2 librpm-tizen-8f75bbc17dab6c334583f33c7b912fb16d2ddc4b.zip |
- enough lclint annotations and fiddles already.
CVS patchset: 4741
CVS date: 2001/05/05 19:28:32
Diffstat (limited to 'rpmio')
-rw-r--r-- | rpmio/digest.c | 6 | ||||
-rw-r--r-- | rpmio/macro.c | 14 | ||||
-rw-r--r-- | rpmio/rpmio.c | 9 | ||||
-rw-r--r-- | rpmio/rpmio.h | 6 | ||||
-rw-r--r-- | rpmio/rpmlog.h | 32 | ||||
-rw-r--r-- | rpmio/rpmmalloc.c | 2 |
6 files changed, 47 insertions, 22 deletions
diff --git a/rpmio/digest.c b/rpmio/digest.c index 461aebd47..c2e9628eb 100644 --- a/rpmio/digest.c +++ b/rpmio/digest.c @@ -6,8 +6,10 @@ #include "rpmio_internal.h" #include "debug.h" +/*@-redef@*/ typedef unsigned int uint32; typedef unsigned char byte; +/*@=redef@*/ /*@access DIGEST_CTX@*/ @@ -358,7 +360,9 @@ MD5Transform(DIGEST_CTX ctx) } static int _ie = 0x44332211; +/*@-redef@*/ static union _mendian { int i; char b[4]; } *_endian = (union _mendian *)&_ie; +/*@=redef@*/ #define IS_BIG_ENDIAN() (_endian->b[0] == '\x44') #define IS_LITTLE_ENDIAN() (_endian->b[0] == '\x11') @@ -367,6 +371,7 @@ static union _mendian { int i; char b[4]; } *_endian = (union _mendian *)&_ie; * @param buf data buffer (uint32 aligned address) * @param nbytes no. bytes of data (multiple of sizeof(uint32)) */ +/*@-shadow@*/ static void byteReverse(byte *buf, unsigned nbytes) { @@ -379,6 +384,7 @@ byteReverse(byte *buf, unsigned nbytes) buf += 4; } while (--nlongs); } +/*@=shadow@*/ DIGEST_CTX rpmDigestInit(rpmDigestFlags flags) diff --git a/rpmio/macro.c b/rpmio/macro.c index e815daed2..60eab1444 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -62,13 +62,13 @@ struct MacroContext_s rpmCLIMacroContext; * Macro expansion state. */ typedef struct MacroBuf { -/*@shared@*/ const char *s; /*!< Text to expand. */ -/*@shared@*/ char *t; /*!< Expansion buffer. */ +/*@shared@*/ const char * s; /*!< Text to expand. */ +/*@shared@*/ char * t; /*!< Expansion buffer. */ size_t nb; /*!< No. bytes remaining in expansion buffer. */ - int depth; /*!< Current expansion depth. */ - int macro_trace; /*!< Pre-print macro to expand? */ - int expand_trace; /*!< Post-print macro expansion? */ -/*@shared@*/ void *spec; /*!< (future) %file expansion info. */ + int depth; /*!< Current expansion depth. */ + int macro_trace; /*!< Pre-print macro to expand? */ + int expand_trace; /*!< Post-print macro expansion? */ +/*@shared@*/ /*@null@*/ void * spec; /*!< (future) %file expansion info?. */ /*@dependent@*/ MacroContext mc; } MacroBuf; @@ -76,6 +76,7 @@ typedef struct MacroBuf { static int expandMacro(MacroBuf *mb); +/*@-exportlocal@*/ #define MAX_MACRO_DEPTH 16 int max_macro_depth = MAX_MACRO_DEPTH; @@ -86,6 +87,7 @@ int print_expand_trace = 0; int print_macro_trace = 0; int print_expand_trace = 0; #endif +/*@=exportlocal@*/ #define MACRO_CHUNK_SIZE 16 diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c index a5f097134..9ddc7709b 100644 --- a/rpmio/rpmio.c +++ b/rpmio/rpmio.c @@ -401,7 +401,9 @@ static struct FDIO_s fdio_s = { }; FDIO_t fdio = /*@-compmempass@*/ &fdio_s /*@=compmempass@*/ ; +/*@-redef@*/ /* see lib/falloc.c */ FDIO_t fadio; /* XXX usually NULL, filled in when linked with rpm */ +/*@=redef@*/ int fdWritable(FD_t fd, int secs) { @@ -1473,6 +1475,7 @@ static ssize_t ufdRead(void * cookie, /*@out@*/ char * buf, size_t count) { int bytesRead; int total; + *buf = '\0'; /* LCL: insistent bugger. */ /* XXX preserve timedRead() behavior */ if (fdGetIo(fd) == fdio) { struct stat sb; @@ -1608,6 +1611,7 @@ static inline int ufdSeek(void * cookie, _libio_pos_t pos, int whence) { return fdSeek(cookie, pos, whence); } +/*@-usereleased@*/ /* LCL: fd handling is tricky here. */ int ufdClose( /*@only@*/ void * cookie) { FD_t fd = c2f(cookie); @@ -1720,7 +1724,9 @@ fprintf(stderr, "-> \r\n"); } return fdClose(fd); } +/*@=usereleased@*/ +/*@-nullstate@*/ /* FIX: u->{ctrl,data}->url undef after XurlLink. */ /*@null@*/ FD_t ftpOpen(const char *url, /*@unused@*/ int flags, /*@unused@*/ mode_t mode, /*@out@*/ urlinfo *uret) { @@ -1755,7 +1761,9 @@ exit: *uret = u; return fd; } +/*@=nullstate@*/ +/*@-nullstate@*/ /* FIX: u->{ctrl,data}->url undef after XurlLink. */ static /*@null@*/ FD_t httpOpen(const char * url, /*@unused@*/ int flags, /*@unused@*/ mode_t mode, /*@out@*/ urlinfo * uret) { @@ -1795,6 +1803,7 @@ exit: *uret = u; return fd; } +/*@=nullstate@*/ static /*@null@*/ FD_t ufdOpen(const char *url, int flags, mode_t mode) { diff --git a/rpmio/rpmio.h b/rpmio/rpmio.h index 13bf75df7..0533dbeb8 100644 --- a/rpmio/rpmio.h +++ b/rpmio/rpmio.h @@ -331,6 +331,7 @@ int fdFileno(void * cookie); /*@=shadow@*/ +/*@-exportlocal@*/ /** \ingroup rpmio */ /*@null@*/ FD_t fdOpen(const char *path, int flags, mode_t mode); @@ -360,6 +361,7 @@ int fdWritable(FD_t fd, int secs); /** \ingroup rpmio */ int fdReadable(FD_t fd, int secs); +/*@=exportlocal@*/ /** \ingroup rpmio * FTP and HTTP error codes. @@ -393,7 +395,9 @@ typedef enum ftperrCode_e { /** \ingroup rpmio */ +/*@-exportlocal@*/ int ufdCopy(FD_t sfd, FD_t tfd); +/*@=exportlocal@*/ /** \ingroup rpmio */ @@ -405,6 +409,7 @@ int timedRead(FD_t fd, /*@out@*/ void * bufptr, int length); #define timedRead ufdio->read +/*@-exportlocal@*/ /** \ingroup rpmio */ /*@observer@*/ extern FDIO_t fdio; @@ -428,6 +433,7 @@ int timedRead(FD_t fd, /*@out@*/ void * bufptr, int length); /** \ingroup rpmio */ /*@observer@*/ extern FDIO_t fadio; +/*@=exportlocal@*/ /*@}*/ /*@unused@*/ static inline int xislower(int c) {return (c >= 'a' && c <= 'z');} diff --git a/rpmio/rpmlog.h b/rpmio/rpmlog.h index 30607a2aa..12877f3b9 100644 --- a/rpmio/rpmlog.h +++ b/rpmio/rpmlog.h @@ -168,21 +168,6 @@ extern "C" { int rpmlogGetNrecs(void); /** - * Return text of last rpmError() message. - * @return text of last message - */ -/*@observer@*/ /*@null@*/ const char * rpmlogMessage(void); - -/** - * Return error code from last rpmError() message. - * @deprecated Perl-RPM needs, what's really needed is predictable, non-i18n - * encumbered, error text that can be retrieved through rpmlogMessage() - * and parsed IMHO. - * @return code from last message - */ -int rpmlogCode(void); - -/** * Print all rpmError() messages. * @param f file handle (NULL uses stderr) */ @@ -210,10 +195,27 @@ int rpmlogSetMask (int mask); */ /*@mayexit@*/ /*@printflike@*/ void rpmlog (int pri, const char *fmt, ...); +/*@-exportlocal@*/ +/** + * Return text of last rpmError() message. + * @return text of last message + */ +/*@observer@*/ /*@null@*/ const char * rpmlogMessage(void); + +/** + * Return error code from last rpmError() message. + * @deprecated Perl-RPM needs, what's really needed is predictable, non-i18n + * encumbered, error text that can be retrieved through rpmlogMessage() + * and parsed IMHO. + * @return code from last message + */ +int rpmlogCode(void); + /** * Set rpmlog callback function. */ rpmlogCallback rpmlogSetCallback(rpmlogCallback cb); +/*@=exportlocal@*/ /** * Set rpmlog callback function. diff --git a/rpmio/rpmmalloc.c b/rpmio/rpmmalloc.c index 7923f87ff..d5e467ab5 100644 --- a/rpmio/rpmmalloc.c +++ b/rpmio/rpmmalloc.c @@ -17,7 +17,7 @@ return NULL; } -#if !(HAVE_MCHECK_H && defined(__GNUC__)) +#if !(HAVE_MCHECK_H && defined(__GNUC__)) && !defined(__LCLINT__) /*@only@*/ void * xmalloc (size_t size) { |