projects
/
haproxy-2.5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1d66e39
)
CLEANUP: cache: Use proper data types in secondary_key_cmp()
author
Tim Duesterhus
<tim@bastelstu.be>
Mon, 18 Jan 2021 12:41:18 +0000
(13:41 +0100)
committer
William Lallemand
<wlallemand@haproxy.org>
Mon, 18 Jan 2021 14:01:46 +0000
(15:01 +0100)
- hash_length is `unsigned int` and so should offset.
- idx is compared to a `size_t` and thus it should also be.
src/cache.c
patch
|
blob
|
history
diff --git
a/src/cache.c
b/src/cache.c
index
16dc7d6
..
f556fdc
100644
(file)
--- a/
src/cache.c
+++ b/
src/cache.c
@@
-208,8
+208,8
@@
struct cache_entry *entry_exist(struct cache *cache, char *hash)
static int secondary_key_cmp(const char *ref_key, const char *new_key)
{
int retval = 0;
- int idx = 0;
- int offset = 0;
+ size_t idx = 0;
+ unsigned int offset = 0;
const struct vary_hashing_information *info;
for (idx = 0; idx < sizeof(vary_information)/sizeof(*vary_information) && !retval; ++idx) {