mirror of https://github.com/ecmwf/eccodes.git
C++: Cannot use variable name of 'new'
This commit is contained in:
parent
a2034bcaa2
commit
4fe5f475e7
|
@ -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 */
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue