summaryrefslogtreecommitdiff
path: root/Xi/xiqueryversion.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-05-11 12:20:50 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-05-13 09:41:50 +1000
commitffd4874798ba54f86acac75779a15b4babeaa5f3 (patch)
tree8c6d1954542686e82734fa4f0999cddddd9284dd /Xi/xiqueryversion.c
parentc4f9c3a07dbb05b81c8e2193a083102f710ebb27 (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 'Xi/xiqueryversion.c')
-rw-r--r--Xi/xiqueryversion.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/Xi/xiqueryversion.c b/Xi/xiqueryversion.c
index ae63297da..f647f9872 100644
--- a/Xi/xiqueryversion.c
+++ b/Xi/xiqueryversion.c
@@ -58,7 +58,6 @@ ProcXIQueryVersion(ClientPtr client)
xXIQueryVersionReply rep;
XIClientPtr pXIClient;
int major, minor;
- unsigned int sversion, cversion;
REQUEST(xXIQueryVersionReq);
REQUEST_SIZE_MATCH(xXIQueryVersionReq);
@@ -72,10 +71,8 @@ ProcXIQueryVersion(ClientPtr client)
pXIClient = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey);
- sversion = XIVersion.major_version * 1000 + XIVersion.minor_version;
- cversion = stuff->major_version * 1000 + stuff->minor_version;
-
- if (sversion > cversion)
+ if (version_compare(XIVersion.major_version, XIVersion.minor_version,
+ stuff->major_version, stuff->minor_version) > 0)
{
major = stuff->major_version;
minor = stuff->minor_version;