[C++] unified the use of size_t, std::int32_t and int to represent offsets and sizes, with index_t, which is a signed 32 integer to maintain compatiblity with Java implementation