]> git.draconx.ca Git - gob-dx.git/commitdiff
Avoid GLib deprecation warnings when building gob.
authorNick Bowler <nbowler@draconx.ca>
Fri, 7 Feb 2020 02:27:40 +0000 (21:27 -0500)
committerNick Bowler <nbowler@draconx.ca>
Fri, 7 Feb 2020 02:27:40 +0000 (21:27 -0500)
The g_strdown functions are deprecated in GLib, we already have a
gob_strdown function which does the same thing with g_ascii_tolower,
but it seems a couple spots were missed.

There is also a call to g_strcasecmp which can be replaced by
g_ascii_strcasecmp.

src/checks.c
src/parse.y
src/util.c
src/util.h

index c651e9a5fd153a01c160d25e2516b808a4c8d5e7..683fe008dfe7a667900c9ef9633e2a9db164b469 100644 (file)
@@ -195,10 +195,12 @@ check_duplicate_named (Class *c, Node *node, const char *id, int line_no)
                } else {
                        continue;
                }
-               if (n == node ||
-                   line_no >= nline_no ||
-                   g_strcasecmp (nid, id) != 0)
+
+               if (n == node || line_no >= nline_no
+                   || gob_strcasecmp (nid, id) != 0)
+               {
                        continue;
+               }
                error_printf (GOB_ERROR, nline_no,
                              "named symbol (argument or signal) '%s' "
                              "redefined, first defined on line %d "
index 662f990f2a4e6afea8f2dfd45de2ac0b944f403c..9b29d2562109bec13644632cab193900f9054c89 100644 (file)
@@ -614,9 +614,9 @@ property_link_and_export (Node *node)
                        const char *setcast = "";
                        char *to_free = NULL;
                        set_func = g_strdup_printf ("g_value_set_%s", prop->gtktype);
-                       g_strdown (set_func);
+                       gob_strdown (set_func);
                        get_func = g_strdup_printf ("g_value_get_%s", prop->gtktype);
-                       g_strdown (get_func);
+                       gob_strdown (get_func);
 
                        if (for_cpp) {
                                if (strcmp (prop->gtktype, "FLAGS") == 0) {
index 6405190d703ed4b35ec752adf6150c610fb818ac..0b26fa15f7d7e8b946b26a584967df0ade2c9d97 100644 (file)
@@ -407,6 +407,12 @@ gob_strdown (char *str)
        return str;
 }
 
+int
+gob_strcasecmp(const char *s1, const char *s2)
+{
+       return g_ascii_strcasecmp(s1, s2);
+}
+
 char *
 gob_str_delete_quotes(char *str)
 {
index daf6cf560c3e544536ff14f886da20714fc3a9fe..bb69ed21bed5ddcc07b807c8c4b7d25a26bf774f 100644 (file)
@@ -37,9 +37,11 @@ void error_printf(int type, int line, const char *error, ...) G_GNUC_PRINTF (3,
 char * remove_sep(const char *base);
 /* replace the : separator from a typename with a different character*/
 char * replace_sep(const char *base, char r);
+
 char * gob_strup (char *s);
 char * gob_strdown (char *s);
 char * gob_str_delete_quotes(char *str);
+int gob_strcasecmp(const char *s1, const char *s2);
 
 /*separate the namespace part and then replace rest of
   separators with r*/