Remove suprious printing.
[SXSI/libcds.git] / src / static_bitsequence / sdarray.cpp
index 43dea90..d0a4066 100644 (file)
@@ -1,4 +1,5 @@
 #include <sdarray.h>
+#include <stdint.h>
 using std::min;
 using std::max;
 #if 0
@@ -131,10 +132,10 @@ uint __getbits_aux(uint *B, int i, int d) {
 
 static uint __getbits(uint *B, int i, int d)
 {
-  ulong x;
+  uint64_t x;
   B += (i >> logD);
   i &= (D-1);
-  x = ((ulong *) B)[0];
+  x = ((uint64_t *) B)[0];
   x = (x << 32)|(x >> 32);
   x = (x << i) >> (2*D - d);
   return x;
@@ -264,7 +265,7 @@ int selectd2_construct(selectd2 *select, int n, uchar *buf) {
   int i,m;
   int nl;
   int p,pp;
-  int il,is,ml,ms;
+  int il,is,ms,ml;
   int r;
   uint *s;
 
@@ -301,6 +302,7 @@ int selectd2_construct(selectd2 *select, int n, uchar *buf) {
   for(int k=0;k<nl+1;k++) select->p[k]=0;
   select->size += (nl+1)*sizeof(uint);
 
+  
   for (r = 0; r < 2; r++) {
     ml = ms = 0;
     for (il = 0; il < nl; il++) {
@@ -308,7 +310,8 @@ int selectd2_construct(selectd2 *select, int n, uchar *buf) {
       select->lp[il] = pp;
       i = min((il+1)*L-1,m-1);
       p = s[i];
-      //printf("%d ",p-pp);
+      // printf("p-pp=%d, LL=%d\n",p-pp, LL);
+
       if (p - pp >= LL) {
         if (r == 1) {
           for (is = 0; is < L; is++) {
@@ -316,6 +319,7 @@ int selectd2_construct(selectd2 *select, int n, uchar *buf) {
             select->sl[ml*L+is] = s[il*L+is];
           }
         }
+
         select->p[il] = -((ml<<logL)+1);
         ml++;
       }
@@ -330,6 +334,7 @@ int selectd2_construct(selectd2 *select, int n, uchar *buf) {
         ms++;
       }
     }
+
     if (r == 0) {
       select->sl = new uint[ml*L+1];
       for(int k=0;k<ml*L+1;k++) select->sl[k]=0;