(svn r13008) -Fix [FS#1997]: silence some MSVC x64 warnings

This commit is contained in:
glx
2008-05-08 13:20:54 +00:00
parent 298ce62338
commit a28ea38653
11 changed files with 64 additions and 65 deletions

View File

@@ -45,10 +45,10 @@ static inline bool StrEmpty(const char *s) { return s == NULL || s[0] == '\0'; }
/** Get the length of a string, within a limited buffer */
static inline int ttd_strnlen(const char *str, int maxlen)
static inline size_t ttd_strnlen(const char *str, size_t maxlen)
{
const char *t;
for (t = str; *t != '\0' && t - str < maxlen; t++) {}
for (t = str; *t != '\0' && (size_t)(t - str) < maxlen; t++) {}
return t - str;
}