diff options
author | Benjamin Otte <otte@redhat.com> | 2019-03-22 17:37:04 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2019-03-22 19:55:34 +0100 |
commit | d9ef734458bf1a2a394c5962787a6351d42f57c6 (patch) | |
tree | 2363a4c60599326af9a1c572fdfa09fc9449f3f9 /gtk/gtkcsseasevalue.c | |
parent | 73760e583515bbefd6b135f522b9450beeab04fb (diff) | |
download | gtk+-d9ef734458bf1a2a394c5962787a6351d42f57c6.tar.gz |
cssparser: Simplify
Remove the uint parser (and use the int parser in the one user of it).
And avoid unnecessarily going through a macro.
Diffstat (limited to 'gtk/gtkcsseasevalue.c')
-rw-r--r-- | gtk/gtkcsseasevalue.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gtk/gtkcsseasevalue.c b/gtk/gtkcsseasevalue.c index a9ab9dce40..ab990af38e 100644 --- a/gtk/gtkcsseasevalue.c +++ b/gtk/gtkcsseasevalue.c @@ -254,7 +254,7 @@ gtk_css_ease_value_parse_cubic_bezier (GtkCssParser *parser) static GtkCssValue * gtk_css_ease_value_parse_steps (GtkCssParser *parser) { - guint n_steps; + int n_steps; gboolean start; if (!_gtk_css_parser_try (parser, "(", TRUE)) @@ -263,11 +263,16 @@ gtk_css_ease_value_parse_steps (GtkCssParser *parser) return NULL; } - if (!_gtk_css_parser_try_uint (parser, &n_steps)) + if (!_gtk_css_parser_try_int (parser, &n_steps)) { _gtk_css_parser_error (parser, "Expected number of steps"); return NULL; } + else if (n_steps < 1) + { + _gtk_css_parser_error (parser, "Number of steps must be > 0"); + return NULL; + } if (_gtk_css_parser_try (parser, ",", TRUE)) { |