From 43ffd023e9267927539dc9c12bee86199cd1c800 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 26 Apr 2011 13:00:46 -0400 Subject: Make SIZE_T_CEILING unsigned; add a signed SSIZE_T_CEILING None of the comparisons were _broken_ previously, but avoiding signed/unsigned comparisons makes everybody happier. Fixes bug2475. --- src/common/torint.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/common/torint.h') diff --git a/src/common/torint.h b/src/common/torint.h index 2a9fba6fcf..d489684656 100644 --- a/src/common/torint.h +++ b/src/common/torint.h @@ -330,8 +330,10 @@ typedef uint32_t uintptr_t; #endif #endif +/* Any ssize_t larger than this amount is likely to be an underflow. */ +#define SSIZE_T_CEILING ((ssize_t)(SSIZE_T_MAX-16)) /* Any size_t larger than this amount is likely to be an underflow. */ -#define SIZE_T_CEILING (SSIZE_T_MAX-16) +#define SIZE_T_CEILING ((size_t)(SSIZE_T_MAX-16)) #endif /* __TORINT_H */ -- cgit v1.2.3-54-g00ecf