X-Git-Url: https://git.draconx.ca/gitweb/gob-dx.git/blobdiff_plain/4ebed70c2119e843ce48ae4fa6076475d2100693..7f1f40bee65a4a3d3947ad8c50b535ea0754f629:/src/util.c diff --git a/src/util.c b/src/util.c index d040ee4..ddf9485 100644 --- a/src/util.c +++ b/src/util.c @@ -1,6 +1,7 @@ /* GOB C Preprocessor * Copyright (C) 1999-2000 the Free Software Foundation. * Copyright (C) 2000 Eazel, Inc. + * Copyright (C) 2022 Nick Bowler * * Author: George Lebl * @@ -356,7 +357,7 @@ setup_special_array(Class *c, gboolean *special_array) char * get_type (const Type *t, gboolean postfix_to_stars) { - char *s; + char *ret, *s; int i; int extra; GString *gs; @@ -383,35 +384,32 @@ get_type (const Type *t, gboolean postfix_to_stars) g_string_append_c (gs, '*'); g_string_append_c (gs, ' '); } - - return g_string_free (gs, FALSE); + ret = gs->str; + g_string_free(gs, FALSE); + return ret; } -char * -gob_strup (char *str) +#if HAVE_G_ASCII_STRCASECMP +char *gob_strup(char *str) { char *s; + for (s = str; *s; s++) - *s = g_ascii_toupper (*s); + *s = g_ascii_toupper(*s); return str; } -char * -gob_strdown (char *str) +char *gob_strdown(char *str) { char *s; + for (s = str; *s; s++) - *s = g_ascii_tolower (*s); + *s = g_ascii_tolower(*s); return str; } - -int -gob_strcasecmp(const char *s1, const char *s2) -{ - return g_ascii_strcasecmp(s1, s2); -} +#endif char * gob_str_delete_quotes(char *str)