[GRASS-SVN] r52043 - grass/trunk/lib/bitmap

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jun 12 04:48:21 PDT 2012


Author: mmetz
Date: 2012-06-12 04:48:20 -0700 (Tue, 12 Jun 2012)
New Revision: 52043

Modified:
   grass/trunk/lib/bitmap/bitmap.c
Log:
bitmap lib: use bit manipulation

Modified: grass/trunk/lib/bitmap/bitmap.c
===================================================================
--- grass/trunk/lib/bitmap/bitmap.c	2012-06-12 11:45:59 UTC (rev 52042)
+++ grass/trunk/lib/bitmap/bitmap.c	2012-06-12 11:48:20 UTC (rev 52043)
@@ -38,8 +38,8 @@
 #include <grass/bitmap.h>
 
 
-#define BM_col_to_byte(x)  ((x)/8)
-#define BM_col_to_bit(x)   ((x)%8)
+#define BM_col_to_byte(x)  ((x) >> 3)  /* x / 8 */
+#define BM_col_to_bit(x)   ((x) & 7)   /* x % 8 */
 
 static int Mode = BM_FLAT;
 static int Size = 1;



More information about the grass-commit mailing list