Explorar o código

bitmap lib: use bit manipulation

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@52048 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz %!s(int64=13) %!d(string=hai) anos
pai
achega
191b4610c8
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      lib/bitmap/sparse.c

+ 2 - 2
lib/bitmap/sparse.c

@@ -23,8 +23,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 depth;