From: David Lichteblau Date: Mon, 12 Nov 2012 16:33:47 +0000 (+0100) Subject: LLP64: replace use of unsigned long with size_t in parse_size_arg X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=b05f0536c258784a5bb7170ae41aec0b99151e38;p=sbcl.git LLP64: replace use of unsigned long with size_t in parse_size_arg Thanks to Anton Kovalenko. --- diff --git a/src/runtime/runtime.c b/src/runtime/runtime.c index 2478239..63bc99c 100644 --- a/src/runtime/runtime.c +++ b/src/runtime/runtime.c @@ -294,10 +294,11 @@ search_for_executable(const char *argv0) } #endif /* LISP_FEATURE_WIN32 */ -unsigned long parse_size_arg(char *arg, char *arg_name) +size_t +parse_size_arg(char *arg, char *arg_name) { char *tail, *power_name; - unsigned long power, res; + size_t power, res; res = strtoul(arg, &tail, 0); @@ -329,7 +330,7 @@ unsigned long parse_size_arg(char *arg, char *arg_name) free(power_name); } if ((res <= 0) || - (res > (ULONG_MAX >> power))) { + (res >= (SIZE_MAX >> power))) { lose("%s argument is out of range: %s", arg_name, arg); } res <<= power;