aboutsummaryrefslogtreecommitdiff
path: root/src/common/torint.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-04-26 13:00:46 -0400
committerNick Mathewson <nickm@torproject.org>2011-04-26 13:03:58 -0400
commit43ffd023e9267927539dc9c12bee86199cd1c800 (patch)
treea1eb428d7470f916154bec88ec5539892ab75aa1 /src/common/torint.h
parente98583594d897ac32745061143e565c6f4b45f97 (diff)
downloadtor-43ffd023e9267927539dc9c12bee86199cd1c800.tar.gz
tor-43ffd023e9267927539dc9c12bee86199cd1c800.zip
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.
Diffstat (limited to 'src/common/torint.h')
-rw-r--r--src/common/torint.h4
1 files changed, 3 insertions, 1 deletions
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 */