[Python-checkins] python/dist/src/Python getargs.c,2.98,2.99
gvanrossum@users.sourceforge.net
gvanrossum@users.sourceforge.net
Thu, 17 Apr 2003 17:12:32 -0700
Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1:/tmp/cvs-serv31308
Modified Files:
getargs.c
Log Message:
Roll back changes to 'h' format code -- too much breaks. Other
changes stay.
Index: getargs.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/getargs.c,v
retrieving revision 2.98
retrieving revision 2.99
diff -C2 -d -r2.98 -r2.99
*** getargs.c 17 Apr 2003 18:55:45 -0000 2.98
--- getargs.c 18 Apr 2003 00:12:30 -0000 2.99
***************
*** 457,461 ****
}
! case 'h': {/* unsigned short int */
short *p = va_arg(*p_va, short *);
long ival;
--- 457,461 ----
}
! case 'h': {/* signed short int */
short *p = va_arg(*p_va, short *);
long ival;
***************
*** 465,476 ****
if (ival == -1 && PyErr_Occurred())
return converterr("integer<h>", arg, msgbuf, bufsize);
! else if (ival < 0) {
PyErr_SetString(PyExc_OverflowError,
! "unsigned short integer is less than minimum");
return converterr("integer<h>", arg, msgbuf, bufsize);
}
! else if (ival > USHRT_MAX) {
PyErr_SetString(PyExc_OverflowError,
! "unsigned short integer is greater than maximum");
return converterr("integer<h>", arg, msgbuf, bufsize);
}
--- 465,476 ----
if (ival == -1 && PyErr_Occurred())
return converterr("integer<h>", arg, msgbuf, bufsize);
! else if (ival < SHRT_MIN) {
PyErr_SetString(PyExc_OverflowError,
! "signed short integer is less than minimum");
return converterr("integer<h>", arg, msgbuf, bufsize);
}
! else if (ival > SHRT_MAX) {
PyErr_SetString(PyExc_OverflowError,
! "signed short integer is greater than maximum");
return converterr("integer<h>", arg, msgbuf, bufsize);
}