Code

Make C++ - compilable. Mostly remove pointer casting problems. Fix a few places...
[inkscape.git] / src / libcroco / cr-attr-sel.c
index cf048d10247047b94c2b8d2ca00c30af8faef099..3c4800e663cc2366a1b256b8643c4ea672a139c8 100644 (file)
@@ -39,9 +39,7 @@
 CRAttrSel *
 cr_attr_sel_new (void)
 {
-        CRAttrSel *result = NULL;
-
-        result = g_malloc0 (sizeof (CRAttrSel));
+        CRAttrSel *result = (CRAttrSel *)g_malloc0 (sizeof (CRAttrSel));
 
         return result;
 }
@@ -112,9 +110,7 @@ cr_attr_sel_to_string (CRAttrSel * a_this)
                 }
 
                 if (cur->name) {
-                        guchar *name = NULL;
-
-                        name = g_strndup (cur->name->stryng->str, 
+                        gchar *name = g_strndup (cur->name->stryng->str, 
                                           cur->name->stryng->len);
                         if (name) {
                                 g_string_append (str_buf, name);
@@ -124,9 +120,7 @@ cr_attr_sel_to_string (CRAttrSel * a_this)
                 }
 
                 if (cur->value) {
-                        guchar *value = NULL;
-
-                        value = g_strndup (cur->value->stryng->str, 
+                        gchar *value = g_strndup (cur->value->stryng->str, 
                                            cur->value->stryng->len);
                         if (value) {
                                 switch (cur->match_way) {
@@ -159,7 +153,7 @@ cr_attr_sel_to_string (CRAttrSel * a_this)
         }
 
         if (str_buf) {
-                result = str_buf->str;
+                result = (guchar *)str_buf->str;
                 g_string_free (str_buf, FALSE);
         }