summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorРуслан Ижбулатов <lrn1986@gmail.com>2014-08-05 08:19:02 +0000
committerРуслан Ижбулатов <lrn1986@gmail.com>2014-08-05 11:58:07 +0000
commitb77da88890a6f1044fe3213fedba4da782233ba5 (patch)
treee62d562b770cac372d0102ef04f45254bd31e784
parentd27114ca3442cffda04950b054d74f0f6cb19130 (diff)
downloadlibcroco-b77da88890a6f1044fe3213fedba4da782233ba5.tar.gz
char/xmlChar casting
https://bugzilla.gnome.org/show_bug.cgi?id=710076
-rw-r--r--csslint/csslint.c2
-rw-r--r--src/cr-declaration.c2
-rw-r--r--src/cr-rgb.c4
-rw-r--r--src/cr-sel-eng.c40
-rw-r--r--src/cr-statement.c14
-rw-r--r--src/cr-style.c2
-rw-r--r--src/cr-term.c2
-rw-r--r--tests/test5-main.c2
-rw-r--r--tests/test6-main.c2
9 files changed, 35 insertions, 35 deletions
diff --git a/csslint/csslint.c b/csslint/csslint.c
index d21c76b..ab38c4a 100644
--- a/csslint/csslint.c
+++ b/csslint/csslint.c
@@ -367,7 +367,7 @@ evaluate_selectors (gchar * a_xml_path,
("Error: Could not instanciate the xpath context\n");
return CR_ERROR;
}
- xpath_object = xmlXPathEvalExpression (a_xpath, xpath_context);
+ xpath_object = xmlXPathEvalExpression ((const xmlChar *) a_xpath, xpath_context);
if (!xpath_object) {
g_printerr ("Error: Could not evaluate xpath expression\n");
return CR_ERROR;
diff --git a/src/cr-declaration.c b/src/cr-declaration.c
index c29e28a..2a13c82 100644
--- a/src/cr-declaration.c
+++ b/src/cr-declaration.c
@@ -711,7 +711,7 @@ cr_declaration_get_by_prop_name (CRDeclaration * a_this,
&& cur->property->stryng
&& cur->property->stryng->str) {
if (!strcmp (cur->property->stryng->str,
- a_prop)) {
+ (const char *) a_prop)) {
return cur;
}
}
diff --git a/src/cr-rgb.c b/src/cr-rgb.c
index d1cd5d2..1b8b662 100644
--- a/src/cr-rgb.c
+++ b/src/cr-rgb.c
@@ -506,7 +506,7 @@ cr_rgb_set_from_hex_str (CRRgb * a_this, const guchar * a_hex)
g_return_val_if_fail (a_this && a_hex, CR_BAD_PARAM_ERROR);
- if (strlen (a_hex) == 3) {
+ if (strlen ((const char *) a_hex) == 3) {
for (i = 0; i < 3; i++) {
if (a_hex[i] >= '0' && a_hex[i] <= '9') {
colors[i] = a_hex[i] - '0';
@@ -521,7 +521,7 @@ cr_rgb_set_from_hex_str (CRRgb * a_this, const guchar * a_hex)
status = CR_UNKNOWN_TYPE_ERROR;
}
}
- } else if (strlen (a_hex) == 6) {
+ } else if (strlen ((const char *) a_hex) == 6) {
for (i = 0; i < 6; i++) {
if (a_hex[i] >= '0' && a_hex[i] <= '9') {
colors[i / 2] <<= 4;
diff --git a/src/cr-sel-eng.c b/src/cr-sel-eng.c
index 6378ee9..8a1a89a 100644
--- a/src/cr-sel-eng.c
+++ b/src/cr-sel-eng.c
@@ -136,9 +136,9 @@ lang_pseudo_class_handler (CRSelEng * a_this,
|| a_sel->content.pseudo->extra->stryng->len < 2)
return FALSE;
for (; node; node = get_next_parent_element_node (node)) {
- val = xmlGetProp (node, "lang");
+ val = xmlGetProp (node, (const xmlChar *) "lang");
if (val
- && !strqcmp (val,
+ && !strqcmp ((const char *) val,
a_sel->content.pseudo->extra->stryng->str,
a_sel->content.pseudo->extra->stryng->len)) {
result = TRUE;
@@ -224,15 +224,15 @@ class_add_sel_matches_node (CRAdditionalSel * a_add_sel, xmlNode * a_node)
&& a_add_sel->content.class_name->stryng->str
&& a_node, FALSE);
- if (xmlHasProp (a_node, "class")) {
- klass = xmlGetProp (a_node, "class");
+ if (xmlHasProp (a_node, (const xmlChar *) "class")) {
+ klass = xmlGetProp (a_node, (const xmlChar *) "class");
for (cur = klass; cur && *cur; cur++) {
while (cur && *cur
&& cr_utils_is_white_space (*cur)
== TRUE)
cur++;
- if (!strncmp (cur,
+ if (!strncmp ((const char *) cur,
a_add_sel->content.class_name->stryng->str,
a_add_sel->content.class_name->stryng->len)) {
cur += a_add_sel->content.class_name->stryng->len;
@@ -278,9 +278,9 @@ id_add_sel_matches_node (CRAdditionalSel * a_add_sel, xmlNode * a_node)
&& a_add_sel->type == ID_ADD_SELECTOR
&& a_node, FALSE);
- if (xmlHasProp (a_node, "id")) {
- id = xmlGetProp (a_node, "id");
- if (!strqcmp (id, a_add_sel->content.id_name->stryng->str,
+ if (xmlHasProp (a_node, (const xmlChar *) "id")) {
+ id = xmlGetProp (a_node, (const xmlChar *) "id");
+ if (!strqcmp ((const char *) id, a_add_sel->content.id_name->stryng->str,
a_add_sel->content.id_name->stryng->len)) {
result = TRUE;
}
@@ -320,7 +320,7 @@ attr_add_sel_matches_node (CRAdditionalSel * a_add_sel, xmlNode * a_node)
return FALSE;
if (!xmlHasProp (a_node,
- cur_sel->name->stryng->str))
+ (const xmlChar *) cur_sel->name->stryng->str))
return FALSE;
break;
@@ -338,16 +338,16 @@ attr_add_sel_matches_node (CRAdditionalSel * a_add_sel, xmlNode * a_node)
if (!xmlHasProp
(a_node,
- cur_sel->name->stryng->str))
+ (const xmlChar *) cur_sel->name->stryng->str))
return FALSE;
value = xmlGetProp
(a_node,
- cur_sel->name->stryng->str);
+ (const xmlChar *) cur_sel->name->stryng->str);
if (value
&& strcmp
- (value,
+ ((const char *) value,
cur_sel->value->stryng->str)) {
xmlFree (value);
return FALSE;
@@ -366,11 +366,11 @@ attr_add_sel_matches_node (CRAdditionalSel * a_add_sel, xmlNode * a_node)
if (!xmlHasProp
(a_node,
- cur_sel->name->stryng->str))
+ (const xmlChar *) cur_sel->name->stryng->str))
return FALSE;
value = xmlGetProp
(a_node,
- cur_sel->name->stryng->str);
+ (const xmlChar *) cur_sel->name->stryng->str);
if (!value)
return FALSE;
@@ -402,7 +402,7 @@ attr_add_sel_matches_node (CRAdditionalSel * a_add_sel, xmlNode * a_node)
ptr2 = cur;
if (!strncmp
- (ptr1,
+ ((const char *) ptr1,
cur_sel->value->stryng->str,
ptr2 - ptr1 + 1)) {
found = TRUE;
@@ -429,11 +429,11 @@ attr_add_sel_matches_node (CRAdditionalSel * a_add_sel, xmlNode * a_node)
if (!xmlHasProp
(a_node,
- cur_sel->name->stryng->str))
+ (const xmlChar *) cur_sel->name->stryng->str))
return FALSE;
value = xmlGetProp
(a_node,
- cur_sel->name->stryng->str);
+ (const xmlChar *) cur_sel->name->stryng->str);
/*
*here, make sure value is an hyphen
@@ -653,7 +653,7 @@ sel_matches_node_real (CRSelEng * a_this, CRSimpleSel * a_sel,
&& cur_sel->name->stryng
&& cur_sel->name->stryng->str)
&& (!strcmp (cur_sel->name->stryng->str,
- cur_node->name)))
+ (const char *) cur_node->name)))
|| (cur_sel->type_mask & UNIVERSAL_SELECTOR)) {
/*
*this simple selector
@@ -1206,7 +1206,7 @@ cr_sel_eng_unregister_pseudo_class_sel_handler (CRSelEng * a_this,
for (elem = PRIVATE (a_this)->pcs_handlers;
elem; elem = g_list_next (elem)) {
entry = elem->data;
- if (!strcmp (entry->name, a_name)
+ if (!strcmp ((const char *) entry->name, (const char *) a_name)
&& entry->type == a_type) {
found = TRUE;
break;
@@ -1279,7 +1279,7 @@ cr_sel_eng_get_pseudo_class_selector_handler (CRSelEng * a_this,
for (elem = PRIVATE (a_this)->pcs_handlers;
elem; elem = g_list_next (elem)) {
entry = elem->data;
- if (!strcmp (a_name, entry->name)
+ if (!strcmp ((const char *) a_name, (const char *) entry->name)
&& entry->type == a_type) {
found = TRUE;
break;
diff --git a/src/cr-statement.c b/src/cr-statement.c
index b91de12..e26304a 100644
--- a/src/cr-statement.c
+++ b/src/cr-statement.c
@@ -935,7 +935,7 @@ cr_statement_does_buf_parses_against_core (const guchar * a_buf,
enum CRStatus status = CR_OK;
gboolean result = FALSE;
- parser = cr_parser_new_from_buf ((guchar*)a_buf, strlen (a_buf),
+ parser = cr_parser_new_from_buf ((guchar*)a_buf, strlen ((const char *) a_buf),
a_encoding, FALSE);
g_return_val_if_fail (parser, FALSE);
@@ -1055,7 +1055,7 @@ cr_statement_ruleset_parse_from_buf (const guchar * a_buf,
g_return_val_if_fail (a_buf, NULL);
- parser = cr_parser_new_from_buf ((guchar*)a_buf, strlen (a_buf),
+ parser = cr_parser_new_from_buf ((guchar*)a_buf, strlen ((const char *) a_buf),
a_enc, FALSE);
g_return_val_if_fail (parser, NULL);
@@ -1192,7 +1192,7 @@ cr_statement_at_media_rule_parse_from_buf (const guchar * a_buf,
CRDocHandler *sac_handler = NULL;
enum CRStatus status = CR_OK;
- parser = cr_parser_new_from_buf ((guchar*)a_buf, strlen (a_buf),
+ parser = cr_parser_new_from_buf ((guchar*)a_buf, strlen ((const char *) a_buf),
a_enc, FALSE);
if (!parser) {
cr_utils_trace_info ("Instanciation of the parser failed");
@@ -1378,7 +1378,7 @@ cr_statement_at_import_rule_parse_from_buf (const guchar * a_buf,
CRString *import_string = NULL;
CRParsingLocation location = {0} ;
- parser = cr_parser_new_from_buf ((guchar*)a_buf, strlen (a_buf),
+ parser = cr_parser_new_from_buf ((guchar*)a_buf, strlen ((const char *) a_buf),
a_encoding, FALSE);
if (!parser) {
cr_utils_trace_info ("Instanciation of parser failed.");
@@ -1507,7 +1507,7 @@ cr_statement_at_page_rule_parse_from_buf (const guchar * a_buf,
g_return_val_if_fail (a_buf, NULL);
- parser = cr_parser_new_from_buf ((guchar*)a_buf, strlen (a_buf),
+ parser = cr_parser_new_from_buf ((guchar*)a_buf, strlen ((const char *) a_buf),
a_encoding, FALSE);
if (!parser) {
cr_utils_trace_info ("Instanciation of the parser failed.");
@@ -1623,7 +1623,7 @@ cr_statement_at_charset_rule_parse_from_buf (const guchar * a_buf,
g_return_val_if_fail (a_buf, NULL);
- parser = cr_parser_new_from_buf ((guchar*)a_buf, strlen (a_buf),
+ parser = cr_parser_new_from_buf ((guchar*)a_buf, strlen ((const char *) a_buf),
a_encoding, FALSE);
if (!parser) {
cr_utils_trace_info ("Instanciation of the parser failed.");
@@ -1720,7 +1720,7 @@ cr_statement_font_face_rule_parse_from_buf (const guchar * a_buf,
CRDocHandler *sac_handler = NULL;
enum CRStatus status = CR_OK;
- parser = cr_parser_new_from_buf ((guchar*)a_buf, strlen (a_buf),
+ parser = cr_parser_new_from_buf ((guchar*)a_buf, strlen ((const char *) a_buf),
a_encoding, FALSE);
if (!parser)
goto cleanup;
diff --git a/src/cr-style.c b/src/cr-style.c
index 86c1a8b..3233415 100644
--- a/src/cr-style.c
+++ b/src/cr-style.c
@@ -465,7 +465,7 @@ set_prop_padding_x_from_value (CRStyle * a_style,
if (a_value->content.str
&& a_value->content.str->stryng
&& a_value->content.str->stryng->str
- && !strncmp ((guchar *) "inherit",
+ && !strncmp ((const char *) "inherit",
a_value->content.str->stryng->str,
sizeof ("inherit")-1)) {
status = cr_num_set (num_val, 0.0, NUM_INHERIT);
diff --git a/src/cr-term.c b/src/cr-term.c
index 5cc63b0..a62b355 100644
--- a/src/cr-term.c
+++ b/src/cr-term.c
@@ -112,7 +112,7 @@ cr_term_parse_expression_from_buf (const guchar * a_buf,
g_return_val_if_fail (a_buf, NULL);
- parser = cr_parser_new_from_buf ((guchar*)a_buf, strlen (a_buf),
+ parser = cr_parser_new_from_buf ((guchar*)a_buf, strlen ((const char *) a_buf),
a_encoding, FALSE);
g_return_val_if_fail (parser, NULL);
diff --git a/tests/test5-main.c b/tests/test5-main.c
index 2b7c9c7..22b9911 100644
--- a/tests/test5-main.c
+++ b/tests/test5-main.c
@@ -160,7 +160,7 @@ test_sel_eng (guchar * a_file_uri)
goto error;
}
- xml_doc = xmlParseMemory (xml_content, strlen (xml_content));
+ xml_doc = xmlParseMemory ((const char *) xml_content, strlen ((const char *) xml_content));
if (!xml_doc) {
cr_utils_trace_info ("Could not parse xml content");
goto error;
diff --git a/tests/test6-main.c b/tests/test6-main.c
index e2cfc94..a534f40 100644
--- a/tests/test6-main.c
+++ b/tests/test6-main.c
@@ -54,7 +54,7 @@ test_cr_parser_parse (void)
parser = cr_om_parser_new (NULL);
status = cr_om_parser_parse_buf (parser, (guchar *) gv_cssbuf,
- strlen (gv_cssbuf),
+ strlen ((const char *) gv_cssbuf),
CR_ASCII, &stylesheet);
if (status == CR_OK && stylesheet) {