fix: increment pointer in funky header ext while loop.
authorjbj <devnull@localhost>
Tue, 5 Jun 2001 22:01:13 +0000 (22:01 +0000)
committerjbj <devnull@localhost>
Tue, 5 Jun 2001 22:01:13 +0000 (22:01 +0000)
CVS patchset: 4841
CVS date: 2001/06/05 22:01:13

CHANGES
lib/header.c
rpmdb/.lclintrc
rpmdb/dbconfig.c

diff --git a/CHANGES b/CHANGES
index 22b3390..395c6c5 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -77,6 +77,7 @@
        - merge sparc64/ia64 fiddles back into linux.{req,prov}.
        - automagically generate perl module dependencies always.
        - fix: lclint fiddles broke uCache initialization (#43139).
+       - always use db cursors.
 
 4.0 -> 4.0.[12]
        - add doxygen and lclint annotations most everywhere.
index 656cbc9..5513282 100644 (file)
@@ -1989,9 +1989,8 @@ static void findTag(char * name, const struct headerTagTableEntry * tags,
     /* Search extensions first to permit overriding header tags. */
     ext = extensions;
     while (ext->type != HEADER_EXT_LAST) {
-       if (ext->name == NULL)          /* XXX programmer error. */
-           continue;
-       if (ext->type == HEADER_EXT_TAG && !xstrcasecmp(ext->name, tagname))
+       if (ext->name != NULL && ext->type == HEADER_EXT_TAG
+       && !xstrcasecmp(ext->name, tagname))
            break;
 
        if (ext->type == HEADER_EXT_MORE)
@@ -2464,9 +2463,8 @@ static char * formatValue(struct sprintfTag * tag, Header h,
     if (tag->type) {
        ext = extensions;
        while (ext->type != HEADER_EXT_LAST) {
-           if (ext->name == NULL)              /* XXX programmer error. */
-               continue;
-           if (ext->type == HEADER_EXT_FORMAT && !strcmp(ext->name, tag->type))
+           if (ext->name != NULL && ext->type == HEADER_EXT_FORMAT
+           && !strcmp(ext->name, tag->type))
            {
                tagtype = ext->u.formatFunction;
                break;
index 51da5f7..6839a3d 100644 (file)
@@ -1,6 +1,7 @@
 -I. -I.. -I../build -I../lib -I../rpmio -I../popt -DHAVE_CONFIG_H -D_GNU_SOURCE
 
 +partial
+#+forcehints
 
 -warnunixlib
 -warnposix
@@ -9,9 +10,9 @@
 
 -unrecogcomments       # XXX ignore doxygen markings
 
-#+proto-param-match
+#-deepbreak            # shortcut 485 occurences
 
-#-deepbreak            # shortcut 485 cases
++checks                        # lclint level
 
 # --- not-yet at strict level
 #+ptrarith
 #+sizeoftype
 
 #+mod-uncon            # shortcut alloca is painful
-#+mod-nomods
-#+modglobsnomods
-#+modstrictglobsnomods
+#+mod-nomods           # 927 occurences
++modglobsnomods
++modstrictglobsnomods
 
-#+mod-uncon-nomods
+#+mod-uncon-nomods     # ~118 occurences
 #+mod-internal-strict
-#+mod-file-sys
-#+globnoglobs
-#+internalglobs
-#+internalglobnoglobs
-#+modglobsunchecked
-#+warnmissingglobs
-#+warnmissingglobsnomods
-#+impcheckedstrictglobs
-#+impcheckedstrictstatics
+#+mod-file-sys         # 102 occurences
+#+globnoglobs          # 1 occurence
+#+internalglobs                # 38 occurences
+#+internalglobnoglobs          # ???
+#+modglobsunchecked    # 73 occurences
++warnmissingglobs
+#+warnmissingglobsnomods       # ???
+#+impcheckedstrictglobs        # 358 occurences
+#+impcheckedstrictstatics # 1057 occurences
 #+strictusereleas
 #+strictbranchstate
 #+strictdestroy
-#+modobserveruncon
+#+modobserveruncon     # 192 occurences
 #+macroempty
 #+ansi-reserved-internal
-#+evalorderuncon
+#+evalorderuncon       # 32 occurences
 #+elseifcomplete
-#+loopswitchbreak
-#+switchswitchbreak
-#+looploopcontinue
+#+loopswitchbreak      # 286 occurences
+#+switchswitchbreak    # 32 occurences
+#+looploopcontinue     # 86 occurences
 #+whileblock
-#+forempty
++forempty
 #+forblock
 #+ifblock
-#+noeffectuncon
+#+noeffectuncon                # 228 occurences
 +topuse
 #+unusedspecial
 #+export-local
-#+oldstyle
++oldstyle
 #+sys-dir-errors
 #controlnestdepth 15
 #stringliterallen 509
 #numenummembers 127
 
 # --- not-yet at checks level
-#+predboolptr
--ptrnegate
-#-enumint
--relaxquals
-#+mustmod              # segfault in psm.c:597
-#+allglobs
-#+impcheckmodinternals
-#+uncheckedglobalias
-#+deparrays
-#+onlyunqglobaltrans 
-#+staticinittrans
-#+unqualifiedinittrans
-#+retalias
-#+assignexpose
-#+castexpose
-#+retexpose
-#+readonlytrans
-#+sefuncon
-#+ansi-reserved
-+cpp-names             # check for c++ names
-#+infloopsuncon
-#+looploopbreak
-#+switchloopbreak
-#+whileempty
-+declundef
-+export-header
-+export-header-var
-+redecl
-+noparams
-#includenest 8
+-declundef
+-predboolptr           # 773 occurences
++enumint               # 93 occurences
+-allglobs              # 131 occurrences
+-ansi-reserved         # goofy
+-infloopsuncon         # goofy
+
+-proto-param-match     # 59 occurences
 
 # don't-bother-me-yet parameters
 -branchstate           # painful
index dd2514a..74bb782 100644 (file)
@@ -472,6 +472,9 @@ dbiIndex db3New(rpmdb rpmdb, int rpmtag)
     /*@=keeptrans@*/
     dbi->dbi_rpmtag = rpmtag;
     
+    /*
+     * Inverted lists have join length of 2, primary data has join length of 1.
+     */
     switch (rpmtag) {
     case RPMDBI_PACKAGES:
     case RPMDBI_DEPENDS:
@@ -481,9 +484,10 @@ dbiIndex db3New(rpmdb rpmdb, int rpmtag)
        dbi->dbi_jlen = 2 * sizeof(int_32);
        break;
     }
-    /*@-globstate@*/
+
+    dbi->dbi_use_cursors = 1;          /* Cursors are always used now. */
+
     return dbi;
-    /*@=globstate@*/
 }
 
 const char *const prDbiOpenFlags(int dbflags, int print_dbenv_flags)