Code

More compile error cleanup
authorishmal <ishmal@users.sourceforge.net>
Wed, 15 Nov 2006 13:44:09 +0000 (13:44 +0000)
committerishmal <ishmal@users.sourceforge.net>
Wed, 15 Nov 2006 13:44:09 +0000 (13:44 +0000)
src/libcroco/cr-enc-handler.c
src/libcroco/cr-fonts.c
src/libcroco/cr-parser.c
src/libcroco/cr-parsing-location.c
src/libcroco/cr-style.c

index 456ac51fa3b848d9284ec4913054e5f8fdee17f1..973a5f373435e2bc020ae5587748d25d9c785226 100644 (file)
@@ -57,7 +57,7 @@ static struct CREncAlias gv_default_aliases[] = {
         {"UCS-4", CR_UCS_4},
         {"UCS_4", CR_UCS_4},
         {"ASCII", CR_ASCII},
-        {(char *)0, (CREncoding)0}
+        {(char *)0, (enum CREncoding)0}
 };
 
 static CREncHandler gv_default_enc_handlers[] = {
@@ -70,7 +70,7 @@ static CREncHandler gv_default_enc_handlers[] = {
         {CR_ASCII, cr_utils_ucs1_to_utf8, cr_utils_utf8_to_ucs1,
          cr_utils_ucs1_str_len_as_utf8, cr_utils_utf8_str_len_as_ucs1},
 
-        {(CREncoding)0, NULL, NULL, NULL, NULL}
+        {(enum CREncoding)0, NULL, NULL, NULL, NULL}
 };
 
 /**
index 63d8412f256286fec2cf313812ba3c8eef56b86b..14438c344264e626594b65360ab7027e0b76fd2a 100644 (file)
@@ -613,7 +613,7 @@ cr_font_weight_get_bolder (enum CRFontWeight a_weight)
                 cr_utils_trace_info ("FONT_WEIGHT_BOLDER or FONT_WEIGHT_LIGHTER should not appear here") ;
                 return FONT_WEIGHT_NORMAL ;
         } else {
-                return (CRFontWeight)(a_weight << 1) ;
+                return (enum CRFontWeight)(a_weight << 1) ;
         }
 }
 
index 2b411a8d48283ca0e067df2e19781290c9ab41b7..5b0a56f32eb4b5fae0aa4aa9780336a267e9965f 100644 (file)
@@ -1675,14 +1675,14 @@ cr_parser_parse_simple_selector (CRParser * a_this, CRSimpleSel ** a_sel)
         if (token && token->type == DELIM_TK 
             && token->u.unichar == '*') {
                 int comb = (int)sel->type_mask | (int) UNIVERSAL_SELECTOR;
-                sel->type_mask = (SimpleSelectorType)comb;
+                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;
                 int comb = (int)sel->type_mask | (int) TYPE_SELECTOR;
-                sel->type_mask = (SimpleSelectorType)comb;
+                sel->type_mask = (enum SimpleSelectorType)comb;
                 //sel->type_mask |= TYPE_SELECTOR;
                 token->u.str = NULL;
                 found_sel = TRUE;
@@ -1961,7 +1961,7 @@ cr_parser_parse_simple_sels (CRParser * a_this,
                         break;
 
                 if (comb && sel) {
-                        sel->combinator = (Combinator)comb;
+                        sel->combinator = (enum Combinator)comb;
                         comb = 0;
                 }
                 if (sel) {
index 49e8a3ce967c7144ba6a36a152690aac3447338c..38a75a6e6244ff3a42cd03ebd82a846997b8c5ab 100644 (file)
@@ -95,7 +95,7 @@ cr_parsing_location_to_string (CRParsingLocation *a_this,
        g_return_val_if_fail (a_this, NULL) ;
 
        if (!a_mask) {
-               a_mask = (CRParsingLocationSerialisationMask)
+               a_mask = (enum CRParsingLocationSerialisationMask)
                    ((int)DUMP_LINE | (int)DUMP_COLUMN | (int)DUMP_BYTE_OFFSET) ;
        }
        GString *result = (GString *)g_string_new (NULL) ;
index 82b2a2494658bee0af78ef1de7aa975818d996fc..e0abba83a42463db0e08a839169b63181785d7b4 100644 (file)
@@ -142,7 +142,7 @@ static CRPropertyDesc gv_prop_table[] = {
         {"font-weight", PROP_ID_FONT_WEIGHT},
            {"white-space", PROP_ID_WHITE_SPACE},
         /*must be the last one */
-        {NULL, (CRPropertyID)0}
+        {NULL, (enum CRPropertyID)0}
 };
 
 /**
@@ -185,7 +185,7 @@ static struct CRNumPropEnumDumpInfo gv_num_props_dump_infos[] = {
         {NUM_PROP_MARGIN_BOTTOM, "margin-bottom"},
         {NUM_PROP_MARGIN_LEFT, "margin-left"},
         {NUM_PROP_WIDTH, "width"},
-        {(CRNumProp)0, NULL}
+        {(enum CRNumProp)0, NULL}
 };
 
 struct CRRgbPropEnumDumpInfo {
@@ -200,7 +200,7 @@ static struct CRRgbPropEnumDumpInfo gv_rgb_props_dump_infos[] = {
         {RGB_PROP_BORDER_LEFT_COLOR, "left-color"},
         {RGB_PROP_COLOR, "color"},
         {RGB_PROP_BACKGROUND_COLOR, "background-color"},
-        {(CRRgbProp)0, NULL}
+        {(enum CRRgbProp)0, NULL}
 };
 
 struct CRBorderStylePropEnumDumpInfo {
@@ -215,7 +215,7 @@ static struct CRBorderStylePropEnumDumpInfo gv_border_style_props_dump_infos[]
         {BORDER_STYLE_PROP_RIGHT, "border-style-right"},
         {BORDER_STYLE_PROP_BOTTOM, "boder-style-bottom"},
         {BORDER_STYLE_PROP_LEFT, "border-style-left"},
-        {(CRBorderStyleProp)0, NULL}
+        {(enum CRBorderStyleProp)0, NULL}
 };
 
 static enum CRStatus
@@ -425,7 +425,7 @@ cr_style_get_prop_id (const guchar * a_prop)
         if (!raw_id) {
                 return PROP_ID_NOT_KNOWN;
         }
-        return (CRPropertyID)GPOINTER_TO_INT (raw_id);
+        return (enum CRPropertyID)GPOINTER_TO_INT (raw_id);
 }
 
 static enum CRStatus
@@ -576,9 +576,9 @@ set_prop_border_width_from_value (CRStyle *a_style,
         if (!cur_term)
                 return CR_ERROR ;
 
-        for (int dir = (int) DIR_TOP ; 
-             dir < (int)NB_DIRS ; dir++) {
-                 CRDirection direction = (CRDirection)dir;
+        int dir;
+        for (dir = (int) DIR_TOP ; dir < (int)NB_DIRS ; dir++) {
+                 enum CRDirection direction = (enum CRDirection)dir;
                  set_prop_border_x_width_from_value (a_style, 
                                                     cur_term,
                                                     direction) ;
@@ -704,9 +704,9 @@ set_prop_border_style_from_value (CRStyle *a_style,
                 return CR_ERROR ;
         }
         
-        for (int dir = (int)DIR_TOP ; dir < (int)NB_DIRS ; dir++) 
-                {
-                CRDirection direction = (CRDirection)dir;
+        int dir;
+        for (dir = (int)DIR_TOP ; dir < (int)NB_DIRS ; dir++) { 
+                enum CRDirection direction = (enum CRDirection)dir;
                 set_prop_border_x_style_from_value (a_style, 
                                                     cur_term,
                                                     direction) ;
@@ -1163,10 +1163,11 @@ set_prop_border_from_value (CRStyle * a_style, CRTerm * a_value)
 {
         g_return_val_if_fail (a_style && a_value, CR_BAD_PARAM_ERROR);
 
-        for (int direction = 0; direction < NB_DIRS; direction++) {
+        int dir;
+        for (dir = 0; dir < (int)NB_DIRS; dir++) {
                 set_prop_border_x_from_value (a_style, 
                                               a_value, 
-                                              (CRDirection)direction);
+                                              (enum CRDirection)dir);
         }
 
         return CR_OK;
@@ -1189,9 +1190,10 @@ set_prop_padding_from_value (CRStyle * a_style, CRTerm * a_value)
         if (!cur_term)
                 return CR_ERROR ;
 
-        for (int direction = 0; direction < (int)NB_DIRS; direction++) {
+        int dir;
+        for (dir = 0; dir < (int)NB_DIRS; dir++) {
                 set_prop_padding_x_from_value (a_style,
-                                           cur_term, (CRDirection)direction);
+                                           cur_term, (enum CRDirection)dir);
         }
         cur_term = cur_term->next;
 
@@ -1240,9 +1242,10 @@ set_prop_margin_from_value (CRStyle * a_style, CRTerm * a_value)
         if (!cur_term)
                 return CR_OK;
 
-        for (int direction = 0; direction < (int)NB_DIRS; direction++) {
+        int dir;
+        for (dir = 0; dir < (int)NB_DIRS; dir++) {
                 set_prop_margin_x_from_value(a_style,
-                                       cur_term, (CRDirection)direction);
+                                       cur_term, (enum CRDirection)dir);
         }
         cur_term = cur_term->next;
 
@@ -2673,7 +2676,7 @@ cr_style_to_string (CRStyle * a_this, GString ** a_str, guint a_nb_indent)
                  *before outputing it value
                  */
                 cr_utils_dump_n_chars2 (' ', str, indent);
