diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2014-03-03 23:07:41 +0100 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2014-03-03 23:07:41 +0100 |
commit | 0b04276e8e917bad961e1178a959483a7aeb5620 (patch) | |
tree | d2b68e59c08bee92b18ab02c8a541d791a29c711 | |
parent | 5b3ffbcdfb5750ffb191f2c9ad29113797ae5a9b (diff) |
fix clang warning
-rw-r--r-- | src/css.hh | 1 | ||||
-rw-r--r-- | src/cssparser.cc | 22 |
2 files changed, 13 insertions, 10 deletions
@@ -143,6 +143,7 @@ inline float CSS_LENGTH_VALUE (CssLength l) { } typedef enum { + CSS_PROPERTY_END = -1, // used as terminator in CssShorthandInfo CSS_PROPERTY_BACKGROUND_ATTACHMENT, CSS_PROPERTY_BACKGROUND_COLOR, CSS_PROPERTY_BACKGROUND_IMAGE, diff --git a/src/cssparser.cc b/src/cssparser.cc index fcff7688..c7a9c281 100644 --- a/src/cssparser.cc +++ b/src/cssparser.cc @@ -276,7 +276,8 @@ typedef struct { CSS_SHORTHAND_FONT, /* special, used for 'font' */ } type; const CssPropertyName *properties; /* CSS_SHORTHAND_MULTIPLE: - * must be terminated by -1 + * must be terminated by + * CSS_PROPERTY_END * CSS_SHORTHAND_DIRECTIONS: * must have length 4 * CSS_SHORTHAND_BORDERS: @@ -291,14 +292,14 @@ const CssPropertyName Css_background_properties[] = { CSS_PROPERTY_BACKGROUND_REPEAT, CSS_PROPERTY_BACKGROUND_ATTACHMENT, CSS_PROPERTY_BACKGROUND_POSITION, - (CssPropertyName) - 1 + CSS_PROPERTY_END }; const CssPropertyName Css_border_bottom_properties[] = { CSS_PROPERTY_BORDER_BOTTOM_WIDTH, CSS_PROPERTY_BORDER_BOTTOM_STYLE, CSS_PROPERTY_BORDER_BOTTOM_COLOR, - (CssPropertyName) - 1 + CSS_PROPERTY_END }; const CssPropertyName Css_border_color_properties[4] = { @@ -312,14 +313,14 @@ const CssPropertyName Css_border_left_properties[] = { CSS_PROPERTY_BORDER_LEFT_WIDTH, CSS_PROPERTY_BORDER_LEFT_STYLE, CSS_PROPERTY_BORDER_LEFT_COLOR, - (CssPropertyName) - 1 + CSS_PROPERTY_END }; const CssPropertyName Css_border_right_properties[] = { CSS_PROPERTY_BORDER_RIGHT_WIDTH, CSS_PROPERTY_BORDER_RIGHT_STYLE, CSS_PROPERTY_BORDER_RIGHT_COLOR, - (CssPropertyName) - 1 + CSS_PROPERTY_END }; const CssPropertyName Css_border_style_properties[] = { @@ -333,7 +334,7 @@ const CssPropertyName Css_border_top_properties[] = { CSS_PROPERTY_BORDER_TOP_WIDTH, CSS_PROPERTY_BORDER_TOP_STYLE, CSS_PROPERTY_BORDER_TOP_COLOR, - (CssPropertyName) - 1 + CSS_PROPERTY_END }; const CssPropertyName Css_border_width_properties[] = { @@ -347,7 +348,7 @@ const CssPropertyName Css_list_style_properties[] = { CSS_PROPERTY_LIST_STYLE_TYPE, CSS_PROPERTY_LIST_STYLE_POSITION, CSS_PROPERTY_LIST_STYLE_IMAGE, - (CssPropertyName) - 1 + CSS_PROPERTY_END }; const CssPropertyName Css_margin_properties[] = { @@ -361,7 +362,7 @@ const CssPropertyName Css_outline_properties[] = { CSS_PROPERTY_OUTLINE_COLOR, CSS_PROPERTY_OUTLINE_STYLE, CSS_PROPERTY_OUTLINE_WIDTH, - (CssPropertyName) - 1 + CSS_PROPERTY_END }; const CssPropertyName Css_padding_properties[] = { @@ -392,7 +393,7 @@ const CssPropertyName Css_font_properties[] = { CSS_PROPERTY_FONT_VARIANT, CSS_PROPERTY_FONT_WEIGHT, CSS_PROPERTY_FONT_FAMILY, - (CssPropertyName) - 1 + CSS_PROPERTY_END }; static const CssShorthandInfo Css_shorthand_info[] = { @@ -1248,7 +1249,8 @@ void CssParser::parseDeclaration(CssPropertyList *props, do { for (found = false, i = 0; !found && - Css_shorthand_info[sh_index].properties[i] != -1; + Css_shorthand_info[sh_index].properties[i] != + CSS_PROPERTY_END; i++) if (tokenMatchesProperty(Css_shorthand_info[sh_index]. properties[i], &type)) { |