[libcroco] gchar/guchar types and casting



commit d27114ca3442cffda04950b054d74f0f6cb19130
Author: Руслан Ижбулатов <lrn1986 gmail com>
Date:   Tue Aug 5 08:17:17 2014 +0000

    gchar/guchar types and casting
    
    https://bugzilla.gnome.org/show_bug.cgi?id=710076

 csslint/csslint.c       |   18 +++++++++---------
 src/cr-additional-sel.c |   12 ++++++------
 src/cr-attr-sel.c       |    8 ++++----
 src/cr-declaration.c    |   20 ++++++++++----------
 src/cr-enc-handler.c    |    2 +-
 src/cr-fonts.c          |   10 +++++-----
 src/cr-num.c            |    8 ++++----
 src/cr-parser.c         |   18 +++++++++---------
 src/cr-pseudo.c         |   12 ++++++------
 src/cr-rgb.c            |    9 ++++-----
 src/cr-sel-eng.c        |    6 +++---
 src/cr-selector.c       |    6 +++---
 src/cr-simple-sel.c     |   12 ++++++------
 src/cr-statement.c      |   16 ++++++++--------
 src/cr-style.c          |   16 ++++++++--------
 src/cr-term.c           |   38 +++++++++++++++++++-------------------
 src/cr-tknzr.c          |    2 +-
 tests/test0-main.c      |    4 ++--
 tests/test1-main.c      |    4 ++--
 tests/test2-main.c      |   24 ++++++++++++------------
 tests/test3-main.c      |   24 ++++++++++++------------
 tests/test4-main.c      |   24 ++++++++++++------------
 tests/test5-main.c      |    4 ++--
 tests/test6-main.c      |    2 +-
 24 files changed, 149 insertions(+), 150 deletions(-)
