diff options
| author | Alex Valavanis <valavanisalex@gmail.com> | 2013-11-03 14:03:19 +0000 |
|---|---|---|
| committer | Alex Valavanis <valavanisalex@gmail.com> | 2013-11-03 14:03:19 +0000 |
| commit | 52045941ced0124fd0b71c31d0ef08ebfb3d295a (patch) | |
| tree | de9620d16fda77bbe8f09f3e5eedf2ecb1dc83b3 /src/libcroco/cr-declaration.c | |
| parent | Fix typo in libcroco/cr-rgb.c (diff) | |
| download | inkscape-52045941ced0124fd0b71c31d0ef08ebfb3d295a.tar.gz inkscape-52045941ced0124fd0b71c31d0ef08ebfb3d295a.zip | |
Minimise diff against libcroco-0.6.8 (pass 1)
(bzr r12772)
Diffstat (limited to 'src/libcroco/cr-declaration.c')
| -rw-r--r-- | src/libcroco/cr-declaration.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/libcroco/cr-declaration.c b/src/libcroco/cr-declaration.c index 9f280837c..ab150a9e4 100644 --- a/src/libcroco/cr-declaration.c +++ b/src/libcroco/cr-declaration.c @@ -44,9 +44,11 @@ static void dump (CRDeclaration const * a_this, FILE * a_fp, glong a_indent) { + guchar *str = NULL; + g_return_if_fail (a_this); - gchar *str = cr_declaration_to_string (a_this, a_indent); + str = cr_declaration_to_string (a_this, a_indent); if (str) { fprintf (a_fp, "%s", str); g_free (str); @@ -72,6 +74,8 @@ CRDeclaration * cr_declaration_new (CRStatement * a_statement, CRString * a_property, CRTerm * a_value) { + CRDeclaration *result = NULL; + g_return_val_if_fail (a_property, NULL); if (a_statement) @@ -82,7 +86,7 @@ cr_declaration_new (CRStatement * a_statement, || (a_statement->type == AT_PAGE_RULE_STMT)), NULL); - CRDeclaration * result = (CRDeclaration *)g_try_malloc (sizeof (CRDeclaration)); + result = g_try_malloc (sizeof (CRDeclaration)); if (!result) { cr_utils_trace_info ("Out of memory"); return NULL; @@ -118,6 +122,7 @@ cr_declaration_parse_from_buf (CRStatement * a_statement, CRTerm *value = NULL; CRString *property = NULL; CRDeclaration *result = NULL; + CRParser *parser = NULL; gboolean important = FALSE; g_return_val_if_fail (a_str, NULL); @@ -125,9 +130,7 @@ cr_declaration_parse_from_buf (CRStatement * a_statement, g_return_val_if_fail (a_statement->type == RULESET_STMT, NULL); - CRParser *parser = (CRParser *) - cr_parser_new_from_buf ((guchar*)a_str, - strlen ((char *)a_str), a_enc, FALSE); + parser = cr_parser_new_from_buf ((guchar*)a_str, strlen (a_str), a_enc, FALSE); g_return_val_if_fail (parser, NULL); status = cr_parser_try_to_skip_spaces_and_comments (parser); @@ -185,13 +188,13 @@ cr_declaration_parse_list_from_buf (const guchar * a_str, CRString *property = NULL; CRDeclaration *result = NULL, *cur_decl = NULL; + CRParser *parser = NULL; CRTknzr *tokenizer = NULL; gboolean important = FALSE; g_return_val_if_fail (a_str, NULL); - CRParser *parser = (CRParser *)cr_parser_new_from_buf - ((guchar*)a_str, strlen ((char *)a_str), a_enc, FALSE); + parser = cr_parser_new_from_buf ((guchar*)a_str, strlen (a_str), a_enc, FALSE); g_return_val_if_fail (parser, NULL); status = cr_parser_get_tknzr (parser, &tokenizer); if (status != CR_OK || !tokenizer) { @@ -223,7 +226,7 @@ cr_declaration_parse_list_from_buf (const guchar * a_str, cr_parser_try_to_skip_spaces_and_comments (parser); status = cr_tknzr_peek_char (tokenizer, &c); if (status != CR_OK) { - if (status == CR_END_OF_INPUT_ERROR) + if (status == CR_END_OF_INPUT_ERROR) status = CR_OK; goto cleanup; } @@ -501,7 +504,7 @@ cr_declaration_to_string (CRDeclaration const * a_this, gulong a_indent) { GString *stringue = NULL; - gchar *str = NULL, + guchar *str = NULL, *result = NULL; g_return_val_if_fail (a_this, NULL); @@ -570,7 +573,7 @@ cr_declaration_list_to_string (CRDeclaration const * a_this, gulong a_indent) { CRDeclaration const *cur = NULL; GString *stringue = NULL; - gchar *str = NULL, + guchar *str = NULL, *result = NULL; g_return_val_if_fail (a_this, NULL); @@ -590,7 +593,7 @@ cr_declaration_list_to_string (CRDeclaration const * a_this, gulong a_indent) g_string_free (stringue, FALSE); } - return (guchar *)result; + return result; } /** @@ -609,7 +612,7 @@ cr_declaration_list_to_string2 (CRDeclaration const * a_this, { CRDeclaration const *cur = NULL; GString *stringue = NULL; - gchar *str = NULL, + guchar *str = NULL, *result = NULL; g_return_val_if_fail (a_this, NULL); @@ -643,7 +646,7 @@ cr_declaration_list_to_string2 (CRDeclaration const * a_this, g_string_free (stringue, FALSE); } - return (guchar *)result; + return result; } /** @@ -711,7 +714,7 @@ cr_declaration_get_by_prop_name (CRDeclaration * a_this, && cur->property->stryng && cur->property->stryng->str) { if (!strcmp (cur->property->stryng->str, - (char *)a_prop)) { + a_prop)) { return cur; } } |
