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>
This commit is contained in:
Patrick Steinhardt
2024-06-07 08:37:39 +02:00
committed by Junio C Hamano
parent 5529cba09f
commit b567004b4b
38 changed files with 106 additions and 102 deletions

View File

@ -406,7 +406,7 @@ static const char *get_highest_rename_path(struct strintmap *counts)
return highest_destination_dir;
}
static char *UNKNOWN_DIR = "/"; /* placeholder -- short, illegal directory */
static const char *UNKNOWN_DIR = "/"; /* placeholder -- short, illegal directory */
static int dir_rename_already_determinable(struct strintmap *counts)
{
@ -429,8 +429,8 @@ static int dir_rename_already_determinable(struct strintmap *counts)
}
static void increment_count(struct dir_rename_info *info,
char *old_dir,
char *new_dir)
const char *old_dir,
const char *new_dir)
{
struct strintmap *counts;
struct strmap_entry *e;