vol: Don't use MAX_INT when UINT_MAX will do
authorSimon Wilkinson <sxw@your-file-system.com>
Sat, 2 Apr 2011 14:00:27 +0000 (15:00 +0100)
committerDerrick Brashear <shadow@dementia.org>
Mon, 4 Apr 2011 19:12:04 +0000 (12:12 -0700)
limits.h provides us with UINT_MAX, so use this for the maxmimum
size of an unsigned integer, rather than trying to grow our own.

Change-Id: Ia23c45a9e295589929374a8324ea2b3d268ae6c0
Reviewed-on: http://gerrit.openafs.org/4420
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

src/vol/vnode.c

index 91684ae..209d952 100644 (file)
@@ -20,9 +20,7 @@
 
 #include <roken.h>
 
-#ifndef MAXINT
-#define MAXINT     (~(1<<((sizeof(int)*8)-1)))
-#endif
+#include <limits.h>
 
 #include <errno.h>
 #include <stdio.h>
@@ -1386,7 +1384,7 @@ VPutVnode_r(Error * ec, Vnode * vnp)
            if (vnp->changed_newTime)
            {
                V_updateDate(vp) = vp->updateTime = now;
-               if(V_volUpCounter(vp)<MAXINT)
+               if(V_volUpCounter(vp)< UINT_MAX)
                        V_volUpCounter(vp)++;
            }