summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-11-22 13:03:21 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-11-22 13:03:21 +0000
commit6591ba35f6fa5dc3867c5ff27ebef523ce8729d3 (patch)
tree310e46cb2386d93c29583966728d81411f9f6a00
parente00a1f0dffe58a36d30a93a073da31562a9ffa57 (diff)
downloadlibcss-6591ba35f6fa5dc3867c5ff27ebef523ce8729d3.tar.gz
libcss-6591ba35f6fa5dc3867c5ff27ebef523ce8729d3.tar.bz2
Lose redundant assignments.
Drop some dead code. Avoid a potential NULL dereference. Add missing "break" in initial substate of block context parser svn path=/trunk/libcss/; revision=9678
-rw-r--r--src/parse/language.h2
-rw-r--r--src/parse/parse.c2
-rw-r--r--src/parse/properties/font.c2
-rw-r--r--src/parse/properties/generated_list.c4
-rw-r--r--src/parse/properties/utils.c4
-rw-r--r--src/select/select.c3
6 files changed, 7 insertions, 10 deletions
diff --git a/src/parse/language.h b/src/parse/language.h
index 5668c55..e94053d 100644
--- a/src/parse/language.h
+++ b/src/parse/language.h
@@ -61,7 +61,7 @@ static inline void consumeWhitespace(const parserutils_vector *vector, int *ctx)
while ((token = parserutils_vector_peek(vector, *ctx)) != NULL &&
token->type == CSS_TOKEN_S)
- token = parserutils_vector_iterate(vector, ctx);
+ parserutils_vector_iterate(vector, ctx);
}
/**
diff --git a/src/parse/parse.c b/src/parse/parse.c
index 049cad4..dc5ede1 100644
--- a/src/parse/parse.c
+++ b/src/parse/parse.c
@@ -1448,6 +1448,8 @@ css_error parseBlockContent(css_parser *parser)
return transition(parser, to, subsequent);
}
+
+ break;
case WS:
error = eatWS(parser);
if (error != CSS_OK)
diff --git a/src/parse/properties/font.c b/src/parse/properties/font.c
index 36228c2..e45f46f 100644
--- a/src/parse/properties/font.c
+++ b/src/parse/properties/font.c
@@ -117,8 +117,6 @@ css_error parse_font(css_language *c,
if (error == CSS_OK) {
consumeWhitespace(vector, ctx);
-
- token = parserutils_vector_peek(vector, *ctx);
} else {
break;
}
diff --git a/src/parse/properties/generated_list.c b/src/parse/properties/generated_list.c
index 0eedd02..71de141 100644
--- a/src/parse/properties/generated_list.c
+++ b/src/parse/properties/generated_list.c
@@ -671,7 +671,7 @@ css_error parse_quotes(css_language *c,
close = token->idata;
- token = parserutils_vector_iterate(vector, &temp_ctx);
+ parserutils_vector_iterate(vector, &temp_ctx);
consumeWhitespace(vector, &temp_ctx);
@@ -736,7 +736,7 @@ css_error parse_quotes(css_language *c,
close = token->idata;
- token = parserutils_vector_iterate(vector, ctx);
+ parserutils_vector_iterate(vector, ctx);
consumeWhitespace(vector, ctx);
diff --git a/src/parse/properties/utils.c b/src/parse/properties/utils.c
index c7af699..8676015 100644
--- a/src/parse/properties/utils.c
+++ b/src/parse/properties/utils.c
@@ -48,8 +48,8 @@ css_error parse_colour_specifier(css_language *c,
token->type != CSS_TOKEN_HASH &&
token->type != CSS_TOKEN_FUNCTION)) {
if (c->sheet->quirks_allowed == false ||
- (token != NULL &&
- token->type != CSS_TOKEN_NUMBER &&
+ token == NULL ||
+ (token->type != CSS_TOKEN_NUMBER &&
token->type != CSS_TOKEN_DIMENSION))
goto invalid;
}
diff --git a/src/select/select.c b/src/select/select.c
index eddb491..8224d86 100644
--- a/src/select/select.c
+++ b/src/select/select.c
@@ -417,9 +417,6 @@ css_error set_hint(css_select_state *state, uint32_t i)
/* Retrieve this property's hint from the client */
error = state->handler->node_presentational_hint(state->pw,
state->node, i, &hint);
- if (error != CSS_OK && error != CSS_PROPERTY_NOT_SET)
- return error;
-
if (error != CSS_OK)
return (error == CSS_PROPERTY_NOT_SET) ? CSS_OK : error;