diff --git a/c_api/index_io_c_ex.cpp b/c_api/index_io_c_ex.cpp index ef2110dbe6..adcbe77b32 100644 --- a/c_api/index_io_c_ex.cpp +++ b/c_api/index_io_c_ex.cpp @@ -17,11 +17,11 @@ using faiss::Index; using faiss::IndexBinary; -int faiss_write_index_buf(const FaissIndex* idx, size_t* size, unsigned char** buf) { +int faiss_write_index_buf(const FaissIndex* idx, size_t* size, uint8_t** buf) { try { faiss::VectorIOWriter writer; faiss::write_index(reinterpret_cast(idx), &writer); - unsigned char* tempBuf = (unsigned char*)malloc((writer.data.size()) * sizeof(uint8_t)); + uint8_t* tempBuf = (uint8_t*)malloc((writer.data.size()) * sizeof(uint8_t)); std::copy(writer.data.begin(), writer.data.end(), tempBuf); *buf = tempBuf; *size = writer.data.size(); diff --git a/c_api/index_io_c_ex.h b/c_api/index_io_c_ex.h index 7c85409b8c..31f0339477 100644 --- a/c_api/index_io_c_ex.h +++ b/c_api/index_io_c_ex.h @@ -31,11 +31,11 @@ extern "C" { /** Write index to buffer */ -int faiss_write_index_buf(const FaissIndex* idx, size_t* buf_size, unsigned char** buf); +int faiss_write_index_buf(const FaissIndex* idx, size_t* buf_size, uint8_t** buf); /** Read index from buffer */ -int faiss_read_index_buf(const unsigned char* buf, size_t limit, int io_flags, +int faiss_read_index_buf(const uint8_t* buf, size_t limit, int io_flags, FaissIndex** p_out); #ifdef __cplusplus