Repair Windows compiler warnings about mixing

signed and unsigned integral types in comparisons.
This commit is contained in:
Tim Peters 2006-05-26 16:49:28 +00:00
parent ada638bf91
commit 735ae484f0
1 changed files with 2 additions and 2 deletions

View File

@ -763,7 +763,7 @@ bp_uint(char *p, PyObject *v, const formatdef *f)
return -1; return -1;
i = f->size; i = f->size;
#ifdef PY_STRUCT_RANGE_CHECKING #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); return _range_error(f->format, f->size, 1);
#endif #endif
do { do {
@ -975,7 +975,7 @@ lp_uint(char *p, PyObject *v, const formatdef *f)
return -1; return -1;
i = f->size; i = f->size;
#ifdef PY_STRUCT_RANGE_CHECKING #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); return _range_error(f->format, f->size, 1);
#endif #endif
do { do {