Fix SEGV on 32-bit architectures

Fixes #1

Previously lengths were passed to functions as `int` but the function prototype requires `long long`.  64-bit ruby was fine with this, but 32 bit barfed.