author | Nicolas Pitre <nico@cam.org> | |
Mon, 9 Apr 2007 05:06:29 +0000 (01:06 -0400) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 10 Apr 2007 19:48:14 +0000 (12:48 -0700) | ||
commit | 8723f216263ba4a0f06be7b93fada863c0931e09 | |
tree | 6d357724c891ce009a8c7ae1a0a4083bc39ff1f5 | tree | snapshot |
parent | 57059091fad25427bce9b3d47e073ce0518d164b | commit | diff |
make overflow test on delta base offset work regardless of variable size
This patch introduces the MSB() macro to obtain the desired number of
most significant bits from a given variable independently of the variable
type.
It is then used to better implement the overflow test on the OBJ_OFS_DELTA
base offset variable with the property of always working correctly
regardless of the type/size of that variable.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This patch introduces the MSB() macro to obtain the desired number of
most significant bits from a given variable independently of the variable
type.
It is then used to better implement the overflow test on the OBJ_OFS_DELTA
base offset variable with the property of always working correctly
regardless of the type/size of that variable.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>