[GRASS-SVN] r65985 - grass-addons/grass7/raster/r.wateroutlet.lessmem

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Aug 21 01:09:26 PDT 2015


Author: hcho
Date: 2015-08-21 01:09:26 -0700 (Fri, 21 Aug 2015)
New Revision: 65985

Modified:
   grass-addons/grass7/raster/r.wateroutlet.lessmem/global.h
Log:
r.wateroutlet.lessmem: 0xff XOR => NOT

Modified: grass-addons/grass7/raster/r.wateroutlet.lessmem/global.h
===================================================================
--- grass-addons/grass7/raster/r.wateroutlet.lessmem/global.h	2015-08-21 07:38:35 UTC (rev 65984)
+++ grass-addons/grass7/raster/r.wateroutlet.lessmem/global.h	2015-08-21 08:09:26 UTC (rev 65985)
@@ -1,11 +1,11 @@
 #define BITSIZE (((nrows * ncols) >> 3) + ((nrows * ncols) & 7 ? 1 : 0))
 #define SETBIT(b, r, c) \
     b[((r) * ncols + (c)) >> 3] = \
-    (b[((r) * ncols + (c)) >> 3] & (0xff ^ (1 << (((r) * ncols + (c)) & 7)))) \
+    (b[((r) * ncols + (c)) >> 3] & ~(1 << (((r) * ncols + (c)) & 7))) \
     | (1 << (((r) * ncols + (c)) & 7))
 #define CLEARBIT(b, r, c) \
     b[((r) * ncols + (c)) >> 3] = \
-    b[((r) * ncols + (c)) >> 3] & (0xff ^ (1 << (((r) * ncols + (c)) & 7)))
+    b[((r) * ncols + (c)) >> 3] & ~(1 << (((r) * ncols + (c)) & 7))
 #define GETBIT(b, r, c) \
     ((b[((r) * ncols + (c)) >> 3] & (1 << (((r) * ncols + (c)) & 7))) \
      >> (((r) * ncols + (c)) & 7))
@@ -14,7 +14,7 @@
 #define SETDIR(b, r, c, d) \
     b[((r) * ncols + (c)) >> 1] = \
     (b[((r) * ncols + (c)) >> 1] & \
-     (0xff ^ (15 << (((r) * ncols + (c)) & 1 ? 4 : 0)))) \
+     ~(15 << (((r) * ncols + (c)) & 1 ? 4 : 0))) \
     | ((d) << (((r) * ncols + (c)) & 1 ? 4 : 0))
 #define GETDIR(b, r, c) \
     ((b[((r) * ncols + (c)) >> 1] & (15 << (((r) * ncols + (c)) & 1 ? 4 : 0))) \



More information about the grass-commit mailing list