summaryrefslogtreecommitdiffstats
path: root/src/libcroco/cr-parser.c
diff options
context:
space:
mode:
authorAlex Valavanis <valavanisalex@gmail.com>2013-11-03 14:03:19 +0000
committerAlex Valavanis <valavanisalex@gmail.com>2013-11-03 14:03:19 +0000
commit52045941ced0124fd0b71c31d0ef08ebfb3d295a (patch)
treede9620d16fda77bbe8f09f3e5eedf2ecb1dc83b3 /src/libcroco/cr-parser.c
parentFix typo in libcroco/cr-rgb.c (diff)
downloadinkscape-52045941ced0124fd0b71c31d0ef08ebfb3d295a.tar.gz
inkscape-52045941ced0124fd0b71c31d0ef08ebfb3d295a.zip
Minimise diff against libcroco-0.6.8 (pass 1)
(bzr r12772)
Diffstat (limited to 'src/libcroco/cr-parser.c')
-rw-r--r--src/libcroco/cr-parser.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/src/libcroco/cr-parser.c b/src/libcroco/cr-parser.c
index 6544a679f..41d3eab5a 100644
--- a/src/libcroco/cr-parser.c
+++ b/src/libcroco/cr-parser.c
@@ -413,7 +413,9 @@ static enum CRStatus
static CRParserError *
cr_parser_error_new (const guchar * a_msg, enum CRStatus a_status)
{
- CRParserError *result = (CRParserError *)g_try_malloc (sizeof (CRParserError));
+ CRParserError *result = NULL;
+
+ result = g_try_malloc (sizeof (CRParserError));
if (result == NULL) {
cr_utils_trace_info ("Out of memory");
@@ -442,7 +444,7 @@ cr_parser_error_set_msg (CRParserError * a_this, const guchar * a_msg)
g_free (a_this->msg);
}
- a_this->msg = (guchar *)g_strdup ((gchar *)a_msg);
+ a_this->msg = g_strdup (a_msg);
}
/**
@@ -731,7 +733,7 @@ cr_parser_parse_stylesheet_core (CRParser * a_this)
error:
cr_parser_push_error
- (a_this, (guchar *)"could not recognize next production", CR_ERROR);
+ (a_this, "could not recognize next production", CR_ERROR);
cr_parser_dump_err_stack (a_this, TRUE);
@@ -2428,7 +2430,7 @@ cr_parser_parse_stylesheet (CRParser * a_this)
import_string,
NULL, &location) ;
- if (PRIVATE (a_this)->sac_handler->resolve_import == TRUE) {
+ if ((PRIVATE (a_this)->sac_handler->resolve_import == TRUE)) {
/*
*TODO: resolve the
*import rule.
@@ -2465,7 +2467,7 @@ cr_parser_parse_stylesheet (CRParser * a_this)
/*free the medium list */
for (cur = media_list; cur; cur = cur->next) {
if (cur->data) {
- cr_string_destroy ((CRString *)cur->data);
+ cr_string_destroy (cur->data);
}
}
@@ -2705,7 +2707,7 @@ cr_parser_parse_stylesheet (CRParser * a_this)
}
cr_parser_push_error
- (a_this, (guchar *)"could not recognize next production", CR_ERROR);
+ (a_this, "could not recognize next production", CR_ERROR);
if (PRIVATE (a_this)->sac_handler
&& PRIVATE (a_this)->sac_handler->unrecoverable_error) {
@@ -2752,11 +2754,12 @@ cr_parser_parse_stylesheet (CRParser * a_this)
CRParser *
cr_parser_new (CRTknzr * a_tknzr)
{
+ CRParser *result = NULL;
enum CRStatus status = CR_OK;
- CRParser *result = (CRParser *)g_malloc0 (sizeof (CRParser));
+ result = g_malloc0 (sizeof (CRParser));
- PRIVATE (result) = (CRParserPriv *)g_malloc0 (sizeof (CRParserPriv));
+ PRIVATE (result) = g_malloc0 (sizeof (CRParserPriv));
if (a_tknzr) {
status = cr_parser_set_tknzr (result, a_tknzr);
@@ -3190,7 +3193,7 @@ cr_parser_parse_declaration (CRParser * a_this,
CHECK_PARSING_STATUS_ERR
(a_this, status, FALSE,
- (guchar *)"while parsing declaration: next property is malformed",
+ "while parsing declaration: next property is malformed",
CR_SYNTAX_ERROR);
READ_NEXT_CHAR (a_this, &cur_char);
@@ -3199,7 +3202,7 @@ cr_parser_parse_declaration (CRParser * a_this,
status = CR_PARSING_ERROR;
cr_parser_push_error
(a_this,
- (guchar *)"while parsing declaration: this char must be ':'",
+ "while parsing declaration: this char must be ':'",
CR_SYNTAX_ERROR);
goto error;
}
@@ -3210,7 +3213,7 @@ cr_parser_parse_declaration (CRParser * a_this,
CHECK_PARSING_STATUS_ERR
(a_this, status, FALSE,
- (guchar *)"while parsing declaration: next expression is malformed",
+ "while parsing declaration: next expression is malformed",
CR_SYNTAX_ERROR);
cr_parser_try_to_skip_spaces_and_comments (a_this);
@@ -3350,7 +3353,7 @@ cr_parser_parse_ruleset (CRParser * a_this)
ENSURE_PARSING_COND_ERR
(a_this, cur_char == '{',
- (guchar *)"while parsing rulset: current char should be '{'",
+ "while parsing rulset: current char should be '{'",
CR_SYNTAX_ERROR);
if (PRIVATE (a_this)->sac_handler
@@ -3414,7 +3417,7 @@ cr_parser_parse_ruleset (CRParser * a_this)
}
CHECK_PARSING_STATUS_ERR
(a_this, status, FALSE,
- (guchar *)"while parsing ruleset: next construction should be a declaration",
+ "while parsing ruleset: next construction should be a declaration",
CR_SYNTAX_ERROR);
for (;;) {
@@ -3456,7 +3459,7 @@ cr_parser_parse_ruleset (CRParser * a_this)
READ_NEXT_CHAR (a_this, &cur_char);
ENSURE_PARSING_COND_ERR
(a_this, cur_char == '}',
- (guchar *)"while parsing rulset: current char must be a '}'",
+ "while parsing rulset: current char must be a '}'",
CR_SYNTAX_ERROR);
selector->location = end_parsing_location;
@@ -3663,7 +3666,7 @@ cr_parser_parse_import (CRParser * a_this,
*/
for (cur = *a_media_list; cur; cur = cur->next) {
if (cur->data) {
- cr_string_destroy ((CRString *)cur->data);
+ cr_string_destroy (cur->data);
}
}
@@ -3817,7 +3820,7 @@ cr_parser_parse_media (CRParser * a_this)
GList *cur = NULL;
for (cur = media_list; cur; cur = cur->next) {
- cr_string_destroy ((CRString *)cur->data);
+ cr_string_destroy (cur->data);
}
g_list_free (media_list);
@@ -3845,7 +3848,7 @@ cr_parser_parse_media (CRParser * a_this)
GList *cur = NULL;
for (cur = media_list; cur; cur = cur->next) {
- cr_string_destroy ((CRString *)cur->data);
+ cr_string_destroy (cur->data);
}
g_list_free (media_list);