-                tmp_str = (gchar *) num_prop_code_to_string ((CRNumProp)i);
+                tmp_str = (gchar *) num_prop_code_to_string ((enum CRNumProp)i);
                 if (tmp_str) {
                         g_string_append_printf (str, "%s: ", tmp_str);
                 } else {
@@ -2687,7 +2690,7 @@ cr_style_to_string (CRStyle * a_this, GString ** a_str, guint a_nb_indent)
         }
         /*loop over the rgb_props and to_string() them all */
         for (i = RGB_PROP_BORDER_TOP_COLOR; i < NB_RGB_PROPS; i++) {
-                tmp_str = (gchar *) rgb_prop_code_to_string ((CRRgbProp)i);
+                tmp_str = (gchar *) rgb_prop_code_to_string ((enum CRRgbProp)i);
                 cr_utils_dump_n_chars2 (' ', str, indent);
                 if (tmp_str) {
                         g_string_append_printf (str, "%s: ", tmp_str);
@@ -2703,7 +2706,7 @@ cr_style_to_string (CRStyle * a_this, GString ** a_str, guint a_nb_indent)
         /*loop over the border_style_props and to_string() them */
         for (i = BORDER_STYLE_PROP_TOP; i < NB_BORDER_STYLE_PROPS; i++) {
                 tmp_str = (gchar *) 
-                                   border_style_prop_code_to_string ((CRBorderStyleProp)i);
+                                   border_style_prop_code_to_string ((enum CRBorderStyleProp)i);
                 cr_utils_dump_n_chars2 (' ', str, indent);
                 if (tmp_str) {
                         g_string_append_printf (str, "%s: ", tmp_str);