[pacman-dev] [PATCH] Remove dead stores reported by clang-analyzer
Sebastian Nowicki
sebnow at gmail.com
Sun Apr 3 02:14:48 EDT 2011
Signed-off-by: Sebastian Nowicki <sebnow at gmail.com>
---
lib/libalpm/be_local.c | 2 +-
lib/libalpm/pkghash.c | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c
index 82c1d59..788b3c6 100644
--- a/lib/libalpm/be_local.c
+++ b/lib/libalpm/be_local.c
@@ -405,7 +405,7 @@ static int local_db_populate(pmdb_t *db)
* http://kerneltrap.org/mailarchive/linux-btrfs/2010/1/23/6723483/thread
*/
est_count = 0;
- while((ent = readdir(dbdir)) != NULL) {
+ while(readdir(dbdir) != NULL) {
est_count++;
}
rewinddir(dbdir);
diff --git a/lib/libalpm/pkghash.c b/lib/libalpm/pkghash.c
index 761ca72..b4dfcb6 100644
--- a/lib/libalpm/pkghash.c
+++ b/lib/libalpm/pkghash.c
@@ -84,12 +84,11 @@ pmpkghash_t *_alpm_pkghash_create(size_t size)
static size_t get_hash_position(unsigned long name_hash, pmpkghash_t *hash)
{
size_t position;
- alpm_list_t *ptr;
position = name_hash % hash->buckets;
/* collision resolution using open addressing with linear probing */
- while((ptr = hash->hash_table[position]) != NULL) {
+ while(hash->hash_table[position] != NULL) {
position = (position + 1) % hash->buckets;
}
--
1.7.4.2
More information about the pacman-dev
mailing list