Index: main/branches/64_bit_Greenstone/greenstone2/common-src/indexers/mg/lib/bitio_m.h
===================================================================
--- main/branches/64_bit_Greenstone/greenstone2/common-src/indexers/mg/lib/bitio_m.h	(revision 23506)
+++ main/branches/64_bit_Greenstone/greenstone2/common-src/indexers/mg/lib/bitio_m.h	(revision 23508)
@@ -50,5 +50,5 @@
 #define POSITIVE(f, x)							\
   if ((x)<=0) 								\
-    fprintf(stderr,"Error: Cannot "#f" encode %lu\n",(unsigned long)x),exit(1);
+    fprintf(stderr,"Error: Cannot "#f" encode %d\n",(mg_u_long)x),exit(1);
 
 
@@ -75,5 +75,5 @@
 #define UNARY_ENCODE(x)							\
 do {									\
-  register unsigned long _B_x = (x);					\
+  register mg_u_long _B_x = (x);					\
   BIO_ENCODE_PROLOGUE;							\
   POSITIVE(unary, _B_x);						\
@@ -85,5 +85,5 @@
 #define UNARY_ENCODE_L(x, count)					\
 do {									\
-  register unsigned long _B_x = (x);					\
+  register mg_u_long _B_x = (x);					\
   BIO_ENCODE_PROLOGUE;							\
   POSITIVE(unary, _B_x);						\
@@ -124,6 +124,6 @@
 #define BINARY_ENCODE(x, b)						\
 do {									\
-  register unsigned long _B_x = (x);					\
-  register unsigned long _B_b = (b);					\
+  register mg_u_long _B_x = (x);					\
+  register mg_u_long _B_b = (b);					\
   register int _B_nbits, _B_logofb, _B_thresh;				\
   BIO_ENCODE_PROLOGUE;							\
@@ -145,6 +145,6 @@
 #define BINARY_ENCODE_L(x, b, count)					\
 do {									\
-  register unsigned long _B_x = (x);					\
-  register unsigned long _B_b = (b);					\
+  register mg_u_long _B_x = (x);					\
+  register mg_u_long _B_b = (b);					\
   register int _B_nbits, _B_logofb, _B_thresh;				\
   BIO_ENCODE_PROLOGUE;							\
@@ -168,6 +168,6 @@
 #define BINARY_DECODE(x, b)						\
 do {									\
-  register unsigned long _B_x = 0;					\
-  register unsigned long _B_b = (b);					\
+  register mg_u_long _B_x = 0;					\
+  register mg_u_long _B_b = (b);					\
   register int _B_i, _B_logofb, _B_thresh;				\
   BIO_DECODE_PROLOGUE;							\
@@ -193,6 +193,6 @@
 #define BINARY_DECODE_L(x, b, count)					\
 do {									\
-  register unsigned long _B_x = 0;					\
-  register unsigned long _B_b = (b);					\
+  register mg_u_long _B_x = 0;					\
+  register mg_u_long _B_b = (b);					\
   register int _B_i, _B_logofb, _B_thresh;				\
   BIO_DECODE_PROLOGUE;							\
@@ -220,6 +220,6 @@
 #define BINARY_LENGTH(x, b, count)					\
 do {									\
-  register unsigned long _B_x = (x);					\
-  register unsigned long _B_b = (b);					\
+  register mg_u_long _B_x = (x);					\
+  register mg_u_long _B_b = (b);					\
   register int _B_nbits, _B_logofb, _B_thresh;				\
   POSITIVE(binary, _B_x);						\
@@ -240,5 +240,5 @@
 #define GAMMA_ENCODE(x)							\
 do {									\
-  register unsigned long _B_xx = (x);					\
+  register mg_u_long _B_xx = (x);					\
   register int _B_logofb;						\
   register int _B_nbits;						\
@@ -255,5 +255,5 @@
 #define GAMMA_ENCODE_L(x, count)					\
 do {									\
-  register unsigned long _B_xx = (x);					\
+  register mg_u_long _B_xx = (x);					\
   register int _B_logofb;						\
   register int _B_nbits;						\
@@ -271,5 +271,5 @@
 #define GAMMA_DECODE(x)							\
 do {									\
-  register unsigned long _B_xx = 1;					\
+  register mg_u_long _B_xx = 1;					\
   register int _B_nbits = 0;						\
   BIO_DECODE_PROLOGUE;							\
@@ -283,5 +283,5 @@
 #define GAMMA_DECODE_L(x, count)					\
 do {									\
-  register unsigned long _B_xx = 1;					\
+  register mg_u_long _B_xx = 1;					\
   register int _B_nbits = 0;						\
   BIO_DECODE_PROLOGUE;							\
@@ -296,5 +296,5 @@
 #define GAMMA_LENGTH(x, count)						\
 do {									\
-  register unsigned long _B_xx = (x);					\
+  register mg_u_long _B_xx = (x);					\
   register int _B_logofb;						\
   POSITIVE(gamma, _B_xx);						\
@@ -310,5 +310,5 @@
 #define DELTA_ENCODE(x)							\
 do {									\
-  register unsigned long _B_xxx = (x);					\
+  register mg_u_long _B_xxx = (x);					\
   register int _B_logx;							\
   FLOORLOG_2(_B_xxx, _B_logx);						\
@@ -319,5 +319,5 @@
 #define DELTA_ENCODE_L(x, count)					\
 do {									\
-  register unsigned long _B_xxx = (x);					\
+  register mg_u_long _B_xxx = (x);					\
   register int _B_logx;							\
   FLOORLOG_2(_B_xxx, _B_logx);						\
@@ -329,5 +329,5 @@
 #define DELTA_DECODE(x)							\
 do {									\
-  register unsigned long _B_xxx;					\
+  register mg_u_long _B_xxx;					\
   register int _B_logx;							\
   GAMMA_DECODE(_B_logx); --_B_logx;					\
@@ -338,5 +338,5 @@
 #define DELTA_DECODE_L(x, count)					\
 do {									\
-  register unsigned long _B_xxx;					\
+  register mg_u_long _B_xxx;					\
   register int _B_logx;							\
   GAMMA_DECODE_L(_B_logx, count); --_B_logx;				\
@@ -347,5 +347,5 @@
 #define DELTA_LENGTH(x, count)						\
 do {									\
-  register unsigned long _B_xxx = (x);					\
+  register mg_u_long _B_xxx = (x);					\
   register int _B_logx, _B_dcount;					\
   FLOORLOG_2(_B_xxx, _B_logx);						\
@@ -363,6 +363,6 @@
 #define ELIAS_ENCODE(x, b, s)						\
 do {									\
-  register unsigned long _B_xx = (x);					\
-  register unsigned long _B_b = (b);					\
+  register mg_u_long _B_xx = (x);					\
+  register mg_u_long _B_b = (b);					\
   register double _B_s = (s);						\
   register int _B_lower=1, _B_upper=1;					\
@@ -383,6 +383,6 @@
 #define ELIAS_ENCODE_L(x, b, s, count)					\
 do {									\
-  register unsigned long _B_xx = (x);					\
-  register unsigned long _B_b = (b);					\
+  register mg_u_long _B_xx = (x);					\
+  register mg_u_long _B_b = (b);					\
   register double _B_s = (s);						\
   register int _B_lower=1, _B_upper=1;					\
@@ -403,6 +403,6 @@
 #define ELIAS_DECODE(x, b, s)						\
 do {									\
-  register unsigned long _B_xx;						\
-  register unsigned long _B_b = (b);					\
+  register mg_u_long _B_xx;						\
+  register mg_u_long _B_b = (b);					\
   register double _B_s = (s);						\
   register int _B_lower=1, _B_upper=1;					\
@@ -423,6 +423,6 @@
 #define ELIAS_DECODE_L(x, b, s, count)					\
 do {									\
-  register unsigned long _B_xx;						\
-  register unsigned long _B_b = (b);					\
+  register mg_u_long _B_xx;						\
+  register mg_u_long _B_b = (b);					\
   register double _B_s = (s);						\
   register int _B_lower=1, _B_upper=1;					\
@@ -443,6 +443,6 @@
 #define ELIAS_LENGTH(x, b, s, count)					\
 do {									\
-  register unsigned long _B_xx = (x);					\
-  register unsigned long _B_b = (b);					\
+  register mg_u_long _B_xx = (x);					\
+  register mg_u_long _B_b = (b);					\
   register double _B_s = (s);						\
   register int _B_lower=1, _B_upper=1;					\
@@ -468,6 +468,6 @@
 #define BBLOCK_ENCODE(x, b)						\
 do {									\
-  register unsigned long _B_xx = (x);					\
-  register unsigned long _B_bb = (b);					\
+  register mg_u_long _B_xx = (x);					\
+  register mg_u_long _B_bb = (b);					\
   register int _B_xdivb = 0;						\
   POSITIVE(bblock, _B_xx);						\
@@ -484,6 +484,6 @@
 #define BBLOCK_ENCODE_L(x, b, count)					\
 do {									\
-  register unsigned long _B_xx = (x);					\
-  register unsigned long _B_bb = (b);					\
+  register mg_u_long _B_xx = (x);					\
+  register mg_u_long _B_bb = (b);					\
   register int _B_xdivb = 0;						\
   POSITIVE(bblock, _B_xx);						\
@@ -500,6 +500,6 @@
 #define BBLOCK_DECODE(x, b)						\
 do {									\
-  register unsigned long _B_x1, _B_xx = 0;				\
-  register unsigned long _B_bb = (b);					\
+  register mg_u_long _B_x1, _B_xx = 0;				\
+  register mg_u_long _B_bb = (b);					\
   register int _B_xdivb;						\
   UNARY_DECODE(_B_xdivb); --_B_xdivb;					\
@@ -512,6 +512,6 @@
 #define BBLOCK_DECODE_L(x, b, count)					\
 do {									\
-  register unsigned long _B_x1, _B_xx = 0;				\
-  register unsigned long _B_bb = (b);					\
+  register mg_u_long _B_x1, _B_xx = 0;				\
+  register mg_u_long _B_bb = (b);					\
   register int _B_xdivb;						\
   UNARY_DECODE_L(_B_xdivb, count); --_B_xdivb;				\
@@ -524,6 +524,6 @@
 #define BBLOCK_LENGTH(x, b, count)					\
 do {									\
-  register unsigned long _B_bcount, _B_xx = (x);			\
-  register unsigned long _B_bb = (b);					\
+  register mg_u_long _B_bcount, _B_xx = (x);			\
+  register mg_u_long _B_bb = (b);					\
   register int _B_xdivb = 0;						\
   POSITIVE(bblock, _B_xx);						\
