[Python-checkins] CVS: python/dist/src/Objects unicodeobject.c,2.35,2.36

M.-A. Lemburg python-dev@python.org
Thu, 6 Jul 2000 12:43:34 -0700


Update of /cvsroot/python/python/dist/src/Objects
In directory slayer.i.sourceforge.net:/tmp/cvs-serv14982/Objects
Modified Files:
	unicodeobject.c 
Log Message:
Fixed a couple of places where 'int' was used where 'long'
should have been used.
Index: unicodeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v
retrieving revision 2.35
retrieving revision 2.36
diff -C2 -r2.35 -r2.36
*** unicodeobject.c	2000年07月05日 09:49:44	2.35
--- unicodeobject.c	2000年07月06日 19:43:31	2.36
***************
*** 771,775 ****
 
 PyObject *_PyUnicode_AsUTF8String(PyObject *unicode,
! 		 const char *errors)
 {
 PyObject *v = ((PyUnicodeObject *)unicode)->utf8str;
--- 771,775 ----
 
 PyObject *_PyUnicode_AsUTF8String(PyObject *unicode,
! 				 const char *errors)
 {
 PyObject *v = ((PyUnicodeObject *)unicode)->utf8str;
***************
*** 1064,1068 ****
 while (s < end) {
 unsigned char c;
! unsigned int x;
 int i;
 
--- 1064,1068 ----
 while (s < end) {
 unsigned char c;
! unsigned long x;
 int i;
 
***************
*** 1373,1377 ****
 while (s < end) {
 	unsigned char c;
! 	unsigned int x;
 	int i;
 
--- 1373,1377 ----
 while (s < end) {
 	unsigned char c;
! 	unsigned long x;
 	int i;
 
***************
*** 1853,1857 ****
 	/* Apply mapping */
 	if (PyInt_Check(x)) {
! 	 int value = PyInt_AS_LONG(x);
 	 if (value < 0 || value > 65535) {
 		PyErr_SetString(PyExc_TypeError,
--- 1853,1857 ----
 	/* Apply mapping */
 	if (PyInt_Check(x)) {
! 	 long value = PyInt_AS_LONG(x);
 	 if (value < 0 || value > 65535) {
 		PyErr_SetString(PyExc_TypeError,
***************
*** 1972,1976 ****
 	/* Apply mapping */
 	if (PyInt_Check(x)) {
! 	 int value = PyInt_AS_LONG(x);
 	 if (value < 0 || value > 255) {
 		PyErr_SetString(PyExc_TypeError,
--- 1972,1976 ----
 	/* Apply mapping */
 	if (PyInt_Check(x)) {
! 	 long value = PyInt_AS_LONG(x);
 	 if (value < 0 || value > 255) {
 		PyErr_SetString(PyExc_TypeError,
***************
*** 3071,3075 ****
 while (len1 > 0 && len2 > 0) {
 	unsigned short c1, c2; /* 16 bits */
! 	int diff; /* 32 bits */
 
 c1 = *s1++;
--- 3071,3075 ----
 while (len1 > 0 && len2 > 0) {
 	unsigned short c1, c2; /* 16 bits */
! 	long diff; /* >=32 bits */
 
 c1 = *s1++;
***************
*** 3081,3085 ****
 
 /* now c1 and c2 are in UTF-32-compatible order */
! diff = (int)c1 - (int)c2;
 if (diff)
 return (diff < 0) ? -1 : (diff != 0);
--- 3081,3085 ----
 
 /* now c1 and c2 are in UTF-32-compatible order */
! diff = (long)c1 - (long)c2;
 if (diff)
 return (diff < 0) ? -1 : (diff != 0);

AltStyle によって変換されたページ (->オリジナル) /