]> git.saurik.com Git - wxWidgets.git/commitdiff
Only return -1,0,1 from wxXmlResource::CompareVersion().
authorVáclav Slavík <vslavik@fastmail.fm>
Wed, 10 Jul 2013 16:38:19 +0000 (16:38 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Wed, 10 Jul 2013 16:38:19 +0000 (16:38 +0000)
In other words, do as the comment says.  Also fixes an implicit
conversion warning.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74472 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/xrc/xmlres.h

index 23cbea1c518e9decce971d756b5981c06d3921e5..035ba9c711f55a3fb9f169df15648c30c9225cb6 100644 (file)
@@ -261,8 +261,16 @@ public:
     // Compares resources version to argument. Returns -1 if resources version
     // is less than the argument, +1 if greater and 0 if they equal.
     int CompareVersion(int major, int minor, int release, int revision) const
-        { return GetVersion() -
-                 (major*256*256*256 + minor*256*256 + release*256 + revision); }
+    {
+        long diff = GetVersion() -
+                    (major*256*256*256 + minor*256*256 + release*256 + revision);
+        if ( diff < 0 )
+            return -1;
+        else if ( diff > 0 )
+            return +1;
+        else
+            return 0;
+    }
 
     //// Singleton accessors.