index 7e71b927d3beb2a4490f3e80d019daeaa0842a97..5b0a56f32eb4b5fae0aa4aa9780336a267e9965f 100644 (file)
--- a/src/libcroco/cr-parser.c
+++ b/src/libcroco/cr-parser.c
static CRParserError *
cr_parser_error_new (const guchar * a_msg, enum CRStatus a_status)
{
- CRParserError *result = NULL;
-
- result = g_try_malloc (sizeof (CRParserError));
+ CRParserError *result = (CRParserError *)g_try_malloc (sizeof (CRParserError));
if (result == NULL) {
cr_utils_trace_info ("Out of memory");
g_free (a_this->msg);
}
- a_this->msg = g_strdup (a_msg);
+ a_this->msg = (guchar *)g_strdup ((gchar *)a_msg);
}
/**
error:
cr_parser_push_error
- (a_this, "could not recognize next production", CR_ERROR);
+ (a_this, (guchar *)"could not recognize next production", CR_ERROR);
cr_parser_dump_err_stack (a_this, TRUE);
if (token && token->type == DELIM_TK
&& token->u.unichar == '*') {
- sel->type_mask |= UNIVERSAL_SELECTOR;
+ int comb = (int)sel->type_mask | (int) UNIVERSAL_SELECTOR;
+ sel->type_mask = (enum SimpleSelectorType)comb;
+ //sel->type_mask |= UNIVERSAL_SELECTOR;
sel->name = cr_string_new_from_string ("*");
found_sel = TRUE;
} else if (token && token->type == IDENT_TK) {
sel->name = token->u.str;
- sel->type_mask |= TYPE_SELECTOR;
+ int comb = (int)sel->type_mask | (int) TYPE_SELECTOR;
+ sel->type_mask = (enum SimpleSelectorType)comb;
+ //sel->type_mask |= TYPE_SELECTOR;
token->u.str = NULL;
found_sel = TRUE;
} else {
for (;;) {
guint32 next_char = 0;
- enum Combinator comb = 0;
+ int comb = 0;
sel = NULL;
break;
if (comb && sel) {
- sel->combinator = comb;
+ sel->combinator = (enum Combinator)comb;
comb = 0;
}
if (sel) {
/*free the medium list */
for (cur = media_list; cur; cur = cur->next) {
if (cur->data) {
- cr_string_destroy (cur->data);
+ cr_string_destroy ((CRString *)cur->data);
}
}
}
cr_parser_push_error
- (a_this, "could not recognize next production", CR_ERROR);
+ (a_this, (guchar *)"could not recognize next production", CR_ERROR);
if (PRIVATE (a_this)->sac_handler
&& PRIVATE (a_this)->sac_handler->unrecoverable_error) {
CRParser *
cr_parser_new (CRTknzr * a_tknzr)
{
- CRParser *result = NULL;
enum CRStatus status = CR_OK;
- result = g_malloc0 (sizeof (CRParser));
+ CRParser *result = (CRParser *)g_malloc0 (sizeof (CRParser));
- PRIVATE (result) = g_malloc0 (sizeof (CRParserPriv));
+ PRIVATE (result) = (CRParserPriv *)g_malloc0 (sizeof (CRParserPriv));
if (a_tknzr) {
status = cr_parser_set_tknzr (result, a_tknzr);
CHECK_PARSING_STATUS (status, FALSE);
for (;;) {
- guchar operator = 0;
+ guchar operatr = 0;
status = cr_tknzr_peek_byte (PRIVATE (a_this)->tknzr,
1, &next_byte);
}
if (next_byte == '/' || next_byte == ',') {
- READ_NEXT_BYTE (a_this, &operator);
+ READ_NEXT_BYTE (a_this, &operatr);
}
cr_parser_try_to_skip_spaces_and_comments (a_this);
break;
}
- switch (operator) {
+ switch (operatr) {
case '/':
expr2->the_operator = DIVIDE;
break;
expr = cr_term_append_term (expr, expr2);
expr2 = NULL;
- operator = 0;
+ operatr = 0;
nb_terms++;
}
CHECK_PARSING_STATUS_ERR
(a_this, status, FALSE,
- "while parsing declaration: next property is malformed",
+ (guchar *)"while parsing declaration: next property is malformed",
CR_SYNTAX_ERROR);
READ_NEXT_CHAR (a_this, &cur_char);
status = CR_PARSING_ERROR;
cr_parser_push_error
(a_this,
- "while parsing declaration: this char must be ':'",
+ (guchar *)"while parsing declaration: this char must be ':'",
CR_SYNTAX_ERROR);
goto error;
}
CHECK_PARSING_STATUS_ERR
(a_this, status, FALSE,
- "while parsing declaration: next expression is malformed",
+ (guchar *)"while parsing declaration: next expression is malformed",
CR_SYNTAX_ERROR);
cr_parser_try_to_skip_spaces_and_comments (a_this);
ENSURE_PARSING_COND_ERR
(a_this, cur_char == '{',
- "while parsing rulset: current char should be '{'",
+ (guchar *)"while parsing rulset: current char should be '{'",
CR_SYNTAX_ERROR);
if (PRIVATE (a_this)->sac_handler
}
CHECK_PARSING_STATUS_ERR
(a_this, status, FALSE,
- "while parsing ruleset: next construction should be a declaration",
+ (guchar *)"while parsing ruleset: next construction should be a declaration",
CR_SYNTAX_ERROR);
for (;;) {
READ_NEXT_CHAR (a_this, &cur_char);
ENSURE_PARSING_COND_ERR
(a_this, cur_char == '}',
- "while parsing rulset: current char must be a '}'",
+ (guchar *)"while parsing rulset: current char must be a '}'",
CR_SYNTAX_ERROR);
if (PRIVATE (a_this)->sac_handler
*/
for (cur = *a_media_list; cur; cur = cur->next) {
if (cur->data) {
- cr_string_destroy (cur->data);
+ cr_string_destroy ((CRString *)cur->data);
}
}
GList *cur = NULL;
for (cur = media_list; cur; cur = cur->next) {
- cr_string_destroy (cur->data);
+ cr_string_destroy ((CRString *)cur->data);
}
g_list_free (media_list);
GList *cur = NULL;
for (cur = media_list; cur; cur = cur->next) {
- cr_string_destroy (cur->data);
+ cr_string_destroy ((CRString *)cur->data);
}
g_list_free (media_list);