snapshot: add explicit cast to fix warning on x86_64 and switch to unsigned