# HG changeset patch # User Tuomo Valkonen # Date 1116102200 -7200 # Node ID 8ae0f0aa5a16abda3d5c78af0abd888d2c2fbb64 # Parent 46ee75d9eba961d6abc3b7089c1f801d48d703ee Added some coercions to remove gcc complaints in snprintf_2.2. diff -r 46ee75d9eba9 -r 8ae0f0aa5a16 snprintf_2.2/snprintf.c --- a/snprintf_2.2/snprintf.c Fri Mar 25 17:48:19 2005 +0100 +++ b/snprintf_2.2/snprintf.c Sat May 14 22:23:20 2005 +0200 @@ -565,7 +565,7 @@ /* but the following code achieves better performance for cases * where format string is long and contains few conversions */ const char *q = strchr(p+1,'%'); - size_t n = !q ? strlen(p) : (q-p); + size_t n = !q ? strlen(p) : (size_t)(q-p); if (str_l < str_m) { size_t avail = str_m-str_l; fast_memcpy(str+str_l, p, (n>avail?avail:n)); @@ -714,7 +714,7 @@ /* memchr on HP does not like n > 2^31 !!! */ const char *q = memchr(str_arg, '\0', precision <= 0x7fffffff ? precision : 0x7fffffff); - str_arg_l = !q ? precision : (q-str_arg); + str_arg_l = !q ? precision : (size_t)(q-str_arg); } break; default: break;