aboutsummaryrefslogtreecommitdiffstats
path: root/t/helper/test-hashmap.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-06-07 08:37:39 +0200
committerJunio C Hamano <gitster@pobox.com>2024-06-07 10:30:48 -0700
commitb567004b4b43f9b0d88aa1f0b15698eae8f15836 (patch)
treefc7b75831c1eb79a89c0196fbb78bd6b7d09d0b1 /t/helper/test-hashmap.c
parentMerge branch 'ps/leakfixes' into ps/no-writable-strings (diff)
downloadgit-b567004b4b43f9b0d88aa1f0b15698eae8f15836.tar.gz
git-b567004b4b43f9b0d88aa1f0b15698eae8f15836.zip
global: improve const correctness when assigning string constants
We're about to enable `-Wwrite-strings`, which changes the type of string constants to `const char[]`. Fix various sites where we assign such constants to non-const variables. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/helper/test-hashmap.c')
-rw-r--r--t/helper/test-hashmap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/t/helper/test-hashmap.c b/t/helper/test-hashmap.c
index 0eb0b3d49c..2912899558 100644
--- a/t/helper/test-hashmap.c
+++ b/t/helper/test-hashmap.c
@@ -36,7 +36,8 @@ static int test_entry_cmp(const void *cmp_data,
}
static struct test_entry *alloc_test_entry(unsigned int hash,
- char *key, char *value)
+ const char *key,
+ const char *value)
{
size_t klen = strlen(key);
size_t vlen = strlen(value);