Add casts for unavoidable signed/unsigned comparisons

At these code sites, it is preferable to cast rather than change
a variable's type.
This commit is contained in:
Jeff Garzik
2012-04-22 13:51:16 -04:00
committed by Jeff Garzik
parent c0a0a93d02
commit 1d8c7a9557
8 changed files with 21 additions and 19 deletions

View File

@@ -283,7 +283,7 @@ int my_snprintf(char* buffer, size_t limit, const char* format, ...)
va_start(arg_ptr, format);
int ret = _vsnprintf(buffer, limit, format, arg_ptr);
va_end(arg_ptr);
if (ret < 0 || ret >= limit)
if (ret < 0 || ret >= (int)limit)
{
ret = limit - 1;
buffer[limit-1] = 0;