cast sizeof() to unsigned to avoid warnings on 64-bit