diff --git a/faiss/invlists/DirectMap.cpp b/faiss/invlists/DirectMap.cpp index b276b764ec..2b272922d5 100644 --- a/faiss/invlists/DirectMap.cpp +++ b/faiss/invlists/DirectMap.cpp @@ -199,7 +199,7 @@ size_t DirectMap::remove_ids(const IDSelector& sel, InvertedLists* invlists) { last_id, ScopedCodes(invlists, list_no, last).get()); // update hash entry for last element - hashtable[last_id] = list_no << 32 | offset; + hashtable[last_id] = lo_build(list_no, offset); } invlists->resize(list_no, last); nremove++; diff --git a/faiss/invlists/OnDiskInvertedLists.cpp b/faiss/invlists/OnDiskInvertedLists.cpp index 825ccfbb90..81f76dbf7f 100644 --- a/faiss/invlists/OnDiskInvertedLists.cpp +++ b/faiss/invlists/OnDiskInvertedLists.cpp @@ -524,7 +524,7 @@ void OnDiskInvertedLists::free_slot(size_t offset, size_t capacity) { it++; } - size_t inf = 1UL << 60; + size_t inf = ((size_t)1) << 60; size_t end_prev = inf; if (it != slots.begin()) { @@ -533,7 +533,7 @@ void OnDiskInvertedLists::free_slot(size_t offset, size_t capacity) { end_prev = prev->offset + prev->capacity; } - size_t begin_next = 1L << 60; + size_t begin_next = ((size_t)1) << 60; if (it != slots.end()) { begin_next = it->offset; }