diff options
author | Abhishek Sharma <sharma.abhishek.it@gmail.com> | 2011-07-03 00:52:21 +0530 |
---|---|---|
committer | Abhishek Sharma <sharma.abhishek.it@gmail.com> | 2011-07-03 00:52:21 +0530 |
commit | ac3e66fa2bb416507b5b5cf114c1edaa3455f105 (patch) | |
tree | e4756168d3a488de228e9a836a3fa769747352ad /src/cr-term.c | |
parent | 903f13254d71f127bd5221779c3441c93f1ca92b (diff) | |
download | libcroco-ac3e66fa2bb416507b5b5cf114c1edaa3455f105.tar.gz |
Sending recent tested changes from inkscape developers to libcroco upstream
Diffstat (limited to 'src/cr-term.c')
-rw-r--r-- | src/cr-term.c | 50 |
1 files changed, 24 insertions, 26 deletions
diff --git a/src/cr-term.c b/src/cr-term.c index d6db51a..63b3927 100644 --- a/src/cr-term.c +++ b/src/cr-term.c @@ -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); @@ -276,12 +275,12 @@ cr_term_prepend_term (CRTerm * a_this, CRTerm * a_new_term) *form of #CRTerm. MUST BE FREED BY THE CALLER using g_free(). */ guchar * -cr_term_to_string (CRTerm const * a_this) +cr_term_to_string (CRTerm * a_this) { GString *str_buf = NULL; - CRTerm const *cur = NULL; - guchar *result = NULL, - *content = NULL; + CRTerm *cur = NULL; + guchar *result = NULL; + gchar *content = NULL; g_return_val_if_fail (a_this, NULL); @@ -330,7 +329,7 @@ cr_term_to_string (CRTerm const * 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 const * 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 const * 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 const * 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 const * a_this) } if (str_buf) { - result = str_buf->str; + result = (guchar *)str_buf->str; g_string_free (str_buf, FALSE); str_buf = NULL; } @@ -473,11 +472,11 @@ cr_term_to_string (CRTerm const * a_this) } guchar * -cr_term_one_to_string (CRTerm const * a_this) +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 const * 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 const * 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 const * a_this) } if (str_buf) { - result = str_buf->str; + result = (guchar *)str_buf->str; g_string_free (str_buf, FALSE); str_buf = NULL; } @@ -677,7 +675,7 @@ cr_term_one_to_string (CRTerm const * a_this) *@param a_fp the destination file pointer. */ void -cr_term_dump (CRTerm const * a_this, FILE * a_fp) +cr_term_dump (CRTerm * a_this, FILE * a_fp) { guchar *content = NULL; @@ -697,9 +695,9 @@ cr_term_dump (CRTerm const * a_this, FILE * a_fp) *@return number of terms in the expression. */ int -cr_term_nr_values (CRTerm const *a_this) +cr_term_nr_values (CRTerm *a_this) { - CRTerm const *cur = NULL ; + CRTerm *cur = NULL ; int nr = 0; g_return_val_if_fail (a_this, -1) ; |