summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFran├žois Revel <mmu_man@netsurf-browser.org>2012-04-06 23:50:20 (GMT)
committer Fran├žois Revel <mmu_man@netsurf-browser.org>2012-04-06 23:50:20 (GMT)
commiteaeda64620973d5400bdead1751423bc20e574e8 (patch)
tree244039bc7b6faef92bd0854d5cbb8a5bee7701dd
parent845aad798bc9e1bae6b394e283514851a38b132a (diff)
downloadlibcss-eaeda64620973d5400bdead1751423bc20e574e8.tar.gz
libcss-eaeda64620973d5400bdead1751423bc20e574e8.tar.bz2
Fix debug build (warnings about comparing different enums).
svn path=/trunk/libcss/; revision=13810
-rw-r--r--src/parse/important.c68
-rw-r--r--src/select/properties/helpers.c10
2 files changed, 42 insertions, 36 deletions
diff --git a/src/parse/important.c b/src/parse/important.c
index 8ed51d9..337e8bf 100644
--- a/src/parse/important.c
+++ b/src/parse/important.c
@@ -100,10 +100,10 @@ void css__make_style_important(css_style *style)
case CSS_PROP_BORDER_LEFT_COLOR:
case CSS_PROP_BACKGROUND_COLOR:
case CSS_PROP_COLUMN_RULE_COLOR:
- assert(BACKGROUND_COLOR_SET ==
- BORDER_COLOR_SET);
- assert(BACKGROUND_COLOR_SET ==
- COLUMN_RULE_COLOR_SET);
+ assert((uint32_t)BACKGROUND_COLOR_SET ==
+ (uint32_t)BORDER_COLOR_SET);
+ assert((uint32_t)BACKGROUND_COLOR_SET ==
+ (uint32_t)COLUMN_RULE_COLOR_SET);
if (value == BACKGROUND_COLOR_SET)
offset++; /* colour */
@@ -113,10 +113,12 @@ void css__make_style_important(css_style *style)
case CSS_PROP_CUE_AFTER:
case CSS_PROP_CUE_BEFORE:
case CSS_PROP_LIST_STYLE_IMAGE:
- assert(BACKGROUND_IMAGE_URI == CUE_AFTER_URI);
- assert(BACKGROUND_IMAGE_URI == CUE_BEFORE_URI);
- assert(BACKGROUND_IMAGE_URI ==
- LIST_STYLE_IMAGE_URI);
+ assert((uint32_t)BACKGROUND_IMAGE_URI ==
+ (uint32_t)CUE_AFTER_URI);
+ assert((uint32_t)BACKGROUND_IMAGE_URI ==
+ (uint32_t)CUE_BEFORE_URI);
+ assert((uint32_t)BACKGROUND_IMAGE_URI ==
+ (uint32_t)LIST_STYLE_IMAGE_URI);
if (value == BACKGROUND_IMAGE_URI)
offset++; /* string table entry */
@@ -141,9 +143,10 @@ void css__make_style_important(css_style *style)
case CSS_PROP_BORDER_LEFT_WIDTH:
case CSS_PROP_OUTLINE_WIDTH:
case CSS_PROP_COLUMN_RULE_WIDTH:
- assert(BORDER_WIDTH_SET == OUTLINE_WIDTH_SET);
- assert(BORDER_WIDTH_SET ==
- COLUMN_RULE_WIDTH_SET);
+ assert((uint32_t)BORDER_WIDTH_SET ==
+ (uint32_t)OUTLINE_WIDTH_SET);
+ assert((uint32_t)BORDER_WIDTH_SET ==
+ (uint32_t)COLUMN_RULE_WIDTH_SET);
if (value == BORDER_WIDTH_SET)
offset += 2; /* length + units */
@@ -161,14 +164,14 @@ void css__make_style_important(css_style *style)
case CSS_PROP_WIDTH:
case CSS_PROP_COLUMN_WIDTH:
case CSS_PROP_COLUMN_GAP:
- assert(BOTTOM_SET == LEFT_SET);
- assert(BOTTOM_SET == RIGHT_SET);
- assert(BOTTOM_SET == TOP_SET);
- assert(BOTTOM_SET == HEIGHT_SET);
- assert(BOTTOM_SET == MARGIN_SET);
- assert(BOTTOM_SET == WIDTH_SET);
- assert(BOTTOM_SET == COLUMN_WIDTH_SET);
- assert(BOTTOM_SET == COLUMN_GAP_SET);
+ assert((uint32_t)BOTTOM_SET == (uint32_t)LEFT_SET);
+ assert((uint32_t)BOTTOM_SET == (uint32_t)RIGHT_SET);
+ assert((uint32_t)BOTTOM_SET == (uint32_t)TOP_SET);
+ assert((uint32_t)BOTTOM_SET == (uint32_t)HEIGHT_SET);
+ assert((uint32_t)BOTTOM_SET == (uint32_t)MARGIN_SET);
+ assert((uint32_t)BOTTOM_SET == (uint32_t)WIDTH_SET);
+ assert((uint32_t)BOTTOM_SET == (uint32_t)COLUMN_WIDTH_SET);
+ assert((uint32_t)BOTTOM_SET == (uint32_t)COLUMN_GAP_SET);
if (value == BOTTOM_SET)
offset += 2; /* length + units */
@@ -230,8 +233,8 @@ void css__make_style_important(css_style *style)
case CSS_PROP_COUNTER_INCREMENT:
case CSS_PROP_COUNTER_RESET:
- assert(COUNTER_INCREMENT_NONE ==
- COUNTER_RESET_NONE);
+ assert((uint32_t)COUNTER_INCREMENT_NONE ==
+ (uint32_t)COUNTER_RESET_NONE);
while (value != COUNTER_INCREMENT_NONE) {
offset+=2; /* string + integer */
@@ -276,7 +279,8 @@ void css__make_style_important(css_style *style)
case CSS_PROP_LETTER_SPACING:
case CSS_PROP_WORD_SPACING:
- assert(LETTER_SPACING_SET == WORD_SPACING_SET);
+ assert((uint32_t)LETTER_SPACING_SET ==
+ (uint32_t)WORD_SPACING_SET);
if (value == LETTER_SPACING_SET)
offset += 2; /* length + units */
@@ -296,7 +300,7 @@ void css__make_style_important(css_style *style)
case CSS_PROP_MAX_HEIGHT:
case CSS_PROP_MAX_WIDTH:
- assert(MAX_HEIGHT_SET == MAX_WIDTH_SET);
+ assert((uint32_t)MAX_HEIGHT_SET == (uint32_t)MAX_WIDTH_SET);
if (value == MAX_HEIGHT_SET)
offset += 2; /* length + units */
@@ -311,11 +315,11 @@ void css__make_style_important(css_style *style)
case CSS_PROP_PAUSE_AFTER:
case CSS_PROP_PAUSE_BEFORE:
case CSS_PROP_TEXT_INDENT:
- assert(MIN_HEIGHT_SET == MIN_WIDTH_SET);
- assert(MIN_HEIGHT_SET == PADDING_SET);
- assert(MIN_HEIGHT_SET == PAUSE_AFTER_SET);
- assert(MIN_HEIGHT_SET == PAUSE_BEFORE_SET);
- assert(MIN_HEIGHT_SET == TEXT_INDENT_SET);
+ assert((uint32_t)MIN_HEIGHT_SET == (uint32_t)MIN_WIDTH_SET);
+ assert((uint32_t)MIN_HEIGHT_SET == (uint32_t)PADDING_SET);
+ assert((uint32_t)MIN_HEIGHT_SET == (uint32_t)PAUSE_AFTER_SET);
+ assert((uint32_t)MIN_HEIGHT_SET == (uint32_t)PAUSE_BEFORE_SET);
+ assert((uint32_t)MIN_HEIGHT_SET == (uint32_t)TEXT_INDENT_SET);
if (value == MIN_HEIGHT_SET)
offset += 2; /* length + units */
@@ -331,10 +335,10 @@ void css__make_style_important(css_style *style)
case CSS_PROP_RICHNESS:
case CSS_PROP_STRESS:
case CSS_PROP_WIDOWS:
- assert(ORPHANS_SET == PITCH_RANGE_SET);
- assert(ORPHANS_SET == RICHNESS_SET);
- assert(ORPHANS_SET == STRESS_SET);
- assert(ORPHANS_SET == WIDOWS_SET);
+ assert((uint32_t)ORPHANS_SET == (uint32_t)PITCH_RANGE_SET);
+ assert((uint32_t)ORPHANS_SET == (uint32_t)RICHNESS_SET);
+ assert((uint32_t)ORPHANS_SET == (uint32_t)STRESS_SET);
+ assert((uint32_t)ORPHANS_SET == (uint32_t)WIDOWS_SET);
if (value == ORPHANS_SET)
offset++; /* value */
diff --git a/src/select/properties/helpers.c b/src/select/properties/helpers.c
index 24e193d..125f41e 100644
--- a/src/select/properties/helpers.c
+++ b/src/select/properties/helpers.c
@@ -52,10 +52,12 @@ css_error css__cascade_bg_border_color(uint32_t opv, css_style *style,
uint16_t value = CSS_BACKGROUND_COLOR_INHERIT;
css_color color = 0;
- assert(CSS_BACKGROUND_COLOR_INHERIT == CSS_BORDER_COLOR_INHERIT);
- assert(CSS_BACKGROUND_COLOR_COLOR == CSS_BORDER_COLOR_COLOR);
- assert(CSS_BACKGROUND_COLOR_CURRENT_COLOR ==
- CSS_BORDER_COLOR_CURRENT_COLOR);
+ assert((uint16_t)CSS_BACKGROUND_COLOR_INHERIT ==
+ (uint16_t)CSS_BORDER_COLOR_INHERIT);
+ assert((uint16_t)CSS_BACKGROUND_COLOR_COLOR ==
+ (uint16_t)CSS_BORDER_COLOR_COLOR);
+ assert((uint16_t)CSS_BACKGROUND_COLOR_CURRENT_COLOR ==
+ (uint16_t)CSS_BORDER_COLOR_CURRENT_COLOR);
if (isInherit(opv) == false) {
switch (getValue(opv)) {