From da47188a8369bb79884d37f3222c8bf8fabb7ea4 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Tue, 26 Jul 2011 21:20:11 +0000 Subject: Fix build with GCC 4.6 svn path=/trunk/libcss/; revision=12627 --- src/lex/lex.c | 4 ++ src/parse/properties/font.c | 9 ---- src/select/properties/Makefile | 2 +- src/select/properties/azimuth.c | 3 -- src/select/properties/elevation.c | 3 -- src/select/properties/page_break_inside.c | 3 -- src/select/properties/pitch.c | 3 -- src/select/properties/play_during.c | 3 -- src/select/properties/speach_rate.c | 77 ------------------------------- src/select/properties/speak.c | 3 -- src/select/properties/speak_header.c | 3 -- src/select/properties/speak_numeral.c | 3 -- src/select/properties/speak_punctuation.c | 3 -- src/select/properties/speech_rate.c | 74 +++++++++++++++++++++++++++++ src/select/properties/volume.c | 5 -- 15 files changed, 79 insertions(+), 119 deletions(-) delete mode 100644 src/select/properties/speach_rate.c create mode 100644 src/select/properties/speech_rate.c diff --git a/src/lex/lex.c b/src/lex/lex.c index 7b258bd..aba86c5 100644 --- a/src/lex/lex.c +++ b/src/lex/lex.c @@ -378,7 +378,11 @@ css_error emitToken(css_lexer *lexer, css_token_type type, error = parserutils_inputstream_peek(lexer->input, 0, &data, &clen); +#ifndef NDEBUG assert(type == CSS_TOKEN_EOF || error == PARSERUTILS_OK); +#else + (void) error; +#endif t->data.data = (type == CSS_TOKEN_EOF) ? NULL : (uint8_t *) data; } diff --git a/src/parse/properties/font.c b/src/parse/properties/font.c index c08d6e6..8d66aec 100644 --- a/src/parse/properties/font.c +++ b/src/parse/properties/font.c @@ -195,9 +195,7 @@ css_error css__parse_font(css_language *c, bool style = true; bool variant = true; bool weight = true; - bool size = true; bool line_height = true; - bool family = true; css_style *style_style; css_style *variant_style; css_style *weight_style; @@ -350,7 +348,6 @@ css_error css__parse_font(css_language *c, error = css__parse_font_size(c, vector, ctx, size_style); if (error != CSS_OK) goto css__parse_font_cleanup; - size = false; consumeWhitespace(vector, ctx); @@ -388,12 +385,6 @@ css_error css__parse_font(css_language *c, error = css__parse_font_family(c, vector, ctx, family_style); if (error != CSS_OK) goto css__parse_font_cleanup; - family = false; - - /* Must have size and family */ - assert(size != true); - assert(family != true); - /* defaults */ if (style) { diff --git a/src/select/properties/Makefile b/src/select/properties/Makefile index 7f48fab..b26939c 100644 --- a/src/select/properties/Makefile +++ b/src/select/properties/Makefile @@ -78,7 +78,7 @@ position.c \ quotes.c \ richness.c \ right.c \ -speach_rate.c \ +speech_rate.c \ speak.c \ speak_header.c \ speak_numeral.c \ diff --git a/src/select/properties/azimuth.c b/src/select/properties/azimuth.c index cb5fc61..275ae2f 100644 --- a/src/select/properties/azimuth.c +++ b/src/select/properties/azimuth.c @@ -15,15 +15,12 @@ css_error css__cascade_azimuth(uint32_t opv, css_style *style, css_select_state *state) { - uint16_t value = 0; css_fixed val = 0; uint32_t unit = UNIT_DEG; if (isInherit(opv) == false) { switch (getValue(opv) & ~AZIMUTH_BEHIND) { case AZIMUTH_ANGLE: - value = 0; - val = *((css_fixed *) style->bytecode); advance_bytecode(style, sizeof(val)); unit = *((uint32_t *) style->bytecode); diff --git a/src/select/properties/elevation.c b/src/select/properties/elevation.c index 12b8e22..d893748 100644 --- a/src/select/properties/elevation.c +++ b/src/select/properties/elevation.c @@ -17,15 +17,12 @@ css_error css__cascade_elevation(uint32_t opv, css_style *style, css_select_state *state) { - uint16_t value = 0; css_fixed val = 0; uint32_t unit = UNIT_DEG; if (isInherit(opv) == false) { switch (getValue(opv)) { case ELEVATION_ANGLE: - value = 0; - val = *((css_fixed *) style->bytecode); advance_bytecode(style, sizeof(val)); diff --git a/src/select/properties/page_break_inside.c b/src/select/properties/page_break_inside.c index b3d5114..2e27298 100644 --- a/src/select/properties/page_break_inside.c +++ b/src/select/properties/page_break_inside.c @@ -17,8 +17,6 @@ css_error css__cascade_page_break_inside(uint32_t opv, css_style *style, css_select_state *state) { - uint16_t value = 0; - UNUSED(style); if (isInherit(opv) == false) { @@ -26,7 +24,6 @@ css_error css__cascade_page_break_inside(uint32_t opv, css_style *style, case PAGE_BREAK_INSIDE_AUTO: case PAGE_BREAK_INSIDE_AVOID: /** \todo convert to public values */ - value = 0; break; } } diff --git a/src/select/properties/pitch.c b/src/select/properties/pitch.c index a8c65d1..b6dc649 100644 --- a/src/select/properties/pitch.c +++ b/src/select/properties/pitch.c @@ -17,15 +17,12 @@ css_error css__cascade_pitch(uint32_t opv, css_style *style, css_select_state *state) { - uint16_t value = 0; css_fixed freq = 0; uint32_t unit = UNIT_HZ; if (isInherit(opv) == false) { switch (getValue(opv)) { case PITCH_FREQUENCY: - value = 0; - freq = *((css_fixed *) style->bytecode); advance_bytecode(style, sizeof(freq)); unit = *((uint32_t *) style->bytecode); diff --git a/src/select/properties/play_during.c b/src/select/properties/play_during.c index cb1de3c..0210567 100644 --- a/src/select/properties/play_during.c +++ b/src/select/properties/play_during.c @@ -17,14 +17,11 @@ css_error css__cascade_play_during(uint32_t opv, css_style *style, css_select_state *state) { - uint16_t value = 0; lwc_string *uri = NULL; if (isInherit(opv) == false) { switch (getValue(opv)) { case PLAY_DURING_URI: - value = 0; - css__stylesheet_string_get(style->sheet, *((css_code_t *) style->bytecode), &uri); advance_bytecode(style, sizeof(css_code_t)); break; diff --git a/src/select/properties/speach_rate.c b/src/select/properties/speach_rate.c deleted file mode 100644 index 290ce48..0000000 --- a/src/select/properties/speach_rate.c +++ /dev/null @@ -1,77 +0,0 @@ -/* - * This file is part of LibCSS - * Licensed under the MIT License, - * http://www.opensource.org/licenses/mit-license.php - * Copyright 2009 John-Mark Bell - */ - -#include "bytecode/bytecode.h" -#include "bytecode/opcodes.h" -#include "select/propset.h" -#include "select/propget.h" -#include "utils/utils.h" - -#include "select/properties/properties.h" -#include "select/properties/helpers.h" - -css_error css__cascade_speech_rate(uint32_t opv, css_style *style, - css_select_state *state) -{ - uint16_t value = 0; - css_fixed rate = 0; - - if (isInherit(opv) == false) { - switch (getValue(opv)) { - case SPEECH_RATE_SET: - value = 0; - - rate = *((css_fixed *) style->bytecode); - advance_bytecode(style, sizeof(rate)); - break; - case SPEECH_RATE_X_SLOW: - case SPEECH_RATE_SLOW: - case SPEECH_RATE_MEDIUM: - case SPEECH_RATE_FAST: - case SPEECH_RATE_X_FAST: - case SPEECH_RATE_FASTER: - case SPEECH_RATE_SLOWER: - /** \todo convert to public values */ - break; - } - } - - if (css__outranks_existing(getOpcode(opv), isImportant(opv), state, - isInherit(opv))) { - /** \todo speech-rate */ - } - - return CSS_OK; -} - -css_error css__set_speech_rate_from_hint(const css_hint *hint, - css_computed_style *style) -{ - UNUSED(hint); - UNUSED(style); - - return CSS_OK; -} - -css_error css__initial_speech_rate(css_select_state *state) -{ - UNUSED(state); - - return CSS_OK; -} - -css_error css__compose_speech_rate(const css_computed_style *parent, - const css_computed_style *child, - css_computed_style *result) -{ - UNUSED(parent); - UNUSED(child); - UNUSED(result); - - return CSS_OK; -} - diff --git a/src/select/properties/speak.c b/src/select/properties/speak.c index 2b7d18f..0b52e62 100644 --- a/src/select/properties/speak.c +++ b/src/select/properties/speak.c @@ -17,8 +17,6 @@ css_error css__cascade_speak(uint32_t opv, css_style *style, css_select_state *state) { - uint16_t value = 0; - UNUSED(style); if (isInherit(opv) == false) { @@ -27,7 +25,6 @@ css_error css__cascade_speak(uint32_t opv, css_style *style, case SPEAK_NONE: case SPEAK_SPELL_OUT: /** \todo convert to public values */ - value = 0; break; } } diff --git a/src/select/properties/speak_header.c b/src/select/properties/speak_header.c index 50dbb41..6fc37d5 100644 --- a/src/select/properties/speak_header.c +++ b/src/select/properties/speak_header.c @@ -17,8 +17,6 @@ css_error css__cascade_speak_header(uint32_t opv, css_style *style, css_select_state *state) { - uint16_t value = 0; - UNUSED(style); if (isInherit(opv) == false) { @@ -26,7 +24,6 @@ css_error css__cascade_speak_header(uint32_t opv, css_style *style, case SPEAK_HEADER_ONCE: case SPEAK_HEADER_ALWAYS: /** \todo convert to public values */ - value = 0; break; } } diff --git a/src/select/properties/speak_numeral.c b/src/select/properties/speak_numeral.c index d2ff01d..1e74abd 100644 --- a/src/select/properties/speak_numeral.c +++ b/src/select/properties/speak_numeral.c @@ -17,8 +17,6 @@ css_error css__cascade_speak_numeral(uint32_t opv, css_style *style, css_select_state *state) { - uint16_t value = 0; - UNUSED(style); if (isInherit(opv) == false) { @@ -26,7 +24,6 @@ css_error css__cascade_speak_numeral(uint32_t opv, css_style *style, case SPEAK_NUMERAL_DIGITS: case SPEAK_NUMERAL_CONTINUOUS: /** \todo convert to public values */ - value = 0; break; } } diff --git a/src/select/properties/speak_punctuation.c b/src/select/properties/speak_punctuation.c index 928f425..9898b7c 100644 --- a/src/select/properties/speak_punctuation.c +++ b/src/select/properties/speak_punctuation.c @@ -17,8 +17,6 @@ css_error css__cascade_speak_punctuation( uint32_t opv, css_style *style, css_select_state *state) { - uint16_t value = 0; - UNUSED(style); if (isInherit(opv) == false) { @@ -26,7 +24,6 @@ css_error css__cascade_speak_punctuation( case SPEAK_PUNCTUATION_CODE: case SPEAK_PUNCTUATION_NONE: /** \todo convert to public values */ - value = 0; break; } } diff --git a/src/select/properties/speech_rate.c b/src/select/properties/speech_rate.c new file mode 100644 index 0000000..c974997 --- /dev/null +++ b/src/select/properties/speech_rate.c @@ -0,0 +1,74 @@ +/* + * This file is part of LibCSS + * Licensed under the MIT License, + * http://www.opensource.org/licenses/mit-license.php + * Copyright 2009 John-Mark Bell + */ + +#include "bytecode/bytecode.h" +#include "bytecode/opcodes.h" +#include "select/propset.h" +#include "select/propget.h" +#include "utils/utils.h" + +#include "select/properties/properties.h" +#include "select/properties/helpers.h" + +css_error css__cascade_speech_rate(uint32_t opv, css_style *style, + css_select_state *state) +{ + css_fixed rate = 0; + + if (isInherit(opv) == false) { + switch (getValue(opv)) { + case SPEECH_RATE_SET: + rate = *((css_fixed *) style->bytecode); + advance_bytecode(style, sizeof(rate)); + break; + case SPEECH_RATE_X_SLOW: + case SPEECH_RATE_SLOW: + case SPEECH_RATE_MEDIUM: + case SPEECH_RATE_FAST: + case SPEECH_RATE_X_FAST: + case SPEECH_RATE_FASTER: + case SPEECH_RATE_SLOWER: + /** \todo convert to public values */ + break; + } + } + + if (css__outranks_existing(getOpcode(opv), isImportant(opv), state, + isInherit(opv))) { + /** \todo speech-rate */ + } + + return CSS_OK; +} + +css_error css__set_speech_rate_from_hint(const css_hint *hint, + css_computed_style *style) +{ + UNUSED(hint); + UNUSED(style); + + return CSS_OK; +} + +css_error css__initial_speech_rate(css_select_state *state) +{ + UNUSED(state); + + return CSS_OK; +} + +css_error css__compose_speech_rate(const css_computed_style *parent, + const css_computed_style *child, + css_computed_style *result) +{ + UNUSED(parent); + UNUSED(child); + UNUSED(result); + + return CSS_OK; +} + diff --git a/src/select/properties/volume.c b/src/select/properties/volume.c index 16f6560..ca0e9dd 100644 --- a/src/select/properties/volume.c +++ b/src/select/properties/volume.c @@ -17,21 +17,16 @@ css_error css__cascade_volume(uint32_t opv, css_style *style, css_select_state *state) { - uint16_t value = 0; css_fixed val = 0; uint32_t unit = UNIT_PCT; if (isInherit(opv) == false) { switch (getValue(opv)) { case VOLUME_NUMBER: - value = 0; - val = *((css_fixed *) style->bytecode); advance_bytecode(style, sizeof(val)); break; case VOLUME_DIMENSION: - value = 0; - val = *((css_fixed *) style->bytecode); advance_bytecode(style, sizeof(val)); unit = *((uint32_t *) style->bytecode); -- cgit v1.2.3