typesafe: fix warnings with gcc's -Wpointer-arith