From 2fbe7434f2914ea64401375617ec2f0951da2d34 Mon Sep 17 00:00:00 2001 From: Cary R Date: Mon, 31 Oct 2011 15:40:06 -0700 Subject: [PATCH] Use UINT_MAX instead of -1 to set unsigned to maximum value. The Sun C compiler warns when -1 is used to initialize an unsigned. (cherry picked from commit 7d588d699b5312bd8e5cefbdb5c951f3cebf0cd8) --- vpi/sys_scanf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vpi/sys_scanf.c b/vpi/sys_scanf.c index 4b35d39a1..3dd809406 100644 --- a/vpi/sys_scanf.c +++ b/vpi/sys_scanf.c @@ -28,6 +28,7 @@ # include # include # include +# include # include /* @@ -802,7 +803,7 @@ static int scan_format(vpiHandle callh, struct byte_source*src, vpiHandle argv, * parse it generically first. */ unsigned suppress_flag = 0; - unsigned max_width = -1; + unsigned max_width = UINT_MAX; int code = 0; /* Look for the suppression character '*'. */