diff options
author | Michael Drake <michael.drake@codethink.co.uk> | 2017-09-04 14:56:51 +0100 |
---|---|---|
committer | Michael Drake <michael.drake@codethink.co.uk> | 2017-09-04 14:56:51 +0100 |
commit | 2fcb157f28b152ba32e89baddbd811b0d6e76b79 (patch) | |
tree | 30f96332ac7993ff4acf88b4892f922a80ddd393 /src/parse/properties | |
parent | 2fc4177a09cc6fc6706f84dbe157077a41b6e22b (diff) | |
download | libcss-2fcb157f28b152ba32e89baddbd811b0d6e76b79.tar.gz libcss-2fcb157f28b152ba32e89baddbd811b0d6e76b79.tar.bz2 |
Strip trailing whitespace.
Diffstat (limited to 'src/parse/properties')
31 files changed, 403 insertions, 403 deletions
diff --git a/src/parse/properties/azimuth.c b/src/parse/properties/azimuth.c index 7df7298..f54189b 100644 --- a/src/parse/properties/azimuth.c +++ b/src/parse/properties/azimuth.c @@ -27,8 +27,8 @@ * Post condition: \a *ctx is updated with the next token to process * If the input is invalid, then \a *ctx remains unchanged. */ -css_error css__parse_azimuth(css_language *c, - const parserutils_vector *vector, int *ctx, +css_error css__parse_azimuth(css_language *c, + const parserutils_vector *vector, int *ctx, css_style *result) { int orig_ctx = *ctx; @@ -40,10 +40,10 @@ css_error css__parse_azimuth(css_language *c, uint32_t unit = 0; bool match; - /* angle | [ IDENT(left-side, far-left, left, center-left, center, - * center-right, right, far-right, right-side) || - * IDENT(behind) - * ] + /* angle | [ IDENT(left-side, far-left, left, center-left, center, + * center-right, right, far-right, right-side) || + * IDENT(behind) + * ] * | IDENT(leftwards, rightwards, inherit) */ token = parserutils_vector_peek(vector, *ctx); @@ -71,7 +71,7 @@ css_error css__parse_azimuth(css_language *c, parserutils_vector_iterate(vector, ctx); /* Now, we may have one of the other keywords or behind, - * potentially followed by behind or other keyword, + * potentially followed by behind or other keyword, * respectively */ if ((lwc_string_caseless_isequal( token->idata, c->strings[LEFT_SIDE], @@ -184,7 +184,7 @@ css_error css__parse_azimuth(css_language *c, value |= AZIMUTH_CENTER; } } else { - error = css__parse_unit_specifier(c, vector, ctx, UNIT_DEG, + error = css__parse_unit_specifier(c, vector, ctx, UNIT_DEG, &length, &unit); if (error != CSS_OK) { *ctx = orig_ctx; diff --git a/src/parse/properties/background.c b/src/parse/properties/background.c index cae069c..01b995e 100644 --- a/src/parse/properties/background.c +++ b/src/parse/properties/background.c @@ -49,36 +49,36 @@ css_error css__parse_background(css_language *c, /* Firstly, handle inherit */ token = parserutils_vector_peek(vector, *ctx); - if (token == NULL) + if (token == NULL) return CSS_INVALID; - + if (is_css_inherit(c, token)) { error = css_stylesheet_style_inherit(result, CSS_PROP_BACKGROUND_ATTACHMENT); - if (error != CSS_OK) + if (error != CSS_OK) return error; error = css_stylesheet_style_inherit(result, CSS_PROP_BACKGROUND_COLOR); - if (error != CSS_OK) - return error; + if (error != CSS_OK) + return error; error = css_stylesheet_style_inherit(result, CSS_PROP_BACKGROUND_IMAGE); - if (error != CSS_OK) + if (error != CSS_OK) return error; error = css_stylesheet_style_inherit(result, CSS_PROP_BACKGROUND_POSITION); - if (error != CSS_OK) + if (error != CSS_OK) return error; error = css_stylesheet_style_inherit(result, CSS_PROP_BACKGROUND_REPEAT); - if (error == CSS_OK) + if (error == CSS_OK) parserutils_vector_iterate(vector, ctx); return error; - } + } /* allocate styles */ error = css__stylesheet_style_create(c->sheet, &attachment_style); - if (error != CSS_OK) + if (error != CSS_OK) return error; error = css__stylesheet_style_create(c->sheet, &color_style); @@ -124,24 +124,24 @@ css_error css__parse_background(css_language *c, /* Try each property parser in turn, but only if we * haven't already got a value for this property. */ - if ((attachment) && - (error = css__parse_background_attachment(c, vector, ctx, + if ((attachment) && + (error = css__parse_background_attachment(c, vector, ctx, attachment_style)) == CSS_OK) { attachment = false; - } else if ((color) && + } else if ((color) && (error = css__parse_background_color(c, vector, ctx, color_style)) == CSS_OK) { color = false; - } else if ((image) && + } else if ((image) && (error = css__parse_background_image(c, vector, ctx, image_style)) == CSS_OK) { image = false; } else if ((position) && - (error = css__parse_background_position(c, vector, ctx, + (error = css__parse_background_position(c, vector, ctx, position_style)) == CSS_OK) { position = false; } else if ((repeat) && - (error = css__parse_background_repeat(c, vector, ctx, + (error = css__parse_background_repeat(c, vector, ctx, repeat_style)) == CSS_OK) { repeat = false; } @@ -157,23 +157,23 @@ css_error css__parse_background(css_language *c, } while (*ctx != prev_ctx && token != NULL); if (attachment) { - error = css__stylesheet_style_appendOPV(attachment_style, - CSS_PROP_BACKGROUND_ATTACHMENT, 0, + error = css__stylesheet_style_appendOPV(attachment_style, + CSS_PROP_BACKGROUND_ATTACHMENT, 0, BACKGROUND_ATTACHMENT_SCROLL); if (error != CSS_OK) goto css__parse_background_cleanup; } if (color) { - error = css__stylesheet_style_appendOPV(color_style, - CSS_PROP_BACKGROUND_COLOR, 0, + error = css__stylesheet_style_appendOPV(color_style, + CSS_PROP_BACKGROUND_COLOR, 0, BACKGROUND_COLOR_TRANSPARENT); if (error != CSS_OK) goto css__parse_background_cleanup; } if (image) { - error = css__stylesheet_style_appendOPV(image_style, + error = css__stylesheet_style_appendOPV(image_style, CSS_PROP_BACKGROUND_IMAGE, 0, BACKGROUND_IMAGE_NONE); if (error != CSS_OK) @@ -190,7 +190,7 @@ css_error css__parse_background(css_language *c, } if (repeat) { - error = css__stylesheet_style_appendOPV(repeat_style, + error = css__stylesheet_style_appendOPV(repeat_style, CSS_PROP_BACKGROUND_REPEAT, 0, BACKGROUND_REPEAT_REPEAT); if (error != CSS_OK) diff --git a/src/parse/properties/background_position.c b/src/parse/properties/background_position.c index d4b31dc..6932c05 100644 --- a/src/parse/properties/background_position.c +++ b/src/parse/properties/background_position.c @@ -27,8 +27,8 @@ * Post condition: \a *ctx is updated with the next token to process * If the input is invalid, then \a *ctx remains unchanged. */ -css_error css__parse_background_position(css_language *c, - const parserutils_vector *vector, int *ctx, +css_error css__parse_background_position(css_language *c, + const parserutils_vector *vector, int *ctx, css_style *result) { int orig_ctx = *ctx; @@ -65,35 +65,35 @@ css_error css__parse_background_position(css_language *c, if (token->type == CSS_TOKEN_IDENT) { if ((lwc_string_caseless_isequal( token->idata, c->strings[LEFT], - &match) == lwc_error_ok && + &match) == lwc_error_ok && match)) { - value[i] = + value[i] = BACKGROUND_POSITION_HORZ_LEFT; } else if ((lwc_string_caseless_isequal( token->idata, c->strings[RIGHT], - &match) == lwc_error_ok && + &match) == lwc_error_ok && match)) { - value[i] = + value[i] = BACKGROUND_POSITION_HORZ_RIGHT; } else if ((lwc_string_caseless_isequal( token->idata, c->strings[TOP], - &match) == lwc_error_ok && + &match) == lwc_error_ok && match)) { value[i] = BACKGROUND_POSITION_VERT_TOP; } else if ((lwc_string_caseless_isequal( - token->idata, + token->idata, c->strings[BOTTOM], - &match) == lwc_error_ok && + &match) == lwc_error_ok && match)) { - value[i] = + value[i] = BACKGROUND_POSITION_VERT_BOTTOM; } else if ((lwc_string_caseless_isequal( - token->idata, + token->idata, c->strings[CENTER], - &match) == lwc_error_ok && + &match) == lwc_error_ok && match)) { /* We'll fix this up later */ - value[i] = + value[i] = BACKGROUND_POSITION_VERT_CENTER; } else if (i == 1) { /* Second pass, so ignore this one */ @@ -108,15 +108,15 @@ css_error css__parse_background_position(css_language *c, } else if (token->type == CSS_TOKEN_DIMENSION || token->type == CSS_TOKEN_NUMBER || token->type == CSS_TOKEN_PERCENTAGE) { - error = css__parse_unit_specifier(c, vector, ctx, + error = css__parse_unit_specifier(c, vector, ctx, UNIT_PX, &length[i], &unit[i]); if (error != CSS_OK) { *ctx = orig_ctx; return error; } - if (unit[i] & UNIT_ANGLE || - unit[i] & UNIT_TIME || + if (unit[i] & UNIT_ANGLE || + unit[i] & UNIT_TIME || unit[i] & UNIT_FREQ) { *ctx = orig_ctx; return CSS_INVALID; @@ -163,7 +163,7 @@ css_error css__parse_background_position(css_language *c, value[1] != BACKGROUND_POSITION_VERT_SET) { /* Two keywords. Verify the axes differ */ if (((value[0] & 0xf) != 0 && (value[1] & 0xf) != 0) || - ((value[0] & 0xf0) != 0 && + ((value[0] & 0xf0) != 0 && (value[1] & 0xf0) != 0)) { *ctx = orig_ctx; return CSS_INVALID; @@ -175,7 +175,7 @@ css_error css__parse_background_position(css_language *c, /* Verify the axes differ */ if (((value[0] & 0xf) != 0 && (value[1] & 0xf) != 0) || - ((value[0] & 0xf0) != 0 && + ((value[0] & 0xf0) != 0 && (value[1] & 0xf0) != 0)) { *ctx = orig_ctx; return CSS_INVALID; @@ -183,9 +183,9 @@ css_error css__parse_background_position(css_language *c, } } - error = css__stylesheet_style_appendOPV(result, - CSS_PROP_BACKGROUND_POSITION, - flags, + error = css__stylesheet_style_appendOPV(result, + CSS_PROP_BACKGROUND_POSITION, + flags, value[0] | value[1]); if (error != CSS_OK) { *ctx = orig_ctx; diff --git a/src/parse/properties/border.c b/src/parse/properties/border.c index 98ad08b..26cdbcd 100644 --- a/src/parse/properties/border.c +++ b/src/parse/properties/border.c @@ -56,9 +56,9 @@ css_error css__parse_border(css_language *c, *ctx = orig_ctx; error = css__parse_border_side(c, vector, ctx, result, BORDER_SIDE_LEFT); - if (error != CSS_OK) + if (error != CSS_OK) *ctx = orig_ctx; - + return error; - + } diff --git a/src/parse/properties/border_color.c b/src/parse/properties/border_color.c index 7495ffc..28d30b7 100644 --- a/src/parse/properties/border_color.c +++ b/src/parse/properties/border_color.c @@ -41,28 +41,28 @@ css_error css__parse_border_color(css_language *c, /* Firstly, handle inherit */ token = parserutils_vector_peek(vector, *ctx); - if (token == NULL) + if (token == NULL) return CSS_INVALID; - + if (is_css_inherit(c, token)) { error = css_stylesheet_style_inherit(result, CSS_PROP_BORDER_TOP_COLOR); - if (error != CSS_OK) + if (error != CSS_OK) return error; error = css_stylesheet_style_inherit(result, CSS_PROP_BORDER_RIGHT_COLOR); - if (error != CSS_OK) - return error; + if (error != CSS_OK) + return error; error = css_stylesheet_style_inherit(result, CSS_PROP_BORDER_BOTTOM_COLOR); - if (error != CSS_OK) + if (error != CSS_OK) return error; error = css_stylesheet_style_inherit(result, CSS_PROP_BORDER_LEFT_COLOR); - if (error == CSS_OK) + if (error == CSS_OK) parserutils_vector_iterate(vector, ctx); return error; - } + } /* Attempt to parse up to 4 colours */ do { diff --git a/src/parse/properties/border_spacing.c b/src/parse/properties/border_spacing.c index e9949fd..2322a5a 100644 --- a/src/parse/properties/border_spacing.c +++ b/src/parse/properties/border_spacing.c @@ -27,8 +27,8 @@ * Post condition: \a *ctx is updated with the next token to process * If the input is invalid, then \a *ctx remains unchanged. */ -css_error css__parse_border_spacing(css_language *c, - const parserutils_vector *vector, int *ctx, +css_error css__parse_border_spacing(css_language *c, + const parserutils_vector *vector, int *ctx, css_style *result) { int orig_ctx = *ctx; @@ -65,7 +65,7 @@ css_error css__parse_border_spacing(css_language *c, return error; } - if (unit[0] & UNIT_ANGLE || unit[0] & UNIT_TIME || + if (unit[0] & UNIT_ANGLE || unit[0] & UNIT_TIME || unit[0] & UNIT_FREQ || unit[0] & UNIT_PCT) { *ctx = orig_ctx; return CSS_INVALID; @@ -78,16 +78,16 @@ css_error css__parse_border_spacing(css_language *c, token = parserutils_vector_peek(vector, *ctx); if (token != NULL) { /* Attempt second length, ignoring errors. - * The core !important parser will ensure + * The core !important parser will ensure * any remaining junk is thrown out. * Ctx will be preserved on error, as usual */ error = css__parse_unit_specifier(c, vector, ctx, UNIT_PX, &length[1], &unit[1]); if (error == CSS_OK) { - if (unit[1] & UNIT_ANGLE || + if (unit[1] & UNIT_ANGLE || unit[1] & UNIT_TIME || - unit[1] & UNIT_FREQ || + unit[1] & UNIT_FREQ || unit[1] & UNIT_PCT) { *ctx = orig_ctx; return CSS_INVALID; @@ -119,11 +119,11 @@ css_error css__parse_border_spacing(css_language *c, return error; } - error = css__stylesheet_style_vappend(result, - 4, - length[0], - unit[0], - length[1], + error = css__stylesheet_style_vappend(result, + 4, + length[0], + unit[0], + length[1], unit[1]); } diff --git a/src/parse/properties/border_style.c b/src/parse/properties/border_style.c index d4a4d12..a0d264d 100644 --- a/src/parse/properties/border_style.c +++ b/src/parse/properties/border_style.c @@ -41,28 +41,28 @@ css_error css__parse_border_style(css_language *c, /* Firstly, handle inherit */ token = parserutils_vector_peek(vector, *ctx); - if (token == NULL) + if (token == NULL) return CSS_INVALID; - + if (is_css_inherit(c, token)) { error = css_stylesheet_style_inherit(result, CSS_PROP_BORDER_TOP_STYLE); - if (error != CSS_OK) + if (error != CSS_OK) return error; error = css_stylesheet_style_inherit(result, CSS_PROP_BORDER_RIGHT_STYLE); - if (error != CSS_OK) - return error; + if (error != CSS_OK) + return error; error = css_stylesheet_style_inherit(result, CSS_PROP_BORDER_BOTTOM_STYLE); - if (error != CSS_OK) + if (error != CSS_OK) return error; error = css_stylesheet_style_inherit(result, CSS_PROP_BORDER_LEFT_STYLE); - if (error == CSS_OK) + if (error == CSS_OK) parserutils_vector_iterate(vector, ctx); return error; - } + } /* Attempt to parse up to 4 styles */ do { @@ -73,7 +73,7 @@ css_error css__parse_border_style(css_language *c, return CSS_INVALID; } - if (token->type != CSS_TOKEN_IDENT) + if (token->type != CSS_TOKEN_IDENT) break; if ((lwc_string_caseless_isequal(token->idata, c->strings[NONE], &match) == lwc_error_ok && match)) { @@ -101,9 +101,9 @@ css_error css__parse_border_style(css_language *c, } side_count++; - + parserutils_vector_iterate(vector, ctx); - + consumeWhitespace(vector, ctx); token = parserutils_vector_peek(vector, *ctx); @@ -113,7 +113,7 @@ css_error css__parse_border_style(css_language *c, #define SIDE_APPEND(OP,NUM) \ error = css__stylesheet_style_appendOPV(result, (OP), 0, side_val[(NUM)]); \ if (error != CSS_OK) \ - break + break switch (side_count) { case 1: diff --git a/src/parse/properties/border_width.c b/src/parse/properties/border_width.c index 8b86bc4..bc911c9 100644 --- a/src/parse/properties/border_width.c +++ b/src/parse/properties/border_width.c @@ -43,28 +43,28 @@ css_error css__parse_border_width(css_language *c, /* Firstly, handle inherit */ token = parserutils_vector_peek(vector, *ctx); - if (token == NULL) + if (token == NULL) return CSS_INVALID; - + if (is_css_inherit(c, token)) { error = css_stylesheet_style_inherit(result, CSS_PROP_BORDER_TOP_WIDTH); - if (error != CSS_OK) + if (error != CSS_OK) return error; error = css_stylesheet_style_inherit(result, CSS_PROP_BORDER_RIGHT_WIDTH); - if (error != CSS_OK) - return error; + if (error != CSS_OK) + return error; error = css_stylesheet_style_inherit(result, CSS_PROP_BORDER_BOTTOM_WIDTH); - if (error != CSS_OK) + if (error != CSS_OK) return error; error = css_stylesheet_style_inherit(result, CSS_PROP_BORDER_LEFT_WIDTH); - if (error == CSS_OK) + if (error == CSS_OK) parserutils_vector_iterate(vector, ctx); return error; - } + } /* Attempt to parse up to 4 widths */ do { diff --git a/src/parse/properties/clip.c b/src/parse/properties/clip.c index 3d200f5..7862d4a 100644 --- a/src/parse/properties/clip.c +++ b/src/parse/properties/clip.c @@ -27,8 +27,8 @@ * Post condition: \a *ctx is updated with the next token to process * If the input is invalid, then \a *ctx remains unchanged. */ -css_error css__parse_clip(css_language *c, - const parserutils_vector *vector, int *ctx, +css_error css__parse_clip(css_language *c, + const parserutils_vector *vector, int *ctx, css_style *result) { int orig_ctx = *ctx; @@ -39,7 +39,7 @@ css_error css__parse_clip(css_language *c, uint32_t unit[4] = { 0 }; bool match; - /* FUNCTION(rect) [ [ IDENT(auto) | length ] CHAR(,)? ]{3} + /* FUNCTION(rect) [ [ IDENT(auto) | length ] CHAR(,)? ]{3} * [ IDENT(auto) | length ] CHAR{)} | * IDENT(auto, inherit) */ token = parserutils_vector_iterate(vector, ctx); @@ -81,11 +81,11 @@ css_error css__parse_clip(css_language *c, } if (token->type == CSS_TOKEN_IDENT) { - /* Slightly magical way of generating the auto + /* Slightly magical way of generating the auto * values. These are bits 3-6 of the value. */ if ((lwc_string_caseless_isequal( token->idata, c->strings[AUTO], - &match) == lwc_error_ok && + &match) == lwc_error_ok && match)) value |= 1 << (i + 3); else { @@ -95,16 +95,16 @@ css_error css__parse_clip(css_language *c, parserutils_vector_iterate(vector, ctx); } else { - error = css__parse_unit_specifier(c, vector, ctx, - UNIT_PX, - &length[num_lengths], + error = css__parse_unit_specifier(c, vector, ctx, + UNIT_PX, + &length[num_lengths], &unit[num_lengths]); if (error != CSS_OK) { *ctx = orig_ctx; return error; } - if (unit[num_lengths] & UNIT_ANGLE || + if (unit[num_lengths] & UNIT_ANGLE || unit[num_lengths] & UNIT_TIME || unit[num_lengths] & UNIT_FREQ || unit[num_lengths] & UNIT_PCT) { @@ -150,11 +150,11 @@ css_error css__parse_clip(css_language *c, } for (i = 0; i < num_lengths; i++) { - error = css__stylesheet_style_vappend(result, - 2, - length[i], + error = css__stylesheet_style_vappend(result, + 2, + length[i], unit[i]); - if (error != CSS_OK) + if (error != CSS_OK) break; } diff --git a/src/parse/properties/content.c b/src/parse/properties/content.c index 860d0f1..10f221f 100644 --- a/src/parse/properties/content.c +++ b/src/parse/properties/content.c @@ -127,15 +127,15 @@ css_error css__parse_content(css_language *c, error = c->sheet->resolve(c->sheet->resolve_pw, c->sheet->url, - token->idata, + token->idata, &uri); if (error != CSS_OK) { *ctx = orig_ctx; return error; } - error = css__stylesheet_string_add(c->sheet, - uri, + error = css__stylesheet_string_add(c->sheet, + uri, &uri_snumber); if (error != CSS_OK) { *ctx = orig_ctx; diff --git a/src/parse/properties/css_property_parser_gen.c b/src/parse/properties/css_property_parser_gen.c index a430c9b..0e6ce72 100644 --- a/src/parse/properties/css_property_parser_gen.c +++ b/src/parse/properties/css_property_parser_gen.c @@ -109,8 +109,8 @@ void output_header(FILE *outputf, const char *descriptor, struct keyval *parser_ " const parserutils_vector *vector, int *ctx,\n" " css_style *result%s)\n" "{\n", - descriptor, - parser_id->key, + descriptor, + parser_id->key, is_generic ? " * \\param op Bytecode OpCode for CSS property to encode\n" : "", parser_id->key, is_generic ? ", enum css_properties_e op" : ""); @@ -249,7 +249,7 @@ void output_number(FILE *outputf, struct keyval *parseid, struct keyval_list *kv "\t\tif (%s) {\n" "\t\t\t*ctx = orig_ctx;\n" "\t\t\treturn CSS_INVALID;\n" - "\t\t}\n\n", + "\t\t}\n\n", ulkv->val); } @@ -264,7 +264,7 @@ void output_number(FILE *outputf, struct keyval *parseid, struct keyval_list *kv "\t\terror = css__stylesheet_style_append(result, num);\n" "\t} else ", parseid->val, - ckv->val); + ckv->val); } void output_color(FILE *outputf, struct keyval *parseid, struct keyval_list *kvlist) @@ -317,21 +317,21 @@ void output_length_unit(FILE *outputf, struct keyval *parseid, struct keyval_lis "\t\tif ((%s) == false) {\n" "\t\t\t*ctx = orig_ctx;\n" "\t\t\treturn CSS_INVALID;\n" - "\t\t}\n\n", + "\t\t}\n\n", ulkv->val); } else if (strcmp(ulkv->key, "DISALLOW") == 0) { fprintf(outputf, "\t\tif (%s) {\n" "\t\t\t*ctx = orig_ctx;\n" "\t\t\treturn CSS_INVALID;\n" - "\t\t}\n\n", + "\t\t}\n\n", ulkv->val); } else if (strcmp(ulkv->key, "RANGE") == 0) { fprintf(outputf, "\t\tif (length %s) {\n" "\t\t\t*ctx = orig_ctx;\n" "\t\t\treturn CSS_INVALID;\n" - "\t\t}\n\n", + "\t\t}\n\n", ulkv->val); } @@ -350,9 +350,9 @@ void output_length_unit(FILE *outputf, struct keyval *parseid, struct keyval_lis ckv->val); } -void -output_ident_list(FILE *outputf, - struct keyval *parseid, +void +output_ident_list(FILE *outputf, + struct keyval *parseid, struct keyval_list *kvlist) { struct keyval *ckv = kvlist->item[0]; /* list type : opv value */ @@ -387,7 +387,7 @@ output_ident_list(FILE *outputf, "\t\t\t\t*ctx = orig_ctx;\n" "\t\t\t\treturn error;\n" "\t\t\t}\n\n" - "\t\t\terror = css__stylesheet_style_append(result, snumber);\n" + "\t\t\terror = css__stylesheet_style_append(result, snumber);\n" "\t\t\tif (error != CSS_OK) {\n" "\t\t\t\t*ctx = orig_ctx;\n" "\t\t\t\treturn error;\n" @@ -553,13 +553,13 @@ int main(int argc, char **argv) curlist = &IDENT_LIST; } else if (rkv->val[0] == ')') { curlist = &base; - } + } } else if (strcmp(rkv->key, "LENGTH_UNIT") == 0) { if (rkv->val[0] == '(') { curlist = &LENGTH_UNIT; } else if (rkv->val[0] == ')') { curlist = &base; - } + } only_ident = false; do_token_check = false; } else if (strcmp(rkv->key, "COLOR") == 0) { diff --git a/src/parse/properties/cue.c b/src/parse/properties/cue.c index ea94adb..eef10d1 100644 --- a/src/parse/properties/cue.c +++ b/src/parse/properties/cue.c @@ -27,8 +27,8 @@ * Post condition: \a *ctx is updated with the next token to process * If the input is invalid, then \a *ctx remains unchanged. */ -css_error css__parse_cue(css_language *c, - const parserutils_vector *vector, int *ctx, +css_error css__parse_cue(css_language *c, + const parserutils_vector *vector, int *ctx, css_style *result) { int orig_ctx = *ctx; @@ -47,7 +47,7 @@ css_error css__parse_cue(css_language *c, error = css__parse_cue_before(c, vector, ctx, result); if (error == CSS_OK) { /* first token parsed */ - + consumeWhitespace(vector, ctx); token = parserutils_vector_peek(vector, *ctx); @@ -62,7 +62,7 @@ css_error css__parse_cue(css_language *c, error = CSS_INVALID; } else { error = css__parse_cue_after(c, vector, ctx, result); - if (error == CSS_OK) { + if (error == CSS_OK) { /* second token parsed */ if (is_css_inherit(c, first_token)) { /* valid second token after inherit */ diff --git a/src/parse/properties/cursor.c b/src/parse/properties/cursor.c index 6b9eadf..ad3ac47 100644 --- a/src/parse/properties/cursor.c +++ b/src/parse/properties/cursor.c @@ -26,8 +26,8 @@ * Post condition: \a *ctx is updated with the next token to process * If the input is invalid, then \a *ctx remains unchanged. */ -css_error css__parse_cursor(css_language *c, - const parserutils_vector *vector, int *ctx, +css_error css__parse_cursor(css_language *c, + const parserutils_vector *vector, int *ctx, css_style *result) { int orig_ctx = *ctx; @@ -37,11 +37,11 @@ css_error css__parse_cursor(css_language *c, /* [ (URI ',')* IDENT(auto, crosshair, default, pointer, move, e-resize, * ne-resize, nw-resize, n-resize, se-resize, sw-resize, - * s-resize, w-resize, text, wait, help, progress) ] - * | IDENT(inherit) + * s-resize, w-resize, text, wait, help, progress) ] + * | IDENT(inherit) */ token = parserutils_vector_iterate(vector, ctx); - if ((token == NULL) || + if ((token == NULL) || (token->type != CSS_TOKEN_IDENT && token->type != CSS_TOKEN_URI)) { *ctx = orig_ctx; @@ -75,8 +75,8 @@ css_error css__parse_cursor(css_language *c, return error; } - error = css__stylesheet_string_add(c->sheet, - uri, + error = css__stylesheet_string_add(c->sheet, + uri, &uri_snumber); if (error != CSS_OK) { *ctx = orig_ctx; diff --git a/src/parse/properties/elevation.c b/src/parse/properties/elevation.c index 0b5fdc4..fea35a3 100644 --- a/src/parse/properties/elevation.c +++ b/src/parse/properties/elevation.c @@ -27,8 +27,8 @@ * Post condition: \a *ctx is updated with the next token to process * If the input is invalid, then \a *ctx remains unchanged. */ -css_error css__parse_elevation(css_language *c, - const parserutils_vector *vector, int *ctx, +css_error css__parse_elevation(css_language *c, + const parserutils_vector *vector, int *ctx, css_style *result) { int orig_ctx = *ctx; diff --git a/src/parse/properties/font.c b/src/parse/properties/font.c index 2cdb488..9903f75 100644 --- a/src/parse/properties/font.c +++ b/src/parse/properties/font.c @@ -15,7 +15,7 @@ static css_error parse_system_font(css_language *c, - css_style *result, css_system_font *system_font) + css_style *result, css_system_font *system_font) { css_error error; bool match; @@ -38,7 +38,7 @@ static css_error parse_system_font(css_language *c, error = CSS_BADPARM; break; } - if (error != CSS_OK) + if (error != CSS_OK) return error; /* variant */ @@ -55,8 +55,8 @@ static css_error parse_system_font(css_language *c, error = CSS_BADPARM; break; } - if (error != CSS_OK) - return error; + if (error != CSS_OK) + return error; /* weight */ switch(system_font->weight) { @@ -116,29 +116,29 @@ static css_error parse_system_font(css_language *c, error = CSS_BADPARM; break; } - if (error != CSS_OK) + if (error != CSS_OK) return error; /* size */ error = css__stylesheet_style_appendOPV(result, CSS_PROP_FONT_SIZE, 0, FONT_SIZE_DIMENSION); - if (error != CSS_OK) + if (error != CSS_OK) return error; error = css__stylesheet_style_vappend(result, 2, system_font->size.size, system_font->size.unit); - if (error != CSS_OK) + if (error != CSS_OK) return error; /* line height */ error = css__stylesheet_style_appendOPV(result, CSS_PROP_LINE_HEIGHT, 0, LINE_HEIGHT_DIMENSION); - if (error != CSS_OK) + if (error != CSS_OK) return error; error = css__stylesheet_style_vappend(result, 2, system_font->line_height.size, system_font->line_height.unit); - if (error != CSS_OK) + if (error != CSS_OK) return error; /* font family */ - if ((lwc_string_caseless_isequal(system_font->family, c->strings[SERIF], &match) == lwc_error_ok && match)) + if ((lwc_string_caseless_isequal(system_font->family, c->strings[SERIF], &match) == lwc_error_ok && match)) error = css__stylesheet_style_appendOPV(result, CSS_PROP_FONT_FAMILY, 0, FONT_FAMILY_SERIF); else if ((lwc_string_caseless_isequal(system_font->family, c->strings[SANS_SERIF], &match) == lwc_error_ok && match)) error = css__stylesheet_style_appendOPV(result, CSS_PROP_FONT_FAMILY, 0, FONT_FAMILY_SANS_SERIF); @@ -207,47 +207,47 @@ css_error css__parse_font(css_language *c, /* Firstly, handle inherit */ token = parserutils_vector_peek(vector, *ctx); - if (token == NULL) + if (token == NULL) return CSS_INVALID; - + if (is_css_inherit(c, token)) { error = css_stylesheet_style_inherit(result, CSS_PROP_FONT_STYLE); - if (error != CSS_OK) + if (error != CSS_OK) return error; error = css_stylesheet_style_inherit(result, CSS_PROP_FONT_VARIANT); - if (error != CSS_OK) - return error; + if (error != CSS_OK) + return error; error = css_stylesheet_style_inherit(result, CSS_PROP_FONT_WEIGHT); - if (error != CSS_OK) + if (error != CSS_OK) return error; error = css_stylesheet_style_inherit(result, CSS_PROP_FONT_SIZE); - if (error != CSS_OK) + if (error != CSS_OK) return error; error = css_stylesheet_style_inherit(result, CSS_PROP_LINE_HEIGHT); - if (error != CSS_OK) + if (error != CSS_OK) return error; error = css_stylesheet_style_inherit(result, CSS_PROP_FONT_FAMILY); - if (error == CSS_OK) + if (error == CSS_OK) parserutils_vector_iterate(vector, ctx); return error; - } + } /* Perhaps an unknown font name; ask the client */ - if ((token->type == CSS_TOKEN_IDENT) && + if ((token->type == CSS_TOKEN_IDENT) && (c->sheet->font != NULL) && - (c->sheet->font(c->sheet->font_pw, - token->idata, + (c->sheet->font(c->sheet->font_pw, + token->idata, &system_font) == CSS_OK)) { - + error = parse_system_font(c, result, &system_font); - if (error == CSS_OK) + if (error == CSS_OK) parserutils_vector_iterate(vector, ctx); return error; @@ -256,7 +256,7 @@ css_error css__parse_font(css_language *c, /* allocate styles */ error = css__stylesheet_style_create(c->sheet, &style_style); - if (error != CSS_OK) + if (error != CSS_OK) return error; error = css__stylesheet_style_create(c->sheet, &variant_style); @@ -312,15 +312,15 @@ css_error css__parse_font(css_language *c, goto css__parse_font_cleanup; } - if ((style) && + if ((style) && (error = css__parse_font_style(c, vector, ctx, style_style)) == CSS_OK) { style = false; - } else if ((variant) && + } else if ((variant) && (error = css__parse_font_variant(c, vector, ctx, variant_style)) == CSS_OK) { variant = false; - } else if ((weight) && + } else if ((weight) && (error = css__parse_font_weight(c, vector, ctx, weight_style)) == CSS_OK) { weight = false; @@ -389,23 +389,23 @@ css_error css__parse_font(css_language *c, /* defaults */ if (style) { - error = css__stylesheet_style_appendOPV(style_style, - CSS_PROP_FONT_STYLE, 0, + error = css__stylesheet_style_appendOPV(style_style, + CSS_PROP_FONT_STYLE, 0, FONT_STYLE_NORMAL); if (error != CSS_OK) goto css__parse_font_cleanup; } if (variant) { - error = css__stylesheet_style_appendOPV(variant_style, - CSS_PROP_FONT_VARIANT, 0, + error = css__stylesheet_style_appendOPV(variant_style, + CSS_PROP_FONT_VARIANT, 0, FONT_VARIANT_NORMAL); if (error != CSS_OK) goto css__parse_font_cleanup; } if (weight) { - error = css__stylesheet_style_appendOPV(weight_style, + error = css__stylesheet_style_appendOPV(weight_style, CSS_PROP_FONT_WEIGHT, 0, FONT_WEIGHT_NORMAL); if (error != CSS_OK) @@ -413,7 +413,7 @@ css_error css__parse_font(css_language *c, } if (line_height) { - error = css__stylesheet_style_appendOPV(line_height_style, + error = css__stylesheet_style_appendOPV(line_height_style, CSS_PROP_LINE_HEIGHT, 0, LINE_HEIGHT_NORMAL); if (error != CSS_OK) diff --git a/src/parse/properties/font_family.c b/src/parse/properties/font_family.c index 60c069d..23c080b 100644 --- a/src/parse/properties/font_family.c +++ b/src/parse/properties/font_family.c @@ -98,8 +98,8 @@ static css_code_t font_family_value(css_language *c, const css_token *token, boo * Post condition: \a *ctx is updated with the next token to process * If the input is invalid, then \a *ctx remains unchanged. */ -css_error css__parse_font_family(css_language *c, - const parserutils_vector *vector, int *ctx, +css_error css__parse_font_family(css_language *c, + const parserutils_vector *vector, int *ctx, css_style *result) { int orig_ctx = *ctx; @@ -108,11 +108,11 @@ css_error css__parse_font_family(css_language *c, bool match; /* [ IDENT+ | STRING ] [ ',' [ IDENT+ | STRING ] ]* | IDENT(inherit) - * + * * In the case of IDENT+, any whitespace between tokens is collapsed to * a single space * - * \todo Mozilla makes the comma optional. + * \todo Mozilla makes the comma optional. * Perhaps this is a quirk we should inherit? */ diff --git a/src/parse/properties/font_weight.c b/src/parse/properties/font_weight.c index 4853106..8e57e5f 100644 --- a/src/parse/properties/font_weight.c +++ b/src/parse/properties/font_weight.c @@ -27,8 +27,8 @@ * Post condition: \a *ctx is updated with the next token to process * If the input is invalid, then \a *ctx remains unchanged. */ -css_error css__parse_font_weight(css_language *c, - const parserutils_vector *vector, int *ctx, +css_error css__parse_font_weight(css_language *c, + const parserutils_vector *vector, int *ctx, css_style *result) { int orig_ctx = *ctx; @@ -38,7 +38,7 @@ css_error css__parse_font_weight(css_language *c, uint16_t value = 0; bool match; - /* NUMBER (100, 200, 300, 400, 500, 600, 700, 800, 900) | + /* NUMBER (100, 200, 300, 400, 500, 600, 700, 800, 900) | * IDENT (normal, bold, bolder, lighter, inherit) */ token = parserutils_vector_iterate(vector, ctx); if (token == NULL || (token->type != CSS_TOKEN_IDENT && @@ -53,7 +53,7 @@ css_error css__parse_font_weight(css_language *c, flags |= FLAG_INHERIT; } else if (token->type == CSS_TOKEN_NUMBER) { size_t consumed = 0; - css_fixed num = css__number_from_lwc_string(token->idata, + css_fixed num = css__number_from_lwc_string(token->idata, true, &consumed); /* Invalid if there are trailing characters */ if (consumed != lwc_string_length(token->idata)) { @@ -98,9 +98,9 @@ css_error css__parse_font_weight(css_language *c, CSS_PROP_FONT_WEIGHT, flags, value); - if (error != CSS_OK) + if (error != CSS_OK) *ctx = orig_ctx; - + return error; } diff --git a/src/parse/properties/list_style.c b/src/parse/properties/list_style.c index 4ef4ce8..f12fa2e 100644 --- a/src/parse/properties/list_style.c +++ b/src/parse/properties/list_style.c @@ -44,29 +44,29 @@ css_error css__parse_list_style(css_language *c, /* Firstly, handle inherit */ token = parserutils_vector_peek(vector, *ctx); - if (token == NULL) + if (token == NULL) return CSS_INVALID; - + if (is_css_inherit(c, token)) { error = css_stylesheet_style_inherit(result, CSS_PROP_LIST_STYLE_IMAGE); - if (error != CSS_OK) + if (error != CSS_OK) return error; error = css_stylesheet_style_inherit(result, CSS_PROP_LIST_STYLE_POSITION); - if (error != CSS_OK) - return error; + if (error != CSS_OK) + return error; error = css_stylesheet_style_inherit(result, CSS_PROP_LIST_STYLE_TYPE); - if (error == CSS_OK) + if (error == CSS_OK) parserutils_vector_iterate(vector, ctx); return error; - } + } /* allocate styles */ error = css__stylesheet_style_create(c->sheet, &image_style); - if (error != CSS_OK) + if (error != CSS_OK) return error; error = css__stylesheet_style_create(c->sheet, &position_style); @@ -94,15 +94,15 @@ css_error css__parse_list_style(css_language *c, goto css__parse_list_style_cleanup; } - if ((type) && + if ((type) && (error = css__parse_list_style_type(c, vector, ctx, type_style)) == CSS_OK) { type = false; - } else if ((position) && - (error = css__parse_list_style_position(c, vector, + } else if ((position) && + (error = css__parse_list_style_position(c, vector, ctx, position_style)) == CSS_OK) { position = false; - } else if ((image) && + } else if ((image) && (error = css__parse_list_style_image(c, vector, ctx, image_style)) == CSS_OK) { image = false; @@ -121,19 +121,19 @@ css_error css__parse_list_style(css_language *c, /* defaults */ if (image) { - error = css__stylesheet_style_appendOPV(image_style, + error = css__stylesheet_style_appendOPV(image_style, CSS_PROP_LIST_STYLE_IMAGE, 0, LIST_STYLE_IMAGE_NONE); } if (position) { - error = css__stylesheet_style_appendOPV(position_style, + error = css__stylesheet_style_appendOPV(position_style, CSS_PROP_LIST_STYLE_POSITION, 0, LIST_STYLE_POSITION_OUTSIDE); } if (type) { - error = css__stylesheet_style_appendOPV(type_style, + error = css__stylesheet_style_appendOPV(type_style, CSS_PROP_LIST_STYLE_TYPE, 0, LIST_STYLE_TYPE_DISC); } diff --git a/src/parse/properties/list_style_type.c b/src/parse/properties/list_style_type.c index b73bcb7..ccaa133 100644 --- a/src/parse/properties/list_style_type.c +++ b/src/parse/properties/list_style_type.c @@ -27,8 +27,8 @@ * Post condition: \a *ctx is updated with the next token to process * If the input is invalid, then \a *ctx remains unchanged. */ -css_error css__parse_list_style_type(css_language *c, - const parserutils_vector *vector, int *ctx, +css_error css__parse_list_style_type(css_language *c, + const parserutils_vector *vector, int *ctx, css_style *result) { int orig_ctx = *ctx; @@ -63,8 +63,8 @@ css_error css__parse_list_style_type(css_language *c, error = css__stylesheet_style_appendOPV(result, CSS_PROP_LIST_STYLE_TYPE, flags, value); - if (error != CSS_OK) + if (error != CSS_OK) *ctx = orig_ctx; - + return error; } diff --git a/src/parse/properties/margin.c b/src/parse/properties/margin.c index 896e300..7817d50 100644 --- a/src/parse/properties/margin.c +++ b/src/parse/properties/margin.c @@ -43,28 +43,28 @@ css_error css__parse_margin(css_language *c, /* Firstly, handle inherit */ token = parserutils_vector_peek(vector, *ctx); - if (token == NULL) + if (token == NULL) return CSS_INVALID; - + if (is_css_inherit(c, token)) { error = css_stylesheet_style_inherit(result, CSS_PROP_MARGIN_TOP); - if (error != CSS_OK) + if (error != CSS_OK) return error; error = css_stylesheet_style_inherit(result, CSS_PROP_MARGIN_RIGHT); - if (error != CSS_OK) - return error; + if (error != CSS_OK) + return error; error = css_stylesheet_style_inherit(result, CSS_PROP_MARGIN_BOTTOM); - if (error != CSS_OK) + if (error != CSS_OK) return error; error = css_stylesheet_style_inherit(result, CSS_PROP_MARGIN_LEFT); - if (error == CSS_OK) + if (error == CSS_OK) parserutils_vector_iterate(vector, ctx); return error; - } + } /* Attempt to parse up to 4 widths */ do { diff --git a/src/parse/properties/opacity.c b/src/parse/properties/opacity.c index edad9f8..e8b7c3e 100644 --- a/src/parse/properties/opacity.c +++ b/src/parse/properties/opacity.c @@ -73,7 +73,7 @@ css_error css__parse_opacity(css_language *c, if (error != CSS_OK) *ctx = orig_ctx; - + return error; } diff --git a/src/parse/properties/outline.c b/src/parse/properties/outline.c index eb4f525..d9d9ec2 100644 --- a/src/parse/properties/outline.c +++ b/src/parse/properties/outline.c @@ -44,29 +44,29 @@ css_error css__parse_outline(css_language *c, /* Firstly, handle inherit */ token = parserutils_vector_peek(vector, *ctx); - if (token == NULL) + if (token == NULL) return CSS_INVALID; - + if (is_css_inherit(c, token)) { error = css_stylesheet_style_inherit(result, CSS_PROP_OUTLINE_COLOR); - if (error != CSS_OK) + if (error != CSS_OK) return error; error = css_stylesheet_style_inherit(result, CSS_PROP_OUTLINE_STYLE); - if (error != CSS_OK) - return error; + if (error != CSS_OK) + return error; error = css_stylesheet_style_inherit(result, CSS_PROP_OUTLINE_WIDTH); - if (error == CSS_OK) + if (error == CSS_OK) parserutils_vector_iterate(vector, ctx); return error; - } + } /* allocate styles */ error = css__stylesheet_style_create(c->sheet, &color_style); - if (error != CSS_OK) + if (error != CSS_OK) return error; error = css__stylesheet_style_create(c->sheet, &style_style); @@ -94,19 +94,19 @@ css_error css__parse_outline(css_language *c, goto css__parse_outline_cleanup; } - if ((color) && + if ((color) && (error = css__parse_outline_color(c, vector, ctx, color_style)) == CSS_OK) { color = false; - } else if ((style) && - (error = css__parse_outline_style(c, vector, + } else if ((style) && + (error = css__parse_outline_style(c, vector, ctx, style_style)) == CSS_OK) { style = false; - } else if ((width) && + } else if ((width) && (error = css__parse_outline_width(c, vector, ctx, width_style)) == CSS_OK) { width = false; - } + } if (error == CSS_OK) { consumeWhitespace(vector, ctx); @@ -121,19 +121,19 @@ css_error css__parse_outline(css_language *c, /* defaults */ if (color) { - error = css__stylesheet_style_appendOPV(color_style, + error = css__stylesheet_style_appendOPV(color_style, CSS_PROP_OUTLINE_COLOR, 0, OUTLINE_COLOR_INVERT); } if (style) { - error = css__stylesheet_style_appendOPV(style_style, + error = css__stylesheet_style_appendOPV(style_style, CSS_PROP_OUTLINE_STYLE, 0, OUTLINE_STYLE_NONE); } if (width) { - error = css__stylesheet_style_appendOPV(width_style, + error = css__stylesheet_style_appendOPV(width_style, CSS_PROP_OUTLINE_WIDTH, 0, OUTLINE_WIDTH_MEDIUM); } diff --git a/src/parse/properties/padding.c b/src/parse/properties/padding.c index 7a5b88b..7f5b9f6 100644 --- a/src/parse/properties/padding.c +++ b/src/parse/properties/padding.c @@ -41,28 +41,28 @@ css_error css__parse_padding(css_language *c, /* Firstly, handle inherit */ token = parserutils_vector_peek(vector, *ctx); - if (token == NULL) + if (token == NULL) return CSS_INVALID; - + if (is_css_inherit(c, token)) { error = css_stylesheet_style_inherit(result, CSS_PROP_PADDING_TOP); - if (error != CSS_OK) + if (error != CSS_OK) return error; error = css_stylesheet_style_inherit(result, CSS_PROP_PADDING_RIGHT); - if (error != CSS_OK) - return error; + if (error != CSS_OK) + return error; error = css_stylesheet_style_inherit(result, CSS_PROP_PADDING_BOTTOM); - if (error != CSS_OK) + if (error != CSS_OK) return error; error = css_stylesheet_style_inherit(result, CSS_PROP_PADDING_LEFT); - if (error == CSS_OK) + if (error == CSS_OK) parserutils_vector_iterate(vector, ctx); return error; - } + } /* Attempt to parse up to 4 widths */ do { @@ -81,7 +81,7 @@ css_error css__parse_padding(css_language *c, *ctx = orig_ctx; return CSS_INVALID; } - + if (side_length[side_count] < 0) { *ctx = orig_ctx; return CSS_INVALID; diff --git a/src/parse/properties/pause.c b/src/parse/properties/pause.c index fcb4644..e45a8f4 100644 --- a/src/parse/properties/pause.c +++ b/src/parse/properties/pause.c @@ -62,7 +62,7 @@ css_error css__parse_pause(css_language *c, error = CSS_INVALID; } else { error = css__parse_pause_after(c, vector, ctx, result); - if (error == CSS_OK) { + if (error == CSS_OK) { /* second token parsed */ if (is_css_inherit(c, first_token)) { /* valid second token after inherit */ diff --git a/src/parse/properties/play_during.c b/src/parse/properties/play_during.c index 1e5ad63..109ae64 100644 --- a/src/parse/properties/play_during.c +++ b/src/parse/properties/play_during.c @@ -27,8 +27,8 @@ * Post condition: \a *ctx is updated with the next token to process * If the input is invalid, then \a *ctx remains unchanged. */ -css_error css__parse_play_during(css_language *c, - const parserutils_vector *vector, int *ctx, +css_error css__parse_play_during(css_language *c, + const parserutils_vector *vector, int *ctx, css_style *result) { int orig_ctx = *ctx; @@ -42,7 +42,7 @@ css_error css__parse_play_during(css_language *c, /* URI [ IDENT(mix) || IDENT(repeat) ]? | IDENT(auto,none,inherit) */ token = parserutils_vector_iterate(vector, ctx); - if ((token == NULL) || + if ((token == NULL) || ((token->type != CSS_TOKEN_IDENT) && (token->type != CSS_TOKEN_URI))) { *ctx = orig_ctx; @@ -79,8 +79,8 @@ css_error css__parse_play_during(css_language *c, return error; } - error = css__stylesheet_string_add(c->sheet, - uri, + error = css__stylesheet_string_add(c->sheet, + uri, &uri_snumber); if (error != CSS_OK) { *ctx = orig_ctx; @@ -95,7 +95,7 @@ css_error css__parse_play_during(css_language *c, if (token != NULL && token->type == CSS_TOKEN_IDENT) { if ((lwc_string_caseless_isequal( token->idata, c->strings[MIX], - &match) == lwc_error_ok && + &match) == lwc_error_ok && match)) { if ((value & PLAY_DURING_MIX) == 0) value |= PLAY_DURING_MIX; @@ -104,7 +104,7 @@ css_error css__parse_play_during(css_language *c, return CSS_INVALID; } } else if (lwc_string_caseless_isequal( - token->idata, + token->idata, c->strings[REPEAT], &match) == lwc_error_ok && match) { @@ -130,12 +130,12 @@ css_error css__parse_play_during(css_language *c, return error; } - if ((flags & FLAG_INHERIT) == false && + if ((flags & FLAG_INHERIT) == false && (value & PLAY_DURING_TYPE_MASK) == PLAY_DURING_URI) { error = css__stylesheet_style_append(result, uri_snumber); } - if (error != CSS_OK) + if (error != CSS_OK) *ctx = orig_ctx; return error; diff --git a/src/parse/properties/properties.h b/src/parse/properties/properties.h index e7b2bf7..4517515 100644 --- a/src/parse/properties/properties.h +++ b/src/parse/properties/properties.h @@ -16,32 +16,32 @@ /** * Type of property handler function */ -typedef css_error (*css_prop_handler)(css_language *c, - const parserutils_vector *vector, int *ctx, +typedef css_error (*css_prop_handler)(css_language *c, + const parserutils_vector *vector, int *ctx, css_style *result); extern const css_prop_handler property_handlers[LAST_PROP + 1 - FIRST_PROP]; css_error css__parse_azimuth(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_background(css_language *c, const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_background_attachment(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_background_color(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_background_image(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_background_position(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_background_repeat(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_border(css_language *c, const parserutils_vector *vector, int *ctx, @@ -50,46 +50,46 @@ css_error css__parse_border_bottom(css_language *c, const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_border_bottom_color(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_border_bottom_style(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_border_bottom_width(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_border_color(css_language *c, const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_border_collapse(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_border_left(css_language *c, const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_border_left_color(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_border_left_style(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_border_left_width(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_border_right(css_language *c, const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_border_right_color(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_border_right_style(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_border_right_width(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_border_spacing(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_border_style(css_language *c, const parserutils_vector *vector, int *ctx, @@ -98,19 +98,19 @@ css_error css__parse_border_top(css_language *c, const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_border_top_color(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_border_top_style(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_border_top_width(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_border_width(css_language *c, const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_bottom(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_box_sizing(css_language *c, const parserutils_vector *vector, int *ctx, @@ -125,169 +125,169 @@ css_error css__parse_break_inside(css_language *c, const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_caption_side(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_clear(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_clip(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_color(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_columns(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_column_count(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_column_fill(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_column_gap(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_column_rule(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_column_rule_color(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_column_rule_style(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_column_rule_width(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_column_span(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_column_width(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_content(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_counter_increment(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_counter_reset(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_cue(css_language *c, const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_cue_after(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_cue_before(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_cursor(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_direction(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_display(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_elevation(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_empty_cells(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_float(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_font(css_language *c, const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_font_family(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_font_size(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_font_style(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_font_variant(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_font_weight(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_height(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_left(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_letter_spacing(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_line_height(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_list_style(css_language *c, const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_list_style_image(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_list_style_position(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_list_style_type(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_margin(css_language *c, const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_margin_bottom(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_margin_left(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_margin_right(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_margin_top(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_max_height(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_max_width(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_min_height(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_min_width(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_opacity(css_language *c, const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_orphans(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_outline(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_outline_color(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_outline_style(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_outline_width(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_overflow(css_language *c, const parserutils_vector *vector, int *ctx, @@ -302,124 +302,124 @@ css_error css__parse_padding(css_language *c, const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_padding_bottom(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_padding_left(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_padding_right(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_padding_top(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_page_break_after(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_page_break_before(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_page_break_inside(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_pause(css_language *c, const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_pause_after(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_pause_before(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_pitch_range(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_pitch(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_play_during(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_position(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_quotes(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_richness(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_right(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_speak_header(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_speak_numeral(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_speak_punctuation(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_speak(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_speech_rate(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_stress(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_table_layout(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_text_align(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_text_decoration(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_text_indent(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_text_transform(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_top(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_unicode_bidi(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_vertical_align(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_visibility(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_voice_family(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_volume(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_white_space(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_widows(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_width(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_word_spacing(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_writing_mode(css_language *c, const parserutils_vector *vector, int *ctx, css_style *result); css_error css__parse_z_index(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int *ctx, css_style *result); #endif diff --git a/src/parse/properties/quotes.c b/src/parse/properties/quotes.c index b7fc294..9d3c4c9 100644 --- a/src/parse/properties/quotes.c +++ b/src/parse/properties/quotes.c @@ -69,39 +69,39 @@ css_error css__parse_quotes(css_language *c, uint32_t open_snumber; uint32_t close_snumber; - error = css__stylesheet_string_add(c->sheet, - lwc_string_ref(token->idata), + error = css__stylesheet_string_add(c->sheet, + lwc_string_ref(token->idata), &open_snumber); - if (error != CSS_OK) + if (error != CSS_OK) break; consumeWhitespace(vector, ctx); token = parserutils_vector_iterate(vector, ctx); - if ((token == NULL) || + if ((token == NULL) || (token->type != CSS_TOKEN_STRING)) { error = CSS_INVALID; break; } - error = css__stylesheet_string_add(c->sheet, - lwc_string_ref(token->idata), + error = css__stylesheet_string_add(c->sheet, + lwc_string_ref(token->idata), &close_snumber); - if (error != CSS_OK) + if (error != CSS_OK) break; consumeWhitespace(vector, ctx); error = CSS_FIRST_APPEND(QUOTES_STRING); - if (error != CSS_OK) + if (error != CSS_OK) break; error = css__stylesheet_style_append(result, open_snumber); - if (error != CSS_OK) + if (error != CSS_OK) break; error = css__stylesheet_style_append(result, close_snumber); - if (error != CSS_OK) + if (error != CSS_OK) break; first = false; @@ -115,7 +115,7 @@ css_error css__parse_quotes(css_language *c, if (error == CSS_OK) { /* AddTerminator */ error = css__stylesheet_style_append(result, QUOTES_NONE); - } + } } else { error = CSS_INVALID; } diff --git a/src/parse/properties/text_decoration.c b/src/parse/properties/text_decoration.c index 9bfdec2..a7bae24 100644 --- a/src/parse/properties/text_decoration.c +++ b/src/parse/properties/text_decoration.c @@ -27,8 +27,8 @@ * Post condition: \a *ctx is updated with the next token to process * If the input is invalid, then \a *ctx remains unchanged. */ -css_error css__parse_text_decoration(css_language *c, - const parserutils_vector *vector, int *ctx, +css_error css__parse_text_decoration(css_language *c, + const parserutils_vector *vector, int *ctx, css_style *result) { int orig_ctx = *ctx; diff --git a/src/parse/properties/utils.c b/src/parse/properties/utils.c index 82dacf8..47b06e3 100644 --- a/src/parse/properties/utils.c +++ b/src/parse/properties/utils.c @@ -136,28 +136,28 @@ css_error css__parse_border_side(css_language *c, /* Firstly, handle inherit */ token = parserutils_vector_peek(vector, *ctx); - if (token == NULL) + if (token == NULL) return CSS_INVALID; - + if (is_css_inherit(c, token)) { error = css_stylesheet_style_inherit(result, CSS_PROP_BORDER_TOP_COLOR + side); - if (error != CSS_OK) + if (error != CSS_OK) return error; error = css_stylesheet_style_inherit(result, CSS_PROP_BORDER_TOP_STYLE + side); - if (error != CSS_OK) - return error; + if (error != CSS_OK) + return error; error = css_stylesheet_style_inherit(result, CSS_PROP_BORDER_TOP_WIDTH + side); - if (error == CSS_OK) + if (error == CSS_OK) parserutils_vector_iterate(vector, ctx); return error; - } + } /* allocate styles */ error = css__stylesheet_style_create(c->sheet, &color_style); - if (error != CSS_OK) + if (error != CSS_OK) return error; error = css__stylesheet_style_create(c->sheet, &style_style); @@ -188,19 +188,19 @@ css_error css__parse_border_side(css_language *c, /* Try each property parser in turn, but only if we * haven't already got a value for this property. */ - if ((color) && - (error = css__parse_border_side_color(c, vector, ctx, + if ((color) && + (error = css__parse_border_side_color(c, vector, ctx, color_style, CSS_PROP_BORDER_TOP_COLOR + side)) == CSS_OK) { color = false; - } else if ((style) && + } else if ((style) && (error = css__parse_border_side_style(c, vector, ctx, style_style, CSS_PROP_BORDER_TOP_STYLE + side)) == CSS_OK) { style = false; - } else if ((width) && + } else if ((width) && (error = css__parse_border_side_width(c, vector, ctx, width_style, CSS_PROP_BORDER_TOP_WIDTH + side)) == CSS_OK) { width = false; - } + } if (error == CSS_OK) { consumeWhitespace(vector, ctx); @@ -214,7 +214,7 @@ css_error css__parse_border_side(css_language *c, if (style) { error = css__stylesheet_style_appendOPV(style_style, - CSS_PROP_BORDER_TOP_STYLE + side, 0, + CSS_PROP_BORDER_TOP_STYLE + side, 0, BORDER_STYLE_NONE); if (error != CSS_OK) goto css__parse_border_side_cleanup; @@ -295,7 +295,7 @@ static void HSL_to_RGB(css_fixed hue, css_fixed sat, css_fixed lit, uint8_t *r, /* Compute min(r,g,b) */ min_rgb = FSUB(FMUL(lit, INTTOFIX(2)), max_rgb); - /* We know that the value of at least one of the components is + /* We know that the value of at least one of the components is * max(r,g,b) and that the value of at least one of the other * components is min(r,g,b). * @@ -370,7 +370,7 @@ css_error css__parse_colour_specifier(css_language *c, consumeWhitespace(vector, ctx); - /* IDENT(<colour name>) | + /* IDENT(<colour name>) | * HASH(rgb | rrggbb) | * FUNCTION(rgb) [ [ NUMBER | PERCENTAGE ] ',' ] {3} ')' * FUNCTION(rgba) [ [ NUMBER | PERCENTAGE ] ',' ] {4} ')' @@ -539,8 +539,8 @@ css_error css__parse_colour_specifier(css_language *c, css_fixed hue, sat, lit; int32_t alpha = 255; - /* hue is a number without a unit representing an - * angle (0-360) degrees + /* hue is a number without a unit representing an + * angle (0-360) degrees */ consumeWhitespace(vector, ctx); @@ -615,7 +615,7 @@ css_error css__parse_colour_specifier(css_language *c, if (!tokenIsChar(token, ',')) goto invalid; - + consumeWhitespace(vector, ctx); token = parserutils_vector_iterate(vector, ctx); @@ -625,7 +625,7 @@ css_error css__parse_colour_specifier(css_language *c, alpha = css__number_from_lwc_string(token->idata, false, &consumed); if (consumed != lwc_string_length(token->idata)) goto invalid; /* failed to consume the whole string as a number */ - + alpha = FIXTOINT(FMUL(alpha, F_255)); consumeWhitespace(vector, ctx); @@ -1074,11 +1074,11 @@ css_error css__ident_list_or_string_to_string(css_language *c, lwc_string **result) { const css_token *token; - + token = parserutils_vector_peek(vector, *ctx); if (token == NULL) return CSS_INVALID; - + if (token->type == CSS_TOKEN_STRING) { token = parserutils_vector_iterate(vector, ctx); *result = lwc_string_ref(token->idata); @@ -1087,7 +1087,7 @@ css_error css__ident_list_or_string_to_string(css_language *c, return css__ident_list_to_string(c, vector, ctx, reserved, result); } - + return CSS_INVALID; } @@ -1126,7 +1126,7 @@ css_error css__ident_list_to_string(css_language *c, /* We know this token exists, and is an IDENT */ token = parserutils_vector_iterate(vector, ctx); - /* Consume all subsequent IDENT or S tokens */ + /* Consume all subsequent IDENT or S tokens */ while (token != NULL && (token->type == CSS_TOKEN_IDENT || token->type == CSS_TOKEN_S)) { if (token->type == CSS_TOKEN_IDENT) { @@ -1136,12 +1136,12 @@ css_error css__ident_list_to_string(css_language *c, goto cleanup; } - perror = parserutils_buffer_append(buffer, - (const uint8_t *) lwc_string_data(token->idata), + perror = parserutils_buffer_append(buffer, + (const uint8_t *) lwc_string_data(token->idata), lwc_string_length(token->idata)); } else { /* S */ - perror = parserutils_buffer_append(buffer, + perror = parserutils_buffer_append(buffer, (const uint8_t *) " ", 1); } @@ -1232,7 +1232,7 @@ css_error css__comma_list_to_style(css_language *c, if (error != CSS_OK) goto cleanup; - error = css__stylesheet_style_append(result, + error = css__stylesheet_style_append(result, value); if (error != CSS_OK) goto cleanup; @@ -1251,7 +1251,7 @@ css_error css__comma_list_to_style(css_language *c, css_code_t value = get_value(c, token, first); uint32_t snumber; - error = css__stylesheet_string_add(c->sheet, + error = css__stylesheet_string_add(c->sheet, lwc_string_ref(token->idata), &snumber); if (error != CSS_OK) goto cleanup; diff --git a/src/parse/properties/utils.h b/src/parse/properties/utils.h index b7b31da..e4c97c7 100644 --- a/src/parse/properties/utils.h +++ b/src/parse/properties/utils.h @@ -10,7 +10,7 @@ #include "parse/language.h" -static inline bool is_css_inherit(css_language *c, const css_token *token) +static inline bool is_css_inherit(css_language *c, const css_token *token) { bool match; return ((token->type == CSS_TOKEN_IDENT) && @@ -168,7 +168,7 @@ css_error css__parse_colour_specifier(css_language *c, const parserutils_vector *vector, int *ctx, uint16_t *value, uint32_t *result); -css_error css__parse_named_colour(css_language *c, lwc_string *data, +css_error css__parse_named_colour(css_language *c, lwc_string *data, uint32_t *result); css_error css__parse_hash_colour(lwc_string *data, uint32_t *result); @@ -178,7 +178,7 @@ css_error css__parse_unit_specifier(css_language *c, uint32_t default_unit, css_fixed *length, uint32_t *unit); -css_error css__parse_unit_keyword(const char *ptr, size_t len, +css_error css__parse_unit_keyword(const char *ptr, size_t len, uint32_t *unit); css_error css__ident_list_or_string_to_string(css_language *c, @@ -195,7 +195,7 @@ css_error css__comma_list_to_style(css_language *c, const parserutils_vector *vector, int *ctx, bool (*reserved)(css_language *c, const css_token *ident), css_code_t (*get_value)(css_language *c, - const css_token *token, + const css_token *token, bool first), css_style *result); diff --git a/src/parse/properties/voice_family.c b/src/parse/properties/voice_family.c index 8a969a6..193cb6b 100644 --- a/src/parse/properties/voice_family.c +++ b/src/parse/properties/voice_family.c @@ -83,8 +83,8 @@ static css_code_t voice_family_value(css_language *c, const css_token *token, bo * Post condition: \a *ctx is updated with the next token to process * If the input is invalid, then \a *ctx remains unchanged. */ -css_error css__parse_voice_family(css_language *c, - const parserutils_vector *vector, int *ctx, +css_error css__parse_voice_family(css_language *c, + const parserutils_vector *vector, int *ctx, css_style *result) { int orig_ctx = *ctx; @@ -93,7 +93,7 @@ css_error css__parse_voice_family(css_language *c, bool match; /* [ IDENT+ | STRING ] [ ',' [ IDENT+ | STRING ] ]* | IDENT(inherit) - * + * * In the case of IDENT+, any whitespace between tokens is collapsed to * a single space */ |