Splint fiddles.
authorjbj <devnull@localhost>
Sat, 9 Oct 2004 17:44:27 +0000 (17:44 +0000)
committerjbj <devnull@localhost>
Sat, 9 Oct 2004 17:44:27 +0000 (17:44 +0000)
CVS patchset: 7436
CVS date: 2004/10/09 17:44:27

rpmdb/Makefile.am
rpmdb/header.c
rpmdb/rpmdb.c
system.h

index 95e0fd1..277031d 100644 (file)
@@ -67,7 +67,7 @@ tagtbl.c: Makefile.am $(top_srcdir)/lib/rpmlib.h
        @echo '/*@observer@*/ /*@unchecked@*/' >> $@
        @echo 'static const struct headerTagTableEntry_s rpmTagTbl[] = {' >> $@
        ${AWK} '/(RPMTAG_[A-Z0-9]*)[ \t]+([0-9]*)/ && !/internal/ { tt = "NULL"; if ($$5 == "c") {tt = "CHAR"} if ($$5 == "h") {tt = "INT16"} if ($$5 == "i") {tt = "INT32"} if ($$5 == "l") {tt = "INT64"} if ($$5 == "s") {tt = "STRING"} if ($$5 == "x") {tt = "BIN"} if ($$5 == "s[]") {tt = "STRING_ARRAY"} if ($$5 == "s{}") {tt = "I18NSTRING"} if ($$2 == "=") { printf("\t{ \"%s\",    %s      RPM_%s_TYPE },\n", $$1, $$3, tt) } else { printf("\t{ \"%s\",   %s,     RPM_%s_TYPE },\n", $$2, $$3, tt) } }' < $(top_srcdir)/lib/rpmlib.h >> $@
-       @echo ' { NULL, 0 }' >> $@
+       @echo ' { NULL, 0, 0 }' >> $@
        @echo '};' >> $@
        @echo '' >> $@
        @echo '/*@observer@*/ /*@unchecked@*/' >> $@
index f5bc72c..5e1e0dd 100644 (file)
@@ -2506,7 +2506,9 @@ static char * hsaReserve(headerSprintfArgs hsa, size_t need)
  * @param val          tag value to find
  * @return             tag name, NULL on not found
  */
+/*@observer@*/ /*@null@*/
 static const char * myTagName(headerTagTableEntry tbl, int val)
+       /*@*/
 {
     static char name[128];
     const char * s;
@@ -2535,6 +2537,7 @@ static const char * myTagName(headerTagTableEntry tbl, int val)
  * @return             tag value, 0 on not found
  */
 static int myTagValue(headerTagTableEntry tbl, const char * name)
+       /*@*/
 {
     for (; tbl->name != NULL; tbl++) {
        if (!xstrcasecmp(tbl->name, name))
@@ -3343,11 +3346,14 @@ static char * singleSprintf(headerSprintfArgs hsa, sprintfToken token,
            if (isxml) {
                const char * tagN = myTagName(hsa->tags, spft->u.tag.tag);
 
-               need = strlen(tagN) + sizeof("  <rpmTag name=\"\">\n") - 1;
+               need = sizeof("  <rpmTag name=\"\">\n") - 1;
+               if (tagN != NULL)
+                   need += strlen(tagN);
                t = hsaReserve(hsa, need);
 /*@-boundswrite@*/
                te = stpcpy(t, "  <rpmTag name=\"");
-               te = stpcpy(te, tagN);
+               if (tagN != NULL)
+                   te = stpcpy(te, tagN);
                te = stpcpy(te, "\">\n");
 /*@=boundswrite@*/
                hsa->vallen += (te - t);
index 4e15d03..c2dad54 100644 (file)
@@ -14,7 +14,7 @@
 /*@=noparams@*/
 #if defined(__LCLINT__)
 /*@-declundef -exportheader -redecl @*/ /* LCL: missing annotation */
-extern int fnmatch (const char *pattern, const char *string, int flags)
+extern int fnmatch (const char *__pattern, const char *__name, int __flags)
        /*@*/;
 /*@=declundef =exportheader =redecl @*/
 #endif
@@ -65,6 +65,7 @@ int dbiTagsMax = 0;
 /* We use this to comunicate back to the the rpm transaction
  *  what their install instance was on a rpmdbAdd().
  */ 
+/*@unchecked@*/
 unsigned int myinstall_instance = 0;
 
 /* Bit mask macros. */
@@ -375,9 +376,11 @@ union _dbswap {
 };
 
 #define        _DBSWAP(_a) \
+/*@-bounds@*/ \
   { unsigned char _b, *_c = (_a).uc; \
     _b = _c[3]; _c[3] = _c[0]; _c[0] = _b; \
     _b = _c[2]; _c[2] = _c[1]; _c[1] = _b; \
+/*@=bounds@*/ \
   }
 
 /**
index a751fdc..c23e025 100644 (file)
--- a/system.h
+++ b/system.h
@@ -597,7 +597,7 @@ extern int glob_pattern_p (const char *__pattern, int __quote)
 /*@=constuse@*/
 #endif
 
-extern int fnmatch (const char *pattern, const char *string, int flags)
+extern int fnmatch (const char *__pattern, const char *__name, int __flags)
        /*@*/;
 /*@=declundef =incondefs @*/
 #endif