Skip to content

Commit

Permalink
Suppress warnings from "scan-build"
Browse files Browse the repository at this point in the history
  • Loading branch information
vacantron committed Dec 2, 2024
1 parent 482f9c3 commit ec6804c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,15 @@ static inline int hlist_empty(const struct hlist_head *h)

static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
{
#ifndef __clang_analyzer__
struct hlist_node *first = h->first;
n->next = first;
if (first)
first->pprev = &n->next;

h->first = n;
n->pprev = &h->first;
#endif
}

static inline bool hlist_unhashed(const struct hlist_node *h)
Expand Down Expand Up @@ -213,6 +215,7 @@ void *cache_get(const cache_t *cache, uint32_t key, bool update)
*/
FORCE_INLINE void cache_trim_map(cache_t *cache, uint32_t key)
{
#ifndef __clang_analyzer__
cache_entry_t *entry;
struct hlist_node *safe;
#ifdef __HAVE_TYPEOF
Expand All @@ -237,6 +240,7 @@ FORCE_INLINE void cache_trim_map(cache_t *cache, uint32_t key)
hlist_del_init(&entry->ht_list);
free(entry);
}
#endif
}

/*
Expand Down

0 comments on commit ec6804c

Please sign in to comment.