From 5bf926ba4c8047b5dec75be2277d5f9b78fc04c2 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Mon, 2 Nov 2009 18:00:40 +0000 Subject: Clean up a bunch of signed/unsigned comparison warnings git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23120 dc483132-0cff-0310-8789-dd5450dbe970 --- src/util/t_array.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/util/t_array.pm') diff --git a/src/util/t_array.pm b/src/util/t_array.pm index ed319d60d..4a05ab866 100644 --- a/src/util/t_array.pm +++ b/src/util/t_array.pm @@ -67,15 +67,15 @@ static inline long return arr->allocated; } -static inline long +static inline unsigned long _max_size( *arr) { size_t upper_bound; upper_bound = SIZE_MAX / sizeof(*arr->elts); - if (upper_bound > LONG_MAX) - upper_bound = LONG_MAX; - return (long) upper_bound; + if (upper_bound > ULONG_MAX) + upper_bound = ULONG_MAX; + return (unsigned long) upper_bound; } static inline int @@ -105,7 +105,7 @@ static inline int static inline * _getaddr ( *arr, long idx) { - if (idx < 0 || idx >= arr->allocated) + if (idx < 0 || (unsigned long) idx >= arr->allocated) abort(); return arr->elts + idx; } -- cgit