[waffle] [PATCH 2/2] wflinfo: Properly handle minor versions > 9

Jordan Justen jljusten at gmail.com
Wed Apr 30 10:27:04 PDT 2014


On Tue, Apr 29, 2014 at 1:12 PM, Dylan Baker <baker.dylan.c at gmail.com> wrote:
> On Tuesday, April 29, 2014 08:39:19 Jordan Justen wrote:
>> Previously -V 1.40 would be treated the same as -V 5.0.
>>
>> Instead, whenever a minor version is requested greater
>> than 9, bump the major version, and use 0 for the minor
>> version.
>>
>> This leads to -V 1.40 being interpreted as -V 2.0.
>>
>> Alternatively, we might treat minor versions greater
>> than 9 as an error.
>>
>> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
>> ---
>> src/utils/wflinfo.c | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>
>> diff --git a/src/utils/wflinfo.c b/src/utils/wflinfo.c
>> index 386bdd0..982311d 100644
>> --- a/src/utils/wflinfo.c
>> +++ b/src/utils/wflinfo.c
>> @@ -336,6 +336,12 @@ parse_args(int argc, char *argv[], struct options
>> *opts)
>> usage_error_printf("'%s' is not a valid OpenGL version",
>> optarg);
>> }
>> + if (minor > 9) {
>> + // If a minor version greater than 9 was requested, then
>> + // bump the major version and use 0 for the minor.
>> + major++;
>> + minor = 0;
>> + }
>> opts->context_version = 10 * major + minor;
>> break;
>> }
>>
>
> As a consumer of wflinfo I would prefer to see a bad version treated as an
> error.

I could see wflinfo deciding that minor > 9 is always an error.

But, I don't want to check the version again a known set of good
versions because:
* New spec/driver versions could be used with older wflinfo builds
* Different versions per API
* I'd rather leave it to libwaffle/driver to reject the version

Maybe a better fix is to not store major/minor from the user as major
* 10 + minor.

-Jordan


More information about the waffle mailing list