Code

remove rudimental general-purpose clipart, add some Inkscape-related graphics, update...
[inkscape.git] / src / libcroco / cr-term.c
index 33eed40f9b2aac1ce2917c059ca9f6d0dda5c0c6..63b39271b638ee78ea7ee2805c148eedf5b21339 100644 (file)
@@ -84,9 +84,7 @@ cr_term_clear (CRTerm * a_this)
 CRTerm *
 cr_term_new (void)
 {
-        CRTerm *result = NULL;
-
-        result = g_try_malloc (sizeof (CRTerm));
+        CRTerm *result = (CRTerm *)g_try_malloc (sizeof (CRTerm));
         if (!result) {
                 cr_utils_trace_info ("Out of memory");
                 return NULL;
@@ -106,14 +104,15 @@ CRTerm *
 cr_term_parse_expression_from_buf (const guchar * a_buf,
                                    enum CREncoding a_encoding)
 {
-        CRParser *parser = NULL;
         CRTerm *result = NULL;
         enum CRStatus status = CR_OK;
 
         g_return_val_if_fail (a_buf, NULL);
 
-        parser = cr_parser_new_from_buf ((guchar*)a_buf, strlen (a_buf),
-                                         a_encoding, FALSE);
+        CRParser *parser = cr_parser_new_from_buf (
+                                                (guchar*)a_buf,
+                                                                                 strlen ((char *)a_buf),
+                                          a_encoding, FALSE);
         g_return_val_if_fail (parser, NULL);
 
         status = cr_parser_try_to_skip_spaces_and_comments (parser);
@@ -280,8 +279,8 @@ cr_term_to_string (CRTerm * a_this)
 {
         GString *str_buf = NULL;
         CRTerm *cur = NULL;
-        guchar *result = NULL,
-                *content = NULL;
+        guchar *result = NULL;
+        gchar *content = NULL;
 
         g_return_val_if_fail (a_this, NULL);
 
@@ -330,7 +329,7 @@ cr_term_to_string (CRTerm * a_this)
                 switch (cur->type) {
                 case TERM_NUMBER:
                         if (cur->content.num) {
-                                content = cr_num_to_string (cur->content.num);
+                                content = (gchar *)cr_num_to_string (cur->content.num);
                         }
 
                         if (content) {
@@ -361,7 +360,7 @@ cr_term_to_string (CRTerm * a_this)
 
                                         if (tmp_str) {
                                                 g_string_append (str_buf, 
-                                                                tmp_str);
+                                                                                   (gchar *)tmp_str);
                                                 g_free (tmp_str);
                                                 tmp_str = NULL;
                                         }
@@ -406,8 +405,8 @@ cr_term_to_string (CRTerm * a_this)
                 case TERM_URI:
                         if (cur->content.str) {
                                 content = g_strndup
-                                        (cur->content.str->stryng->str,
-                                         cur->content.str->stryng->len);
+                                          (cur->content.str->stryng->str,
+                                           cur->content.str->stryng->len);
                         }
 
                         if (content) {
@@ -426,7 +425,7 @@ cr_term_to_string (CRTerm * a_this)
                                 tmp_str = cr_rgb_to_string (cur->content.rgb);
 
                                 if (tmp_str) {
-                                        g_string_append (str_buf, tmp_str);
+                                        g_string_append (str_buf, (gchar *)tmp_str);
                                         g_free (tmp_str);
                                         tmp_str = NULL;
                                 }
@@ -464,7 +463,7 @@ cr_term_to_string (CRTerm * a_this)
         }
 
         if (str_buf) {
-                result = str_buf->str;
+                result = (guchar *)str_buf->str;
                 g_string_free (str_buf, FALSE);
                 str_buf = NULL;
         }
@@ -476,8 +475,8 @@ guchar *
 cr_term_one_to_string (CRTerm * a_this)
 {
         GString *str_buf = NULL;
-        guchar *result = NULL,
-                *content = NULL;
+        guchar *result = NULL;
+        gchar *content = NULL;
 
         g_return_val_if_fail (a_this, NULL);
 
@@ -525,7 +524,7 @@ cr_term_one_to_string (CRTerm * a_this)
         switch (a_this->type) {
         case TERM_NUMBER:
                 if (a_this->content.num) {
-                        content = cr_num_to_string (a_this->content.num);
+                        content = (gchar *)cr_num_to_string (a_this->content.num);
                 }
 
                 if (content) {
@@ -616,10 +615,9 @@ cr_term_one_to_string (CRTerm * a_this)
 
         case TERM_RGB:
                 if (a_this->content.rgb) {
-                        guchar *tmp_str = NULL;
 
                         g_string_append_printf (str_buf, "rgb(");
-                        tmp_str = cr_rgb_to_string (a_this->content.rgb);
+                        gchar *tmp_str = (gchar *)cr_rgb_to_string (a_this->content.rgb);
 
                         if (tmp_str) {
                                 g_string_append (str_buf, tmp_str);
@@ -660,7 +658,7 @@ cr_term_one_to_string (CRTerm * a_this)
         }
 
         if (str_buf) {
-                result = str_buf->str;
+                result = (guchar *)str_buf->str;
                 g_string_free (str_buf, FALSE);
                 str_buf = NULL;
         }