---
diff --git a/csslint/csslint.c b/csslint/csslint.c
index 90bc30d..d21c76b 100644
--- a/csslint/csslint.c
+++ b/csslint/csslint.c
@@ -331,21 +331,21 @@ evaluate_selectors (gchar * a_xml_path,
         }
         if (a_author_sheet_path) {
                 status = cr_om_parser_simply_parse_file
-                        (a_author_sheet_path, CR_ASCII, &author_sheet);
+                        ((const guchar *) a_author_sheet_path, CR_ASCII, &author_sheet);
                 if (!author_sheet) {
                         g_printerr ("Error: Could not parse author sheet\n");
                 }
         }
         if (a_user_sheet_path) {
                 status = cr_om_parser_simply_parse_file
-                        (a_user_sheet_path, CR_ASCII, &user_sheet);
+                        ((const guchar *) a_user_sheet_path, CR_ASCII, &user_sheet);
                 if (!user_sheet) {
                         g_printerr ("Error: Could not parse author sheet\n");
                 }
         }
         if (a_ua_sheet_path) {
                 status = cr_om_parser_simply_parse_file
-                        (a_ua_sheet_path, CR_ASCII, &ua_sheet);
+                        ((const guchar *) a_ua_sheet_path, CR_ASCII, &ua_sheet);
                 if (!ua_sheet) {
                         g_printerr ("Error: Could not parse ua sheet\n");
                 }
@@ -736,7 +736,7 @@ dump_location_annotated_simple_sel (CRSimpleSel *a_this)
         g_return_if_fail (a_this) ;
 
         /*first, display the entire simple sel*/
-        str0 = cr_simple_sel_one_to_string
+        str0 = (gchar *) cr_simple_sel_one_to_string
                 (cur_simple_sel) ;
         if (str0) {
                 g_print ("/*%s*/\n", str0) ;
@@ -769,7 +769,7 @@ dump_location_annotated_simple_sel (CRSimpleSel *a_this)
         for (cur_add_sel = cur_simple_sel->add_sel; 
              cur_add_sel;
              cur_add_sel = cur_add_sel->next) {
-                str0 = cr_additional_sel_one_to_string 
+                str0 = (gchar *) cr_additional_sel_one_to_string 
                         (cur_add_sel) ;
                 if (str0) {
                         g_print ("\n  /*%s*/\n", str0) ;
@@ -848,7 +848,7 @@ property (CRDocHandler *a_this,
                 g_print ("%s", str) ;
                 str = NULL ;
                 if (a_expr) {
-                        str = cr_term_to_string (a_expr) ;
+                        str = (gchar *) cr_term_to_string (a_expr) ;
                         if (str) {
                                 g_print (" : %s;\n\n", str) ;
                                 g_free (str) ;
@@ -881,7 +881,7 @@ property (CRDocHandler *a_this,
         for (cur_term = a_expr ;
              cur_term;
              cur_term = cur_term->next) {
-                str = cr_term_one_to_string (cur_term) ;
+                str = (gchar *) cr_term_one_to_string (cur_term) ;
                 if (str) {
                         g_print ("  /*%s*/\n", str) ;
                         g_free (str) ;
@@ -970,12 +970,12 @@ main (int argc, char **argv)
                                  options.user_sheet_path,
                                  options.ua_sheet_path, options.xpath);
                 } else if (options.css_files_list != NULL) {
-                        status = cssom_parse (options.css_files_list[0]);
+                        status = cssom_parse ((guchar *) options.css_files_list[0]);
                 }
         } else if (options.dump_location == TRUE) {
                 if (options.css_files_list) {
                         status = sac_parse_and_display_locations 
-                                (options.css_files_list[0]) ;
+                                ((guchar *) options.css_files_list[0]) ;
                 } else {
                         display_usage () ;
                         return -1 ;
diff --git a/src/cr-additional-sel.c b/src/cr-additional-sel.c
index 5a37eba..bc40ff0 100644
--- a/src/cr-additional-sel.c
+++ b/src/cr-additional-sel.c
@@ -247,7 +247,7 @@ cr_additional_sel_to_string (CRAdditionalSel const * a_this)
                                 guchar *name = NULL;
 
                                 if (cur->content.class_name) {
-                                        name = g_strndup
+                                        name = (guchar *) g_strndup
                                                 (cur->content.class_name->stryng->str,
                                                  cur->content.class_name->stryng->len);
 
@@ -267,7 +267,7 @@ cr_additional_sel_to_string (CRAdditionalSel const * a_this)
                                 guchar *name = NULL;
 
                                 if (cur->content.class_name) {
-                                        name = g_strndup
+                                        name = (guchar *) g_strndup
                                                 (cur->content.id_name->stryng->str,
                                                  cur->content.id_name->stryng->len);
 
@@ -323,7 +323,7 @@ cr_additional_sel_to_string (CRAdditionalSel const * a_this)
         }
 
         if (str_buf) {
-                result = str_buf->str;
+                result = (guchar *) str_buf->str;
                 g_string_free (str_buf, FALSE);
                 str_buf = NULL;
         }
@@ -347,7 +347,7 @@ cr_additional_sel_one_to_string (CRAdditionalSel const *a_this)
                 guchar *name = NULL;
 
                 if (a_this->content.class_name) {
-                        name = g_strndup
+                        name = (guchar *) g_strndup
                                 (a_this->content.class_name->stryng->str,
                                  a_this->content.class_name->stryng->len);
 
@@ -367,7 +367,7 @@ cr_additional_sel_one_to_string (CRAdditionalSel const *a_this)
                 guchar *name = NULL;
 
                 if (a_this->content.class_name) {
-                        name = g_strndup
+                        name = (guchar *) g_strndup
                                 (a_this->content.id_name->stryng->str,
                                  a_this->content.id_name->stryng->len);
 
@@ -422,7 +422,7 @@ cr_additional_sel_one_to_string (CRAdditionalSel const *a_this)
         }
 
         if (str_buf) {
-                result = str_buf->str;
+                result = (guchar *) str_buf->str;
                 g_string_free (str_buf, FALSE);
                 str_buf = NULL;
         }
diff --git a/src/cr-attr-sel.c b/src/cr-attr-sel.c
index 787f0c0..c057bbb 100644
--- a/src/cr-attr-sel.c
+++ b/src/cr-attr-sel.c
@@ -123,10 +123,10 @@ cr_attr_sel_to_string (CRAttrSel const * a_this)
                 if (cur->name) {
                         guchar *name = NULL;
 
-                        name = g_strndup (cur->name->stryng->str, 
+                        name = (guchar *) g_strndup (cur->name->stryng->str, 
                                           cur->name->stryng->len);
                         if (name) {
-                                g_string_append (str_buf, name);
+                                g_string_append (str_buf, (const gchar *) name);
                                 g_free (name);
                                 name = NULL;
                         }
@@ -135,7 +135,7 @@ cr_attr_sel_to_string (CRAttrSel const * a_this)
                 if (cur->value) {
                         guchar *value = NULL;
 
-                        value = g_strndup (cur->value->stryng->str, 
+                        value = (guchar *) g_strndup (cur->value->stryng->str, 
                                            cur->value->stryng->len);
                         if (value) {
                                 switch (cur->match_way) {
@@ -168,7 +168,7 @@ cr_attr_sel_to_string (CRAttrSel const * a_this)
         }
 
         if (str_buf) {
-                result = str_buf->str;
+                result = (guchar *) str_buf->str;
                 g_string_free (str_buf, FALSE);
         }
 
diff --git a/src/cr-declaration.c b/src/cr-declaration.c
index 8079aa0..c29e28a 100644
--- a/src/cr-declaration.c
+++ b/src/cr-declaration.c
@@ -48,7 +48,7 @@ dump (CRDeclaration const * a_this, FILE * a_fp, glong a_indent)
 
         g_return_if_fail (a_this);
 
-        str = cr_declaration_to_string (a_this, a_indent);
+        str = (guchar *) cr_declaration_to_string (a_this, a_indent);
         if (str) {
                 fprintf (a_fp, "%s", str);
                 g_free (str);
@@ -130,7 +130,7 @@ cr_declaration_parse_from_buf (CRStatement * a_statement,
                 g_return_val_if_fail (a_statement->type == RULESET_STMT,
                                       NULL);
 
-        parser = cr_parser_new_from_buf ((guchar*)a_str, strlen (a_str), a_enc, FALSE);
+        parser = cr_parser_new_from_buf ((guchar*)a_str, strlen ((const char *) a_str), a_enc, FALSE);
         g_return_val_if_fail (parser, NULL);
 
         status = cr_parser_try_to_skip_spaces_and_comments (parser);
@@ -194,7 +194,7 @@ cr_declaration_parse_list_from_buf (const guchar * a_str,
 
         g_return_val_if_fail (a_str, NULL);
 
-        parser = cr_parser_new_from_buf ((guchar*)a_str, strlen (a_str), a_enc, FALSE);
+        parser = cr_parser_new_from_buf ((guchar*)a_str, strlen ((const char *) a_str), a_enc, FALSE);
         g_return_val_if_fail (parser, NULL);
         status = cr_parser_get_tknzr (parser, &tokenizer);
         if (status != CR_OK || !tokenizer) {
@@ -501,7 +501,7 @@ cr_declaration_to_string (CRDeclaration const * a_this, gulong a_indent)
 {
         GString *stringue = NULL;
 
-        guchar *str = NULL,
+        gchar *str = NULL,
                 *result = NULL;
 
         g_return_val_if_fail (a_this, NULL);
@@ -578,7 +578,7 @@ cr_declaration_list_to_string (CRDeclaration const * a_this, gulong a_indent)
         stringue = g_string_new (NULL);
 
         for (cur = a_this; cur; cur = cur->next) {
-                str = cr_declaration_to_string (cur, a_indent);
+                str = (guchar *) cr_declaration_to_string (cur, a_indent);
                 if (str) {
                         g_string_append_printf (stringue, "%s;", str);
                         g_free (str);
@@ -586,7 +586,7 @@ cr_declaration_list_to_string (CRDeclaration const * a_this, gulong a_indent)
                         break;
         }
         if (stringue && stringue->str) {
-                result = stringue->str;
+                result = (guchar *) stringue->str;
                 g_string_free (stringue, FALSE);
         }
 
@@ -617,7 +617,7 @@ cr_declaration_list_to_string2 (CRDeclaration const * a_this,
         stringue = g_string_new (NULL);
 
         for (cur = a_this; cur; cur = cur->next) {
-                str = cr_declaration_to_string (cur, a_indent);
+                str = (guchar *) cr_declaration_to_string (cur, a_indent);
                 if (str) {
                         if (a_one_decl_per_line == TRUE) {
                                 if (cur->next)
@@ -625,21 +625,21 @@ cr_declaration_list_to_string2 (CRDeclaration const * a_this,
                                                                 "%s;\n", str);
                                 else
                                         g_string_append (stringue,
-                                                         str);
+                                                         (const gchar *) str);
                         } else {
                                 if (cur->next)
                                         g_string_append_printf (stringue,
                                                                 "%s;", str);
                                 else
                                         g_string_append (stringue,
-                                                         str);
+                                                         (const gchar *) str);
                         }
                         g_free (str);
                 } else
                         break;
         }
         if (stringue && stringue->str) {
-                result = stringue->str;
+                result = (guchar *) stringue->str;
                 g_string_free (stringue, FALSE);
         }
 
diff --git a/src/cr-enc-handler.c b/src/cr-enc-handler.c
index b3e5b7e..646bf1f 100644
--- a/src/cr-enc-handler.c
+++ b/src/cr-enc-handler.c
@@ -122,7 +122,7 @@ cr_enc_handler_resolve_enc_alias (const guchar * a_alias_name,
         g_ascii_strup (alias_name_up, -1);
 
         for (i = 0; gv_default_aliases[i].name; i++) {
-                if (!strcmp (gv_default_aliases[i].name, alias_name_up)) {
+                if (!strcmp (gv_default_aliases[i].name, (const gchar *) alias_name_up)) {
                         *a_enc = gv_default_aliases[i].encoding;
                         status = CR_OK;
                         break;
diff --git a/src/cr-fonts.c b/src/cr-fonts.c
index 7891afa..4ef8512 100644
--- a/src/cr-fonts.c
+++ b/src/cr-fonts.c
@@ -78,7 +78,7 @@ cr_font_family_to_string_real (CRFontFamily const * a_this,
                 if (a_this->prev) {
                         g_string_append_printf (*a_string, ", %s", name);
                 } else {
-                        g_string_append (*a_string, name);
+                        g_string_append (*a_string, (const gchar *) name);
                 }
         }
         if (a_walk_list == TRUE && a_this->next) {
@@ -187,7 +187,7 @@ cr_font_family_to_string (CRFontFamily const * a_this,
         GString *stringue = NULL;
 
         if (!a_this) {
-                result = g_strdup ("NULL");
+                result = (guchar *) g_strdup ("NULL");
                 g_return_val_if_fail (result, NULL);
                 return result;
         }
@@ -196,7 +196,7 @@ cr_font_family_to_string (CRFontFamily const * a_this,
                                                 &stringue);
 
         if (status == CR_OK && stringue) {
-                result = stringue->str;
+                result = (guchar *) stringue->str;
                 g_string_free (stringue, FALSE);
                 stringue = NULL;
 
@@ -529,7 +529,7 @@ cr_font_size_to_string (CRFontSize const * a_this)
                                 (a_this->value.predefined));
                 break;
         case ABSOLUTE_FONT_SIZE:
-                str = cr_num_to_string (&a_this->value.absolute);
+                str = (gchar *) cr_num_to_string (&a_this->value.absolute);
                 break;
         case RELATIVE_FONT_SIZE:
                 str = g_strdup (cr_relative_font_size_to_string
@@ -689,7 +689,7 @@ cr_font_size_adjust_to_string (CRFontSizeAdjust const * a_this)
                 break;
         case FONT_SIZE_ADJUST_NUMBER:
                 if (a_this->num)
-                        str = cr_num_to_string (a_this->num);
+                        str = (gchar *) cr_num_to_string (a_this->num);
                 else
                         str = g_strdup ("unknow font-size-adjust property value"); /* Should raise an error 
no?*/
                 break;
diff --git a/src/cr-num.c b/src/cr-num.c
index 28c5df0..d5dbd5f 100644
--- a/src/cr-num.c
+++ b/src/cr-num.c
@@ -105,11 +105,11 @@ cr_num_to_string (CRNum const * a_this)
         test_val = a_this->val - (glong) a_this->val;
 
         if (!test_val) {
-                tmp_char1 = g_strdup_printf ("%ld", (glong) a_this->val);
+                tmp_char1 = (guchar *) g_strdup_printf ("%ld", (glong) a_this->val);
         } else {
-                tmp_char1 = g_new0 (char, G_ASCII_DTOSTR_BUF_SIZE + 1);
+                tmp_char1 = (guchar *) g_new0 (char, G_ASCII_DTOSTR_BUF_SIZE + 1);
                 if (tmp_char1 != NULL)
-                        g_ascii_dtostr (tmp_char1, G_ASCII_DTOSTR_BUF_SIZE, a_this->val);
+                        g_ascii_dtostr ((gchar *) tmp_char1, G_ASCII_DTOSTR_BUF_SIZE, a_this->val);
         }
 
         g_return_val_if_fail (tmp_char1, NULL);
@@ -193,7 +193,7 @@ cr_num_to_string (CRNum const * a_this)
         }
 
         if (tmp_char2) {
-                result = g_strconcat (tmp_char1, tmp_char2, NULL);
+                result = (guchar *)  g_strconcat ((gchar *) tmp_char1, tmp_char2, NULL);
                 g_free (tmp_char1);
         } else {
                 result = tmp_char1;
diff --git a/src/cr-parser.c b/src/cr-parser.c
index 0e319db..a17f161 100644
--- a/src/cr-parser.c
+++ b/src/cr-parser.c
@@ -444,7 +444,7 @@ cr_parser_error_set_msg (CRParserError * a_this, const guchar * a_msg)
                 g_free (a_this->msg);
         }
 
-        a_this->msg = g_strdup (a_msg);
+        a_this->msg = (guchar *) g_strdup ((const gchar *) a_msg);
 }
 
 /**
@@ -733,7 +733,7 @@ cr_parser_parse_stylesheet_core (CRParser * a_this)
 
  error:
         cr_parser_push_error
-                (a_this, "could not recognize next production", CR_ERROR);
+                (a_this, (const guchar *) "could not recognize next production", CR_ERROR);
 
         cr_parser_dump_err_stack (a_this, TRUE);
 
@@ -2703,7 +2703,7 @@ cr_parser_parse_stylesheet (CRParser * a_this)
         }
 
         cr_parser_push_error
-                (a_this, "could not recognize next production", CR_ERROR);
+                (a_this, (const guchar *) "could not recognize next production", CR_ERROR);
 
         if (PRIVATE (a_this)->sac_handler
             && PRIVATE (a_this)->sac_handler->unrecoverable_error) {
@@ -3189,7 +3189,7 @@ cr_parser_parse_declaration (CRParser * a_this,
 
         CHECK_PARSING_STATUS_ERR
                 (a_this, status, FALSE,
-                 "while parsing declaration: next property is malformed",
+                 (const guchar *) "while parsing declaration: next property is malformed",
                  CR_SYNTAX_ERROR);
 
         READ_NEXT_CHAR (a_this, &cur_char);
@@ -3198,7 +3198,7 @@ cr_parser_parse_declaration (CRParser * a_this,
                 status = CR_PARSING_ERROR;
                 cr_parser_push_error
                         (a_this,
-                         "while parsing declaration: this char must be ':'",
+                         (const guchar *) "while parsing declaration: this char must be ':'",
                          CR_SYNTAX_ERROR);
                 goto error;
         }
@@ -3209,7 +3209,7 @@ cr_parser_parse_declaration (CRParser * a_this,
 
         CHECK_PARSING_STATUS_ERR
                 (a_this, status, FALSE,
-                 "while parsing declaration: next expression is malformed",
+                 (const guchar *) "while parsing declaration: next expression is malformed",
                  CR_SYNTAX_ERROR);
 
         cr_parser_try_to_skip_spaces_and_comments (a_this);
@@ -3349,7 +3349,7 @@ cr_parser_parse_ruleset (CRParser * a_this)
 
         ENSURE_PARSING_COND_ERR
                 (a_this, cur_char == '{',
-                 "while parsing rulset: current char should be '{'",
+                 (const guchar *) "while parsing rulset: current char should be '{'",
                  CR_SYNTAX_ERROR);
 
         if (PRIVATE (a_this)->sac_handler
@@ -3413,7 +3413,7 @@ cr_parser_parse_ruleset (CRParser * a_this)
         }
         CHECK_PARSING_STATUS_ERR
                 (a_this, status, FALSE,
-                 "while parsing ruleset: next construction should be a declaration",
+                 (const guchar *) "while parsing ruleset: next construction should be a declaration",
                  CR_SYNTAX_ERROR);
 
         for (;;) {
@@ -3455,7 +3455,7 @@ cr_parser_parse_ruleset (CRParser * a_this)
         READ_NEXT_CHAR (a_this, &cur_char);
         ENSURE_PARSING_COND_ERR
                 (a_this, cur_char == '}',
-                 "while parsing rulset: current char must be a '}'",
+                 (const guchar *) "while parsing rulset: current char must be a '}'",
                  CR_SYNTAX_ERROR);
 
         selector->location = end_parsing_location;
diff --git a/src/cr-pseudo.c b/src/cr-pseudo.c
index a46e69e..cee3fc8 100644
--- a/src/cr-pseudo.c
+++ b/src/cr-pseudo.c
@@ -68,11 +68,11 @@ cr_pseudo_to_string (CRPseudo const * a_this)
                         goto error;
                 }
 
-                name = g_strndup (a_this->name->stryng->str, 
+                name = (guchar *) g_strndup (a_this->name->stryng->str, 
                                   a_this->name->stryng->len);
 
                 if (name) {
-                        g_string_append (str_buf, name);
+                        g_string_append (str_buf, (const gchar *) name);
                         g_free (name);
                         name = NULL;
                 }
@@ -83,11 +83,11 @@ cr_pseudo_to_string (CRPseudo const * a_this)
                 if (a_this->name == NULL)
                         goto error;
 
-                name = g_strndup (a_this->name->stryng->str, 
+                name = (guchar *) g_strndup (a_this->name->stryng->str, 
                                   a_this->name->stryng->len);
 
                 if (a_this->extra) {
-                        arg = g_strndup (a_this->extra->stryng->str,
+                        arg = (guchar *) g_strndup (a_this->extra->stryng->str,
                                          a_this->extra->stryng->len);
                 }
 
@@ -97,7 +97,7 @@ cr_pseudo_to_string (CRPseudo const * a_this)
                         name = NULL;
 
                         if (arg) {
-                                g_string_append (str_buf, arg);
+                                g_string_append (str_buf, (const gchar *) arg);
                                 g_free (arg);
                                 arg = NULL;
                         }
@@ -107,7 +107,7 @@ cr_pseudo_to_string (CRPseudo const * a_this)
         }
 
         if (str_buf) {
-                result = str_buf->str;
+                result = (guchar *) str_buf->str;
                 g_string_free (str_buf, FALSE);
                 str_buf = NULL;
         }
diff --git a/src/cr-rgb.c b/src/cr-rgb.c
index ffd7746..d1cd5d2 100644
--- a/src/cr-rgb.c
+++ b/src/cr-rgb.c
@@ -274,7 +274,7 @@ cr_rgb_to_string (CRRgb const * a_this)
         }
 
         if (str_buf) {
-                result = str_buf->str;
+                result = (guchar *) str_buf->str;
                 g_string_free (str_buf, FALSE);
         }
 
@@ -586,7 +586,7 @@ cr_rgb_set_from_term (CRRgb *a_this, const struct _CRTerm *a_value)
                        } else  {
                                status = cr_rgb_set_from_name
                                         (a_this,
-                                         a_value->content.str->stryng->str) ;
+                                         (const guchar *) a_value->content.str->stryng->str) ;
                        }
                 } else {
                         cr_utils_trace_info 
@@ -599,7 +599,7 @@ cr_rgb_set_from_term (CRRgb *a_this, const struct _CRTerm *a_value)
                     && a_value->content.str->stryng->str) {
                         status = cr_rgb_set_from_hex_str
                                 (a_this, 
-                                 a_value->content.str->stryng->str) ;
+                                 (const guchar *) a_value->content.str->stryng->str) ;
                 } else {
                         cr_utils_trace_info
                                 ("a_value has NULL string value") ;
@@ -655,8 +655,7 @@ cr_rgb_parse_from_buf (const guchar *a_str,
        
        g_return_val_if_fail (a_str, NULL);
        
-       parser = cr_parser_new_from_buf ((guchar*)a_str, strlen (a_str), 
-                                         a_enc, FALSE) ;
+       parser = cr_parser_new_from_buf ((guchar *) a_str, strlen ((const char *) a_str), a_enc, FALSE);
 
        g_return_val_if_fail (parser, NULL);
 
diff --git a/src/cr-sel-eng.c b/src/cr-sel-eng.c
index 261314c..6378ee9 100644
--- a/src/cr-sel-eng.c
+++ b/src/cr-sel-eng.c
@@ -196,7 +196,7 @@ pseudo_class_add_sel_matches_node (CRSelEng * a_this,
                               && a_node, CR_BAD_PARAM_ERROR);
 
         status = cr_sel_eng_get_pseudo_class_selector_handler
-                (a_this, a_add_sel->content.pseudo->name->stryng->str,
+                (a_this, (guchar *) a_add_sel->content.pseudo->name->stryng->str,
                  a_add_sel->content.pseudo->type, &handler);
         if (status != CR_OK || !handler)
                 return FALSE;
@@ -451,7 +451,7 @@ attr_add_sel_matches_node (CRAdditionalSel * a_add_sel, xmlNode * a_node)
                                         ptr2 = cur;
 
                                         if (g_strstr_len
-                                            (ptr1, ptr2 - ptr1 + 1,
+                                            ((const gchar *) ptr1, ptr2 - ptr1 + 1,
                                              cur_sel->value->stryng->str)
                                             == (gchar *) ptr1) {
                                                 found = TRUE;
@@ -1180,7 +1180,7 @@ cr_sel_eng_register_pseudo_class_sel_handler (CRSelEng * a_this,
         }
         memset (handler_entry, 0,
                 sizeof (struct CRPseudoClassSelHandlerEntry));
-        handler_entry->name = g_strdup (a_name);
+        handler_entry->name = (guchar *) g_strdup ((const gchar *) a_name);
         handler_entry->type = a_type;
         handler_entry->handler = a_handler;
         list = g_list_append (PRIVATE (a_this)->pcs_handlers, handler_entry);
diff --git a/src/cr-selector.c b/src/cr-selector.c
index a3603e3..8902e1c 100644
--- a/src/cr-selector.c
+++ b/src/cr-selector.c
@@ -57,7 +57,7 @@ cr_selector_parse_from_buf (const guchar * a_char_buf, enum CREncoding a_enc)
 
         g_return_val_if_fail (a_char_buf, NULL);
 
-        parser = cr_parser_new_from_buf ((guchar*)a_char_buf, strlen (a_char_buf),
+        parser = cr_parser_new_from_buf ((guchar*)a_char_buf, strlen ((const char *) a_char_buf),
                                          a_enc, FALSE);
         g_return_val_if_fail (parser, NULL);
 
@@ -161,7 +161,7 @@ cr_selector_to_string (CRSelector const * a_this)
                                                 g_string_append (str_buf, 
                                                                 ", ");
 
-                                        g_string_append (str_buf, tmp_str);
+                                        g_string_append (str_buf, (const gchar *) tmp_str);
 
                                         g_free (tmp_str);
                                         tmp_str = NULL;
@@ -171,7 +171,7 @@ cr_selector_to_string (CRSelector const * a_this)
         }
 
         if (str_buf) {
-                result = str_buf->str;
+                result = (guchar *) str_buf->str;
                 g_string_free (str_buf, FALSE);
                 str_buf = NULL;
         }
diff --git a/src/cr-simple-sel.c b/src/cr-simple-sel.c
index e8d57af..0add0ea 100644
--- a/src/cr-simple-sel.c
+++ b/src/cr-simple-sel.c
@@ -112,7 +112,7 @@ cr_simple_sel_to_string (CRSimpleSel const * a_this)
         str_buf = g_string_new (NULL);
         for (cur = a_this; cur; cur = cur->next) {
                 if (cur->name) {
-                        guchar *str = g_strndup (cur->name->stryng->str,
+                        guchar *str = (guchar *) g_strndup (cur->name->stryng->str,
                                                  cur->name->stryng->len);
 
                         if (str) {
@@ -133,7 +133,7 @@ cr_simple_sel_to_string (CRSimpleSel const * a_this)
                                         break;
                                 }
 
-                                g_string_append (str_buf, str);
+                                g_string_append (str_buf, (const gchar *) str);
                                 g_free (str);
                                 str = NULL;
                         }
@@ -144,7 +144,7 @@ cr_simple_sel_to_string (CRSimpleSel const * a_this)
 
                         tmp_str = cr_additional_sel_to_string (cur->add_sel);
                         if (tmp_str) {
-                                g_string_append (str_buf, tmp_str);
+                                g_string_append (str_buf, (const gchar *) tmp_str);
                                 g_free (tmp_str);
                                 tmp_str = NULL;
                         }
@@ -152,7 +152,7 @@ cr_simple_sel_to_string (CRSimpleSel const * a_this)
         }
 
         if (str_buf) {
-                result = str_buf->str;
+                result = (guchar *) str_buf->str;
                 g_string_free (str_buf, FALSE);
                 str_buf = NULL;
         }
@@ -171,7 +171,7 @@ cr_simple_sel_one_to_string (CRSimpleSel const * a_this)
 
         str_buf = g_string_new (NULL);
         if (a_this->name) {
-                guchar *str = g_strndup (a_this->name->stryng->str,
+                guchar *str = (guchar *) g_strndup (a_this->name->stryng->str,
                                          a_this->name->stryng->len);
 
                 if (str) {
@@ -194,7 +194,7 @@ cr_simple_sel_one_to_string (CRSimpleSel const * a_this)
         }
 
         if (str_buf) {
-                result = str_buf->str;
+                result = (guchar *) str_buf->str;
                 g_string_free (str_buf, FALSE);
                 str_buf = NULL;
         }
diff --git a/src/cr-statement.c b/src/cr-statement.c
index 6adea1b..b91de12 100644
--- a/src/cr-statement.c
+++ b/src/cr-statement.c
@@ -601,7 +601,7 @@ cr_statement_ruleset_to_string (CRStatement const * a_this, glong a_indent)
                         cr_utils_dump_n_chars2 (' ', stringue, a_indent);
 
                 tmp_str =
-                        cr_selector_to_string (a_this->kind.ruleset->
+                        (gchar *) cr_selector_to_string (a_this->kind.ruleset->
                                                sel_list);
                 if (tmp_str) {
                         g_string_append (stringue, tmp_str);
@@ -611,7 +611,7 @@ cr_statement_ruleset_to_string (CRStatement const * a_this, glong a_indent)
         }
         g_string_append (stringue, " {\n");
         if (a_this->kind.ruleset->decl_list) {
-                tmp_str = cr_declaration_list_to_string2
+                tmp_str = (gchar *) cr_declaration_list_to_string2
                         (a_this->kind.ruleset->decl_list,
                          a_indent + DECLARATION_INDENT_NB, TRUE);
                 if (tmp_str) {
@@ -667,7 +667,7 @@ cr_statement_font_face_rule_to_string (CRStatement const * a_this,
                         cr_utils_dump_n_chars2 (' ', stringue, 
                                         a_indent);
                 g_string_append (stringue, "@font-face {\n");
-                tmp_str = cr_declaration_list_to_string2 
+                tmp_str = (gchar *) cr_declaration_list_to_string2 
                         (a_this->kind.font_face_rule->decl_list,
                          a_indent + DECLARATION_INDENT_NB, TRUE) ;
                 if (tmp_str) {
@@ -770,7 +770,7 @@ cr_statement_at_page_rule_to_string (CRStatement const *a_this,
         if (a_this->kind.page_rule->decl_list) {
                 gchar *str = NULL ;
                 g_string_append (stringue, " {\n");
-                str = cr_declaration_list_to_string2
+                str = (gchar *) cr_declaration_list_to_string2
                         (a_this->kind.page_rule->decl_list,
                          a_indent + DECLARATION_INDENT_NB, TRUE) ;
                 if (str) {
@@ -854,7 +854,7 @@ cr_statement_import_rule_to_string (CRStatement const *a_this,
                                     gulong a_indent)
 {
         GString *stringue = NULL ;
-        guchar *str = NULL;
+        gchar *str = NULL;
 
         g_return_val_if_fail (a_this
                               && a_this->type == AT_IMPORT_RULE_STMT
@@ -2606,7 +2606,7 @@ cr_statement_dump (CRStatement const * a_this, FILE * a_fp, gulong a_indent)
 void
 cr_statement_dump_ruleset (CRStatement const * a_this, FILE * a_fp, glong a_indent)
 {
-        guchar *str = NULL;
+        gchar *str = NULL;
 
         g_return_if_fail (a_fp && a_this);
         str = cr_statement_ruleset_to_string (a_this, a_indent);
@@ -2655,7 +2655,7 @@ cr_statement_dump_font_face_rule (CRStatement const * a_this, FILE * a_fp,
 void
 cr_statement_dump_charset (CRStatement const * a_this, FILE * a_fp, gulong a_indent)
 {
-        guchar *str = NULL;
+        gchar *str = NULL;
 
         g_return_if_fail (a_this && a_this->type == AT_CHARSET_RULE_STMT);
 
@@ -2681,7 +2681,7 @@ cr_statement_dump_charset (CRStatement const * a_this, FILE * a_fp, gulong a_ind
 void
 cr_statement_dump_page (CRStatement const * a_this, FILE * a_fp, gulong a_indent)
 {
-        guchar *str = NULL;
+        gchar *str = NULL;
 
         g_return_if_fail (a_this
                           && a_this->type == AT_PAGE_RULE_STMT
diff --git a/src/cr-style.c b/src/cr-style.c
index 84bc58e..86c1a8b 100644
--- a/src/cr-style.c
+++ b/src/cr-style.c
@@ -92,7 +92,7 @@ enum CRPropertyID {
 typedef struct _CRPropertyDesc CRPropertyDesc;
 
 struct _CRPropertyDesc {
-        const guchar *name;
+        const gchar *name;
         enum CRPropertyID prop_id;
 };
 
@@ -804,7 +804,7 @@ set_prop_margin_x_from_value (CRStyle * a_style, CRTerm * a_value,
 }
 
 struct CRPropDisplayValPair {
-        const guchar *prop_name;
+        const gchar *prop_name;
         enum CRDisplayType type;
 };
 
@@ -865,7 +865,7 @@ set_prop_display_from_value (CRStyle * a_style, CRTerm * a_value)
 }
 
 struct CRPropPositionValPair {
-        const guchar *name;
+        const gchar *name;
         enum CRPositionType type;
 };
 
@@ -1120,11 +1120,11 @@ set_prop_border_x_color_from_value (CRStyle * a_style, CRTerm * a_value,
                     && a_value->content.str->stryng->str) {
                         status = cr_rgb_set_from_name
                                 (rgb_color, 
-                                 a_value->content.str->stryng->str);
+                                 (const guchar *) a_value->content.str->stryng->str);
 
                 }
                 if (status != CR_OK) {
-                        cr_rgb_set_from_name (rgb_color, "black");
+                        cr_rgb_set_from_name (rgb_color, (const guchar *) "black");
                 }
         } else if (a_value->type == TERM_RGB) {
                 if (a_value->content.rgb) {
@@ -1358,7 +1358,7 @@ set_prop_font_family_from_value (CRStyle * a_style, CRTerm * a_value)
                                     && cur_term->content.str->stryng->str) {
                                         cur_ff = cr_font_family_new
                                                 (FONT_FAMILY_NON_GENERIC,
-                                                 cur_term->content.str->stryng->str);
+                                                 (guchar *) cur_term->content.str->stryng->str);
                                 }
                         }
                         break;
@@ -2024,7 +2024,7 @@ cr_style_set_style_from_decl (CRStyle * a_this, CRDeclaration * a_decl)
                               CR_BAD_PARAM_ERROR);
 
         prop_id = cr_style_get_prop_id
-                (a_decl->property->stryng->str);
+                ((const guchar *) a_decl->property->stryng->str);
 
         value = a_decl->value;
         switch (prop_id) {
@@ -2746,7 +2746,7 @@ cr_style_to_string (CRStyle * a_this, GString ** a_str, guint a_nb_indent)
 
         cr_utils_dump_n_chars2 (' ', str, indent);
         g_string_append (str, "font-family: ");
-        tmp_str = cr_font_family_to_string (a_this->font_family, TRUE);
+        tmp_str = (gchar *) cr_font_family_to_string (a_this->font_family, TRUE);
         if (tmp_str) {
                 g_string_append (str, tmp_str);
                 g_free (tmp_str);
diff --git a/src/cr-term.c b/src/cr-term.c
index d6db51a..5cc63b0 100644
--- a/src/cr-term.c
+++ b/src/cr-term.c
@@ -334,7 +334,7 @@ cr_term_to_string (CRTerm const * a_this)
                         }
 
                         if (content) {
-                                g_string_append (str_buf, content);
+                                g_string_append (str_buf, (const gchar *) content);
                                 g_free (content);
                                 content = NULL;
                         }
@@ -343,7 +343,7 @@ cr_term_to_string (CRTerm const * a_this)
 
                 case TERM_FUNCTION:
                         if (cur->content.str) {
-                                content = g_strndup
+                                content = (guchar *) g_strndup
                                         (cur->content.str->stryng->str,
                                          cur->content.str->stryng->len);
                         }
@@ -361,7 +361,7 @@ cr_term_to_string (CRTerm const * a_this)
 
                                         if (tmp_str) {
                                                 g_string_append (str_buf, 
-                                                                tmp_str);
+                                                                (const gchar *) tmp_str);
                                                 g_free (tmp_str);
                                                 tmp_str = NULL;
                                         }
@@ -376,7 +376,7 @@ cr_term_to_string (CRTerm const * a_this)
 
                 case TERM_STRING:
                         if (cur->content.str) {
-                                content = g_strndup
+                                content = (guchar *) g_strndup
                                         (cur->content.str->stryng->str,
                                          cur->content.str->stryng->len);
                         }
@@ -391,13 +391,13 @@ cr_term_to_string (CRTerm const * a_this)
 
                 case TERM_IDENT:
                         if (cur->content.str) {
-                                content = g_strndup
+                                content = (guchar *) g_strndup
                                         (cur->content.str->stryng->str,
                                          cur->content.str->stryng->len);
                         }
 
                         if (content) {
-                                g_string_append (str_buf, content);
+                                g_string_append (str_buf, (const gchar *) content);
                                 g_free (content);
                                 content = NULL;
                         }
@@ -405,7 +405,7 @@ cr_term_to_string (CRTerm const * a_this)
 
                 case TERM_URI:
                         if (cur->content.str) {
-                                content = g_strndup
+                                content = (guchar *) g_strndup
                                         (cur->content.str->stryng->str,
                                          cur->content.str->stryng->len);
                         }
@@ -426,7 +426,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, (const gchar *) tmp_str);
                                         g_free (tmp_str);
                                         tmp_str = NULL;
                                 }
@@ -443,7 +443,7 @@ cr_term_to_string (CRTerm const * a_this)
 
                 case TERM_HASH:
                         if (cur->content.str) {
-                                content = g_strndup
+                                content = (guchar *) g_strndup
                                         (cur->content.str->stryng->str,
                                          cur->content.str->stryng->len);
                         }
@@ -464,7 +464,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;
         }
@@ -529,7 +529,7 @@ cr_term_one_to_string (CRTerm const * a_this)
                 }
 
                 if (content) {
-                        g_string_append (str_buf, content);
+                        g_string_append (str_buf, (const gchar *) content);
                         g_free (content);
                         content = NULL;
                 }
@@ -538,7 +538,7 @@ cr_term_one_to_string (CRTerm const * a_this)
 
         case TERM_FUNCTION:
                 if (a_this->content.str) {
-                        content = g_strndup
+                        content = (guchar *) g_strndup
                                 (a_this->content.str->stryng->str,
                                  a_this->content.str->stryng->len);
                 }
@@ -572,7 +572,7 @@ cr_term_one_to_string (CRTerm const * a_this)
 
         case TERM_STRING:
                 if (a_this->content.str) {
-                        content = g_strndup
+                        content = (guchar *) g_strndup
                                 (a_this->content.str->stryng->str,
                                  a_this->content.str->stryng->len);
                 }
@@ -587,13 +587,13 @@ cr_term_one_to_string (CRTerm const * a_this)
 
         case TERM_IDENT:
                 if (a_this->content.str) {
-                        content = g_strndup
+                        content = (guchar *) g_strndup
                                 (a_this->content.str->stryng->str,
                                  a_this->content.str->stryng->len);
                 }
 
                 if (content) {
-                        g_string_append (str_buf, content);
+                        g_string_append (str_buf, (const gchar *) content);
                         g_free (content);
                         content = NULL;
                 }
@@ -601,7 +601,7 @@ cr_term_one_to_string (CRTerm const * a_this)
 
         case TERM_URI:
                 if (a_this->content.str) {
-                        content = g_strndup
+                        content = (guchar *) g_strndup
                                 (a_this->content.str->stryng->str,
                                  a_this->content.str->stryng->len);
                 }
@@ -622,7 +622,7 @@ cr_term_one_to_string (CRTerm const * a_this)
                         tmp_str = cr_rgb_to_string (a_this->content.rgb);
 
                         if (tmp_str) {
-                                g_string_append (str_buf, tmp_str);
+                                g_string_append (str_buf, (const gchar *) tmp_str);
                                 g_free (tmp_str);
                                 tmp_str = NULL;
                         }
@@ -639,7 +639,7 @@ cr_term_one_to_string (CRTerm const * a_this)
 
         case TERM_HASH:
                 if (a_this->content.str) {
-                        content = g_strndup
+                        content = (guchar *) g_strndup
                                 (a_this->content.str->stryng->str,
                                  a_this->content.str->stryng->len);
                 }
@@ -660,7 +660,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;
         }
diff --git a/src/cr-tknzr.c b/src/cr-tknzr.c
index 2491172..6fc04a6 100644
--- a/src/cr-tknzr.c
+++ b/src/cr-tknzr.c
@@ -1639,7 +1639,7 @@ cr_tknzr_new_from_uri (const guchar * a_file_uri,
         CRTknzr *result = NULL;
         CRInput *input = NULL;
 
-        input = cr_input_new_from_uri (a_file_uri, a_enc);
+        input = cr_input_new_from_uri ((const gchar *) a_file_uri, a_enc);
         g_return_val_if_fail (input != NULL, NULL);
 
         result = cr_tknzr_new (input);
diff --git a/tests/test0-main.c b/tests/test0-main.c
index a991abf..d1fd584 100644
--- a/tests/test0-main.c
+++ b/tests/test0-main.c
@@ -145,7 +145,7 @@ test_cr_input_read_byte (guchar * a_file_uri)
 
         g_return_val_if_fail (a_file_uri, CR_BAD_PARAM_ERROR);
 
-        input = cr_input_new_from_uri (a_file_uri, CR_UTF_8);
+        input = cr_input_new_from_uri ((const gchar *) a_file_uri, CR_UTF_8);
 
         if (!input) {
                 cr_utils_trace_debug ("Input Stream creation failed.");
@@ -197,7 +197,7 @@ main (int argc, char **argv)
                 return 0;
         }
 
-        test_cr_input_read_byte (options.files_list[0]);
+        test_cr_input_read_byte ((guchar *) options.files_list[0]);
 
         return 0;
 }
diff --git a/tests/test1-main.c b/tests/test1-main.c
index 3346025..e01913c 100644
--- a/tests/test1-main.c
+++ b/tests/test1-main.c
@@ -140,7 +140,7 @@ test_cr_input_read_char (guchar * a_file_uri)
 
         g_return_val_if_fail (a_file_uri, CR_BAD_PARAM_ERROR);
 
-        input = cr_input_new_from_uri (a_file_uri, CR_UTF_8);
+        input = cr_input_new_from_uri ((const gchar *) a_file_uri, CR_UTF_8);
 
         if (!input) {
                 cr_utils_trace_debug ("Input Stream creation failed.");
@@ -191,7 +191,7 @@ main (int argc, char **argv)
                 return 0;
         }
 
-        test_cr_input_read_char (options.files_list[0]);
+        test_cr_input_read_char ((guchar *) options.files_list[0]);
 
         return 0;
 }
diff --git a/tests/test2-main.c b/tests/test2-main.c
index be1d545..7d94a80 100644
--- a/tests/test2-main.c
+++ b/tests/test2-main.c
@@ -124,7 +124,7 @@ test_import_style (CRDocHandler * a_handler,
 
                 for (cur = a_media_list; cur; cur = cur->next) {
                         if (cur->data) {
-                                guchar *str =
+                                gchar *str =
                                         g_strndup
                                         (((CRString *) cur->data)->stryng->str,
                                          ((CRString *) cur->data)->stryng->len);
@@ -141,7 +141,7 @@ test_import_style (CRDocHandler * a_handler,
                 fprintf (stdout, "--------------------\n");
 
                 if (a_uri_default_ns) {
-                        guchar *str = cr_string_dup2 
+                        guchar *str = (guchar *) cr_string_dup2 
                                 (a_uri_default_ns) ;
                         if (str) {
                                 fprintf (stdout, "%s\n", str);
@@ -166,7 +166,7 @@ test_namespace_declaration (CRDocHandler * a_handler,
         fprintf (stdout, "namespace_declaration:\n");
 
         if (a_prefix) {
-                guchar *prefix = NULL;
+                gchar *prefix = NULL;
 
                 prefix = cr_string_dup2 (a_prefix) ;
                 if (prefix) {
@@ -176,7 +176,7 @@ test_namespace_declaration (CRDocHandler * a_handler,
                 }
         }
         if (a_uri) {
-                guchar *uri = NULL;
+                gchar *uri = NULL;
 
                 uri = cr_string_dup2 (a_uri) ;
                 if (uri) {
@@ -200,7 +200,7 @@ test_comment (CRDocHandler * a_handler,
         fprintf (stdout, "***************\n");
         fprintf (stdout, "comment:\n");
         if (a_comment) {
-                guchar *comment = NULL;
+                gchar *comment = NULL;
 
                 comment = cr_string_dup2 (a_comment);
 
@@ -263,7 +263,7 @@ test_property (CRDocHandler * a_handler,
         if (a_name 
             && a_name->stryng
             && a_name->stryng->str) {
-                guchar *name = g_strndup 
+                gchar *name = g_strndup 
                         (a_name->stryng->str, 
                          a_name->stryng->len);
 
@@ -317,7 +317,7 @@ test_start_media (CRDocHandler * a_handler,
 
         if (a_media_list) {
                 GList *cur = NULL;
-                guchar *medium = NULL;
+                gchar *medium = NULL;
 
                 for (cur = a_media_list; cur; cur = cur->next) {
                         if (cur->data == NULL)
@@ -347,7 +347,7 @@ test_end_media (CRDocHandler * a_handler,
 
         if (a_media_list) {
                 GList *cur = NULL;
-                guchar *medium = NULL;
+                gchar *medium = NULL;
 
                 for (cur = a_media_list; cur; cur = cur->next) {
                         if (cur->data == NULL)
@@ -374,7 +374,7 @@ test_start_page (CRDocHandler * a_handler,
                  CRString * a_pseudo_page,
                  CRParsingLocation *a_location)
 {
-        guchar *name = NULL,
+        gchar *name = NULL,
                 *pseudo_page = NULL;
 
         g_return_if_fail (a_handler);
@@ -410,7 +410,7 @@ test_end_page (CRDocHandler * a_handler,
                CRString * a_name, 
                CRString * a_pseudo_page)
 {
-        guchar *name = NULL,
+        gchar *name = NULL,
                 *pseudo_page = NULL;
 
         g_return_if_fail (a_handler);
@@ -446,7 +446,7 @@ static void
 test_ignorable_at_rule (CRDocHandler * a_handler, 
                         CRString * a_name)
 {
-        guchar *name = NULL;
+        gchar *name = NULL;
 
         g_return_if_fail (a_handler);
 
@@ -551,7 +551,7 @@ main (int argc, char **argv)
                 return 0;
         }
 
-        status = test_cr_parser_parse (options.files_list[0]);
+        status = test_cr_parser_parse ((guchar *) options.files_list[0]);
 
         if (status != CR_OK) {
                 fprintf (stdout, "KO\n");
diff --git a/tests/test3-main.c b/tests/test3-main.c
index 33e1a9a..1dd5d07 100644
--- a/tests/test3-main.c
+++ b/tests/test3-main.c
@@ -120,7 +120,7 @@ test_import_style (CRDocHandler * a_handler,
 
                 for (cur = a_media_list; cur; cur = cur->next) {
                         if (cur->data) {
-                                guchar *str =
+                                gchar *str =
                                         cr_string_dup2 ((CRString *) cur->data);
                                 if (str) {
                                         fprintf (stdout, "%s\n", str);
@@ -133,7 +133,7 @@ test_import_style (CRDocHandler * a_handler,
                 fprintf (stdout, "--------------------\n");
 
                 if (a_uri_default_ns) {
-                        guchar *str = cr_string_dup2 (a_uri_default_ns) ;
+                        gchar *str = cr_string_dup2 (a_uri_default_ns) ;
                         if (str) {
                                 fprintf (stdout, "%s\n", str);
                                 g_free (str);
@@ -157,7 +157,7 @@ test_namespace_declaration (CRDocHandler * a_handler,
         fprintf (stdout, "namespace_declaration:\n");
 
         if (a_prefix) {
-                guchar *prefix = NULL;
+                gchar *prefix = NULL;
 
                 prefix = cr_string_dup2 (a_prefix);
                 if (prefix) {
@@ -168,7 +168,7 @@ test_namespace_declaration (CRDocHandler * a_handler,
         }
 
         if (a_uri) {
-                guchar *uri = NULL;
+                gchar *uri = NULL;
                 uri = cr_string_dup2 (a_uri) ;
                 if (uri) {
                         fprintf (stdout, "uri: %s\n", uri);
@@ -192,7 +192,7 @@ test_comment (CRDocHandler * a_handler,
         fprintf (stdout, "comment:\n");
 
         if (a_comment) {
-                guchar *comment = NULL;
+                gchar *comment = NULL;
 
                 comment = cr_string_dup2 (a_comment);
 
@@ -251,7 +251,7 @@ test_property (CRDocHandler * a_handler, CRString * a_name,
         fprintf (stdout, "property\n");
 
         if (a_name) {
-                guchar *name = cr_string_dup2  (a_name);
+                gchar *name = cr_string_dup2  (a_name);
                 if (name) {
                         fprintf (stdout, "%s", name);
                 }
@@ -302,7 +302,7 @@ test_start_media (CRDocHandler * a_handler,
 
         if (a_media_list) {
                 GList *cur = NULL;
-                guchar *medium = NULL;
+                gchar *medium = NULL;
 
                 for (cur = a_media_list; cur; cur = cur->next) {
                         if (cur->data == NULL)
@@ -331,7 +331,7 @@ test_end_media (CRDocHandler * a_handler,
 
         if (a_media_list) {
                 GList *cur = NULL;
-                guchar *medium = NULL;
+                gchar *medium = NULL;
 
                 for (cur = a_media_list; cur; cur = cur->next) {
                         if (cur->data == NULL)
@@ -355,7 +355,7 @@ test_start_page (CRDocHandler * a_handler,
                  CRString * a_pseudo_page,
                  CRParsingLocation *a_location)
 {
-        guchar *name = NULL,
+        gchar *name = NULL,
                 *pseudo_page = NULL;
 
         g_return_if_fail (a_handler);
@@ -391,7 +391,7 @@ test_end_page (CRDocHandler * a_handler,
                CRString * a_name, 
                CRString * a_pseudo_page)
 {
-        guchar *name = NULL,
+        gchar *name = NULL,
                 *pseudo_page = NULL;
 
         g_return_if_fail (a_handler);
@@ -426,7 +426,7 @@ static void
 test_ignorable_at_rule (CRDocHandler * a_handler, 
                         CRString * a_name)
 {
-        guchar *name = NULL;
+        gchar *name = NULL;
 
         g_return_if_fail (a_handler);
 
@@ -532,7 +532,7 @@ main (int argc, char **argv)
                 return 0;
         }
 
-        status = test_cr_parser_parse (options.files_list[0]);
+        status = test_cr_parser_parse ((guchar *) options.files_list[0]);
 
         if (status != CR_OK) {
                 fprintf (stdout, "KO\n");
diff --git a/tests/test4-main.c b/tests/test4-main.c
index 1d80022..3f76497 100644
--- a/tests/test4-main.c
+++ b/tests/test4-main.c
@@ -32,27 +32,27 @@
 
 CRDocHandler *gv_test_handler = { 0 };
 
-const guchar *gv_term_buf = "106";
+const guchar *gv_term_buf = (const guchar *) "106";
 
-const guchar *gv_decl_buf = "toto: tutu, tata";
+const guchar *gv_decl_buf = (const guchar *) "toto: tutu, tata";
 
-const guchar *gv_decl_list_buf = "toto: titi; prop1:val1 ; prop2:val2;";
+const guchar *gv_decl_list_buf = (const guchar *) "toto: titi; prop1:val1 ; prop2:val2;";
 
-const guchar *gv_ruleset_buf = "s1 > s2 {toto: tutu, tata} ";
+const guchar *gv_ruleset_buf = (const guchar *) "s1 > s2 {toto: tutu, tata} ";
 
 const guchar *gv_at_media_buf =
-        "@media print, toto {" "  BODY { font-size: 10pt }" "  }";
+        (const guchar *) "@media print, toto {" "  BODY { font-size: 10pt }" "  }";
 
-const guchar *gv_at_page_buf = "@page { size :8.5in 11in; margin: 2cm }";
+const guchar *gv_at_page_buf = (const guchar *) "@page { size :8.5in 11in; margin: 2cm }";
 
-const guchar *gv_at_charset_buf = "@charset \"ISO-8859-1\" ; ";
+const guchar *gv_at_charset_buf = (const guchar *) "@charset \"ISO-8859-1\" ; ";
 
 const guchar *gv_at_font_face_buf =
-        "@font-face {"
+        (const guchar *) "@font-face {"
         " font-family: \"Robson Celtic\";"
         " src: url(\"http://site/fonts/rob-celt\";)" "}";
 
-const guchar *gv_at_import_buf = "@import \"subs.css\";";
+const guchar *gv_at_import_buf = (const guchar *) "@import \"subs.css\";";
 
 static void display_help (char *prg_name);
 
@@ -166,7 +166,7 @@ test_cr_term_parse_expression_from_buf (void)
 static enum CRStatus
 test_cr_declaration_parse (void)
 {
-        guchar *tmp_str = NULL;
+        gchar *tmp_str = NULL;
         CRDeclaration *decl = NULL;
 
         decl = cr_declaration_parse_from_buf (NULL, gv_decl_buf, CR_UTF_8);
@@ -190,7 +190,7 @@ static enum CRStatus
 test_cr_declaration_parse_list (void)
 {
         GString *str = NULL;
-        guchar *tmp_str = NULL;
+        gchar *tmp_str = NULL;
         CRDeclaration *decl = NULL,
                 *cur_decl = NULL;
 
@@ -426,7 +426,7 @@ main (int argc, char **argv)
                 return 0;
         }
 
-        status = test_cr_parser_parse (options.files_list[0]);
+        status = test_cr_parser_parse ((guchar *) options.files_list[0]);
         if (status != CR_OK) {
                 g_print ("\nKO\n");
         }
diff --git a/tests/test5-main.c b/tests/test5-main.c
index 034da23..2b7c9c7 100644
--- a/tests/test5-main.c
+++ b/tests/test5-main.c
@@ -32,7 +32,7 @@
 CRDocHandler *gv_test_handler = { 0 };
 
 const guchar *xml_content =
-        "<document>"
+        (const guchar *) "<document>"
         "<E0>text0</E0> "
         "<E1><E1-1>text1</E1-1></E1>"
         "<E2 attr2=\"val2\">text2</E2>"
@@ -242,7 +242,7 @@ main (int argc, char **argv)
                 return 0;
         }
 
-        status = test_sel_eng (options.files_list[0]);
+        status = test_sel_eng ((guchar *) options.files_list[0]);
 
         if (status != CR_OK) {
                 g_print ("\nKO\n");
diff --git a/tests/test6-main.c b/tests/test6-main.c
index f9dd1c3..e2cfc94 100644
--- a/tests/test6-main.c
+++ b/tests/test6-main.c
@@ -31,7 +31,7 @@
 #include "cr-test-utils.h"
 
 const guchar *gv_cssbuf =
-        ".str0 {stroke:#007844;stroke-width:44}" ".fil0 {fill:url(#id0)}";
+        (const guchar *) ".str0 {stroke:#007844;stroke-width:44}" ".fil0 {fill:url(#id0)}";
 
 static enum CRStatus
   test_cr_parser_parse (void);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]