RPM Package Manager, CVS Repository
http://rpm5.org/cvs/
Server: rpm5.org Name: Jeff Johnson
Root: /v/rpm/cvs Email: j...@rpm5.org
Module: rpm Date: 01-May-2017 21:54:43
Branch: rpm-5_4 Handle: 2017050119544300
Modified files: (Branch: rpm-5_4)
rpm/rpmio rpmlog.c
Log:
- splint: RIP.
Summary:
RevisionChanges Path
2.46.4.9+6 -49 rpm/rpmio/rpmlog.c
patch -p0 <<'@@ .'
Index: rpm/rpmio/rpmlog.c
$ cvs diff -u -r2.46.4.8 -r2.46.4.9 rpmlog.c
--- rpm/rpmio/rpmlog.c19 Apr 2016 13:04:23 - 2.46.4.8
+++ rpm/rpmio/rpmlog.c1 May 2017 19:54:43 - 2.46.4.9
@@ -9,16 +9,12 @@
#include
#include "debug.h"
-/*@access rpmlogRec @*/
-
#ifdef __cplusplus
GENfree(rpmlogRec)
#endif /* __cplusplus */
-/*@unchecked@*/
static int nrecs = 0;
-/*@unchecked@*/
-static /*@only@*/ /*@null@*/ rpmlogRec recs = NULL;
+static rpmlogRec recs = NULL;
int rpmlogGetNrecs(void)
{
@@ -49,7 +45,6 @@
return (rec ? rec->pri : RPMLOG_DEBUG);
}
-/*@-modfilesys@*/
void rpmlogPrint(FILE *f)
{
int i;
@@ -64,11 +59,8 @@
fprintf(f, "%s", rec->message);
}
}
-/*@=modfilesys@*/
void rpmlogClose (void)
- /*@globals recs, nrecs @*/
- /*@modifies recs, nrecs @*/
{
int i;
@@ -81,23 +73,17 @@
nrecs = 0;
}
-void rpmlogOpen (/*@unused@*/ const char *ident,
- /*@unused@*/ int option,
- /*@unused@*/ int facility)
+void rpmlogOpen (const char *ident, int option, int facility)
{
}
-/*@unchecked@*/
static unsigned rpmlogMask = RPMLOG_UPTO( RPMLOG_NOTICE );
#if 0
-/*@unchecked@*/
-static /*@unused@*/ unsigned rpmlogFacility = RPMLOG_USER;
+static unsigned rpmlogFacility = RPMLOG_USER;
#endif
int rpmlogSetMask (int mask)
- /*@globals rpmlogMask @*/
- /*@modifies rpmlogMask @*/
{
int omask = rpmlogMask;
if (mask)
@@ -105,15 +91,11 @@
return omask;
}
-/*@unchecked@*/ /*@null@*/
static rpmlogCallback _rpmlogCallback;
-/*@unchecked@*/ /*@null@*/
static rpmlogCallbackData _rpmlogCallbackData;
rpmlogCallback rpmlogSetCallback(rpmlogCallback cb, rpmlogCallbackData data)
- /*@globals _rpmlogCallback, _rpmlogCallbackData @*/
- /*@modifies _rpmlogCallback, _rpmlogCallbackData @*/
{
rpmlogCallback ocb = _rpmlogCallback;
_rpmlogCallback = cb;
@@ -122,18 +104,14 @@
}
int rpmlogGetCallback(rpmlogCallback *cb, rpmlogCallbackData *data)
- /*@globals _rpmlogCallback, _rpmlogCallbackData @*/
{
*cb = _rpmlogCallback;
*data = _rpmlogCallbackData;
return 0;
}
-/*@unchecked@*/ /*@null@*/
static FILE * _stdlog = NULL;
-/*@-readonlytrans@*/ /* FIX: double indirection. */
-/*@observer@*/ /*@unchecked@*/
static const char *rpmlogMsgPrefix[] = {
N_("fatal error: "),/*!< RPMLOG_EMERG */
N_("fatal error: "),/*!< RPMLOG_ALERT */
@@ -176,7 +154,6 @@
"", /*!< RPMLOG_INFO */
ANSI_BRIGHT_BLUE,/*!< RPMLOG_DEBUG */
};
-/*@=readonlytrans@*/
const char * rpmlogLevelPrefix(rpmlogLvl pri)
{
@@ -189,8 +166,6 @@
}
static int rpmlogDefault(rpmlogRec rec)
- /*@globals fileSystem @*/
- /*@modifies fileSystem @*/
{
FILE *msgout = (_stdlog ? _stdlog : stderr);
const char * colorOn = isatty(fileno(msgout))
@@ -261,8 +236,6 @@
}
FILE * rpmlogSetFile(FILE * fp)
- /*@globals _stdlog @*/
- /*@modifies _stdlog @*/
{
FILE * ofp = _stdlog;
_stdlog = fp;
@@ -270,24 +243,18 @@
}
#if !defined(HAVE_VSNPRINTF)
-static inline int vsnprintf(char * buf, /*@unused@*/ int nb,
- const char * fmt, va_list ap)
+static inline int vsnprintf(char * buf, int nb, const char * fmt, va_list ap)
{
return vsprintf(buf, fmt, ap);
}
#endif
-/*@-modfilesys@*/
-/*@-compmempass@*/ /* FIX: rpmlogMsgPrefix[] dependent, not unqualified */
-/*@-nullstate@*/ /* FIX: rpmlogMsgPrefix[] may be NULL */
void vrpmlog (unsigned code, const char *fmt, va_list ap)
- /*@globals nrecs, recs, internalState @*/
- /*@modifies nrecs, recs, internalState @*/
{
unsigned pri = RPMLOG_PRI(code);
unsigned mask = RPMLOG_MASK(pri);
#if 0
-/*@unused@*/ unsigned fac = RPMLOG_FAC(code);
+unsigned fac = RPMLOG_FAC(code);
#endif
char *msgbuf, *msg;
size_t msgnb = BUFSIZ;
@@