Skip to content
Commit e3f1212b authored by Owen W. Taylor's avatar Owen W. Taylor
Browse files

Make color constants work without warnings

The code for defining a color as a constant had broken logic: it
would try to parse the color first as an double, then as an integer;
the second attempt would produce an error about overwriting the
already-set-GError. Then it would clear the error and store the constant
as a color.

Use the fact that colors have to start with a letter or #, divide the
space of constants into:

 - Integers
 - Doubles
 - Colors

so we get good error messages. Based on a patch by
William Jon McCann <jmccann@redhat.com>.

Note that this breaks the ability to specify an integer constant as
identical to another integer constant (the same didn't work for doubles.)
I think this was an accidental side effect of the code and not something
that was intentional or people were relying on

https://bugzilla.gnome.org/show_bug.cgi?id=632116
parent 42331b96
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment