我正在检查一些从 C 转换为 C# 的代码。我对原始 C 有一个问题:
...
#define getblock(p, i) (p[i])
...
void MurmurHash3_x86_32 ( const void * key, int len,
uint32_t seed, void * out )
{
const uint8_t * data = (const uint8_t*)key;
const int nblocks = len / 4;
int i;
uint32_t h1 = seed;
uint32_t c1 = 0xcc9e2d51;
uint32_t c2 = 0x1b873593;
const uint32_t * blocks = (const uint32_t *)(data + nblocks*4);
for(i = -nblocks; i; i++)
{
uint32_t k1 = getblock(blocks,i);
...
这部分for(i = -nblocks; i; i++) ...
是向后循环数据吗?我从未见过用负索引引用的数据。