From 4fe5f475e78a9ca8f9c506f846bc0b1d6e083450 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 9 Jun 2022 18:10:07 +0100 Subject: [PATCH] C++: Cannot use variable name of 'new' --- src/eccodes_prototypes.h | 2 +- src/string_util.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/eccodes_prototypes.h b/src/eccodes_prototypes.h index 44fdef110..4acbbcb0f 100644 --- a/src/eccodes_prototypes.h +++ b/src/eccodes_prototypes.h @@ -1466,7 +1466,7 @@ int string_ends_with(const char* str1, const char* str2); int count_char_in_string(const char* str, char c); const char* codes_get_product_name(ProductKind product); const char* grib_get_type_name(int type); -char* string_replace_char(char *str, char old, char new); +char* string_replace_char(char *str, char oldc, char newc); void string_remove_char(char * str, char c); /* functions.c */ diff --git a/src/string_util.c b/src/string_util.c index f59670555..b2262fde8 100644 --- a/src/string_util.c +++ b/src/string_util.c @@ -212,11 +212,11 @@ const char* grib_get_type_name(int type) /* Replace all occurrences of character in string. * Returns pointer to the NUL byte at the end of 's' */ -char *string_replace_char(char *s, char old, char new) +char *string_replace_char(char *s, char oldc, char newc) { for (; *s; ++s) - if (*s == old) - *s = new; + if (*s == oldc) + *s = newc; return s; }