From 26bfb16490857ab82a97efd04ec08965ac797730 Mon Sep 17 00:00:00 2001 From: Robert Pengelly Date: Thu, 1 Oct 2026 00:49:43 +0100 Subject: [PATCH] Fix const qualifier warnings --- ld.c | 2 +- pe.c | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ld.c b/ld.c index 439e1ce..0e9c347 100644 --- a/ld.c +++ b/ld.c @@ -486,7 +486,7 @@ int main (int argc, char **argv) { if (argc && *argv) { - char *p; + const char *p; program_name = *argv; if ((p = strrchr (program_name, '/')) || (p = strrchr (program_name, '\\'))) { diff --git a/pe.c b/pe.c index 7b65d03..8784c54 100644 --- a/pe.c +++ b/pe.c @@ -952,8 +952,8 @@ struct symbol_info *create_symbol_list (struct export_name *export_name, unsigne struct symbol_info *info_list = 0; struct symbol_info **last_info_list_p = &info_list; - char *name, *p; - const char *module_name; + const char *module_name, *p; + char *name; struct symbol_info *symbol_info; unsigned long i, j; @@ -1187,10 +1187,12 @@ struct data_entry { static void write_implib (struct export_name *export_names, unsigned long num_names, unsigned long ordinal_base) { struct symbol_info *info_list, *info; - unsigned long *offsets, offset_count, symbol_count, length, i; + unsigned long *offsets, offset_count, symbol_count, length, i; unsigned long module_name_length; - char *header_name, *module_name, *p; + + const char *p; + char *header_name, *module_name; unsigned long offset = 0, offset2 = 0, offset3 = 0; int bHeaderName; @@ -1795,7 +1797,7 @@ static int export_name_compar (const void *a, const void *b) { static char *unat_name (const char *orig_name) { - char *at_p; + const char *at_p; return ((at_p = strchr (orig_name, '@')) ? xstrndup (orig_name, at_p - orig_name) : xstrdup (orig_name)); } @@ -2740,7 +2742,7 @@ static char *unprefix_name (const char *orig_name) { static char *undecorate_name (const char *orig_name) { - char *at_p; + const char *at_p; if (orig_name[0] == '_') { orig_name++; -- 2.34.1