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:
    Revision    Changes     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.c        19 Apr 2016 13:04:23 -0000      2.46.4.8
  +++ rpm/rpmio/rpmlog.c        1 May 2017 19:54:43 -0000       2.46.4.9
  @@ -9,16 +9,12 @@
   #include <rpmlog.h>
   #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;
  @@ -305,7 +272,7 @@
       /* Allocate a sufficiently large buffer for output. */
       while (1) {
        va_list apc;
  -     /*@-unrecog -usedef@*/ va_copy(apc, ap); /*@=unrecog =usedef@*/
  +     va_copy(apc, ap);
        nb = vsnprintf(msgbuf, msgnb, fmt, apc);
        if (nb > -1 && (size_t)nb < msgnb)
            break;
  @@ -314,9 +281,7 @@
        else                    /* glibc 2.0 */
            msgnb *= 2;
        msgbuf = (char *) xrealloc(msgbuf, msgnb);
  -/*@-mods@*/
        va_end(apc);
  -/*@=mods@*/
       }
       msgbuf[msgnb - 1] = '\0';
       msg = msgbuf;
  @@ -346,20 +311,14 @@
       }
   
       if (cbrc & RPMLOG_DEFAULT) {
  -/*@-usereleased@*/
        cbrc = rpmlogDefault(&rec);
  -/*@=usereleased@*/
        needexit += cbrc & RPMLOG_EXIT;
       }
   
  -/*@-usereleased@*/   /* msgbuf is NULL or needs free'ing */
       msgbuf = _free(msgbuf);
  -/*@=usereleased@*/
       if (needexit)
        exit(EXIT_FAILURE);
   }
  -/*@=compmempass =nullstate@*/
  -/*@=modfilesys@*/
   
   void _rpmlog (int code, const char *fmt, ...)
   {
  @@ -367,9 +326,7 @@
       va_list ap;
   
       va_start(ap, fmt);
  -    /*@-internalglobs@*/ /* FIX: shrug */
       vrpmlog(code, fmt, ap);
  -    /*@=internalglobs@*/
       va_end(ap);
       errno = saved_errno;
   }
  @@ .
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
CVS Sources Repository                                rpm-cvs@rpm5.org

Reply via email to