From: Tim Peters Date: Fri, 26 May 2006 16:49:28 +0000 (+0000) Subject: Repair Windows compiler warnings about mixing X-Git-Tag: v2.5b1~458 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=735ae484f0ef39fd297c7e6bb8eeb8aa7fc62875;p=python Repair Windows compiler warnings about mixing signed and unsigned integral types in comparisons. --- diff --git a/Modules/_struct.c b/Modules/_struct.c index a114216918..e4cd0a6a20 100644 --- a/Modules/_struct.c +++ b/Modules/_struct.c @@ -763,7 +763,7 @@ bp_uint(char *p, PyObject *v, const formatdef *f) return -1; i = f->size; #ifdef PY_STRUCT_RANGE_CHECKING - if (i != SIZEOF_LONG && x >= (1 << (((unsigned int)i) * 8))) + if (i != SIZEOF_LONG && x >= (1U << (((unsigned int)i) * 8))) return _range_error(f->format, f->size, 1); #endif do { @@ -975,7 +975,7 @@ lp_uint(char *p, PyObject *v, const formatdef *f) return -1; i = f->size; #ifdef PY_STRUCT_RANGE_CHECKING - if (i != SIZEOF_LONG && x >= (1 << (((unsigned int)i) * 8))) + if (i != SIZEOF_LONG && x >= (1U << (((unsigned int)i) * 8))) return _range_error(f->format, f->size, 1); #endif do {