Various fixes, mainly tagged_sibling/select_sibling.
[SXSI/XMLTree.git] / bit-vector.hpp
index cd6382e..697581d 100644 (file)
@@ -117,7 +117,9 @@ private:
  */
 inline bool bit_vector::unsafe_get(size_t idx) const
 {
-  return (_vector[idx / W] >> (idx % W)) & true;
+  size_t i = idx / W;
+  size_t j = idx % W;
+  return (_vector[i] >> (W - 1 - j)) & true;
 };
 
 /** Unsafe version of get_field. Does not perform bound checking.
@@ -125,6 +127,7 @@ inline bool bit_vector::unsafe_get(size_t idx) const
 */
 inline uint32_t bit_vector::unsafe_get_field(size_t idx, size_t len) const
 {
+  //TODO FIX TO REFLECT BIG ENDIAN ORDER.
   switch (len){
   case 8:
     return ((uint8_t*)_vector)[idx];