three other changes to make cppcheck happier
authorMichael Schroeder <mls@suse.de>
Wed, 8 Jan 2014 13:43:10 +0000 (14:43 +0100)
committerMichael Schroeder <mls@suse.de>
Wed, 8 Jan 2014 13:43:10 +0000 (14:43 +0100)
ext/repo_rpmdb.c
src/selection.c
src/solverdebug.c

index 281a5557a5cb02329418c7fa5dc9fab497ef0b38..613b6e8969255d323b220951c3302a359989851c 100644 (file)
@@ -2122,8 +2122,7 @@ repo_add_rpm(Repo *repo, const char *rpm, int flags)
       repodata_set_bin_checksum(data, s - pool->solvables, SOLVABLE_CHECKSUM, chksumtype, solv_chksum_get(chksumh, 0));
       chksumh = solv_chksum_free(chksumh, 0);
     }
-  if (rpmhead)
-    solv_free(rpmhead);
+  solv_free(rpmhead);
   if (!(flags & REPO_NO_INTERNALIZE))
     repodata_internalize(data);
   return s - pool->solvables;
index e597a3193cc3692988a717dd6b9ccae98a8fd662..badb41f693ca6a75802dac15de6db8eb19911700 100644 (file)
@@ -840,12 +840,11 @@ int
 selection_make(Pool *pool, Queue *selection, const char *name, int flags)
 {
   int ret = 0;
-  const char *r;
 
   queue_empty(selection);
   if (*name == '/' && (flags & SELECTION_FILELIST))
     ret = selection_filelist(pool, selection, name, flags);
-  if (!ret && (flags & SELECTION_REL) != 0 && (r = strpbrk(name, "<=>")) != 0)
+  if (!ret && (flags & SELECTION_REL) != 0 && strpbrk(name, "<=>") != 0)
     ret = selection_rel(pool, selection, name, flags);
   if (!ret)
     ret = selection_depglob_arch(pool, selection, name, flags);
index de670793d0f5ed7da0e154aeebd54d1c03761d63..afec8c5a550af05acf41d859ae88840fbb14e4c6 100644 (file)
@@ -75,7 +75,7 @@ solver_printrule(Solver *solv, int type, Rule *r)
     POOL_DEBUG(type, "Rule #%d:", (int)(r - solv->rules));
   else
     POOL_DEBUG(type, "Rule:");                /* r is any rule */
-  if (r && r->d < 0)
+  if (r->d < 0)
     POOL_DEBUG(type, " (disabled)");
   POOL_DEBUG(type, "\n");
   d = r->d < 0 ? -r->d - 1 : r->d;