diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-05-11 12:20:50 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-05-13 09:41:50 +1000 |
commit | ffd4874798ba54f86acac75779a15b4babeaa5f3 (patch) | |
tree | 8c6d1954542686e82734fa4f0999cddddd9284dd /xfixes | |
parent | c4f9c3a07dbb05b81c8e2193a083102f710ebb27 (diff) |
include: add version_compare helper function
Compare two version numbers in the major.minor form.
Switch the few users of manual version switching over to the new function.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Diffstat (limited to 'xfixes')
-rw-r--r-- | xfixes/xfixes.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/xfixes/xfixes.c b/xfixes/xfixes.c index e8c7bf161..54f0df341 100644 --- a/xfixes/xfixes.c +++ b/xfixes/xfixes.c @@ -72,17 +72,17 @@ ProcXFixesQueryVersion(ClientPtr client) rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; - if (stuff->majorVersion < SERVER_XFIXES_MAJOR_VERSION) { + + if (version_compare(stuff->majorVersion, stuff->minorVersion, + SERVER_XFIXES_MAJOR_VERSION, SERVER_XFIXES_MAJOR_VERSION) < 0) + { rep.majorVersion = stuff->majorVersion; rep.minorVersion = stuff->minorVersion; } else { rep.majorVersion = SERVER_XFIXES_MAJOR_VERSION; - if (stuff->majorVersion == SERVER_XFIXES_MAJOR_VERSION && - stuff->minorVersion < SERVER_XFIXES_MINOR_VERSION) - rep.minorVersion = stuff->minorVersion; - else - rep.minorVersion = SERVER_XFIXES_MINOR_VERSION; + rep.minorVersion = SERVER_XFIXES_MINOR_VERSION; } + pXFixesClient->major_version = rep.majorVersion; pXFixesClient->minor_version = rep.minorVersion; if (client->swapped) { |