From f58b31b7fb4a14481ee39312b113e551557b593f Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Mon, 29 Feb 2016 21:17:57 +0100 Subject: [PATCH] include: fix sign extension in GBIT64 It fixes the "negative i/o offset" error that happens when doing i/o on files larger than 2 GB. --- include/fcall.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fcall.h b/include/fcall.h index 3fc3a58..0b06e62 100644 --- a/include/fcall.h +++ b/include/fcall.h @@ -37,7 +37,7 @@ struct Fcall #define GBIT8(p) ((p)[0]) #define GBIT16(p) ((p)[0]|((p)[1]<<8)) #define GBIT32(p) ((p)[0]|((p)[1]<<8)|((p)[2]<<16)|((p)[3]<<24)) -#define GBIT64(p) ((vlong)((p)[0]|((p)[1]<<8)|((p)[2]<<16)|((p)[3]<<24)) |\ +#define GBIT64(p) ((u32int)((p)[0]|((p)[1]<<8)|((p)[2]<<16)|((p)[3]<<24)) |\ ((vlong)((p)[4]|((p)[5]<<8)|((p)[6]<<16)|((p)[7]<<24)) << 32)) #define PBIT8(p,v) (p)[0]=(v)