X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=turbopfor-encode.h;h=24e007cdc070e902bb9ea4b250b9d8bbb1d33505;hb=48c7096c3265d2cbaec95fddfea72530779b69e1;hp=d149ae75ce85dd6b4a08392d652e991c488d22d0;hpb=7380a624a1203b0eb3734c65cc1ebdbcbdf358f0;p=plocate diff --git a/turbopfor-encode.h b/turbopfor-encode.h index d149ae7..24e007c 100644 --- a/turbopfor-encode.h +++ b/turbopfor-encode.h @@ -15,6 +15,9 @@ #include #include +#ifdef HAS_ENDIAN_H +#include +#endif #include #include #include @@ -101,8 +104,8 @@ inline unsigned num_bits(Docid x) return sizeof(Docid) * CHAR_BIT - __builtin_clz(x); } #else - for (int i = sizeof(Docid) * CHAR_BIT; i-- > 0; ) { - if (x & (Docid{1} << i)) { + for (int i = sizeof(Docid) * CHAR_BIT; i-- > 0;) { + if (x & (Docid{ 1 } << i)) { return i; } }