New rank/select data structure based on sadakane's code
[SXSI/XMLTree.git] / libcds / src / static_sequence / wt_node_internal.cpp
index 6f67501..16dc441 100644 (file)
@@ -183,7 +183,7 @@ uint wt_node_internal::rankLessThan(uint &symbol, uint pos, uint l, wt_coder * c
 
 //    cout << "recursion to leftchild at l = " << l << ", symbol = " << (uchar)symbol << ", rank0 = " << bitmap->rank0(pos) << ", rank1 = " << bitmap->rank1(pos) << endl;
     // check left child for symbols <= givenSymbol
-    if (result != -1 || left_child == NULL)
+    if (result != (uint)-1 || left_child == NULL)
         return result;
     return left_child->rankLessThan(symbol, bitmap->rank0(pos)-1);
 }
@@ -195,11 +195,11 @@ uint wt_node_internal::rankLessThan(uint &symbol, uint pos)
     using std::endl;
 //    cout << "pos = " << pos << ", symbol = " << (uchar)symbol << endl;
     
-    if (pos == -1)
-        return -1;
+    if (pos == (uint)-1)
+        return (uint)-1;
     if(right_child!=NULL)
         result = right_child->rankLessThan(symbol, bitmap->rank1(pos)-1);
-    if(result == -1 && left_child!=NULL)
+    if(result == (uint)-1 && left_child!=NULL)
         return left_child->rankLessThan(symbol, bitmap->rank0(pos)-1);
     return result;
 }