[Python-checkins] CVS: python/dist/src/Modules binascii.c,2.30,2.31

Greg Ward gward@users.sourceforge.net
2001年10月04日 07:54:55 -0700


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv30040/Modules
Modified Files:
	binascii.c 
Log Message:
Add various typecasts (back and forth from char * to unsigned char *)
to make the SGI C compiler happier (bug #445960).
Index: binascii.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/binascii.c,v
retrieving revision 2.30
retrieving revision 2.31
diff -C2 -d -r2.30 -r2.31
*** binascii.c	2001年09月30日 20:32:11	2.30
--- binascii.c	2001年10月04日 14:54:53	2.31
***************
*** 1014,1018 ****
 
 	/* We allocate the output same size as input, this is overkill */
! 	odata = (char *) calloc(1, datalen);
 
 	if (odata == NULL) {
--- 1014,1018 ----
 
 	/* We allocate the output same size as input, this is overkill */
! 	odata = (unsigned char *) calloc(1, datalen);
 
 	if (odata == NULL) {
***************
*** 1066,1070 ****
 		}
 	}
! 	if ((rv = PyString_FromStringAndSize(odata, out)) == NULL) {
 		free (odata);
 		return NULL;
--- 1066,1070 ----
 		}
 	}
! 	if ((rv = PyString_FromStringAndSize((char *)odata, out)) == NULL) {
 		free (odata);
 		return NULL;
***************
*** 1120,1124 ****
 	 * the end of lines to be the same depending on this detection
 	 * here */
! 	p = strchr(data, '\n');
 	if ((p != NULL) && (p > data) && (*(p-1) == '\r'))
 		crlf = 1;
--- 1120,1124 ----
 	 * the end of lines to be the same depending on this detection
 	 * here */
! 	p = (unsigned char *) strchr((char *)data, '\n');
 	if ((p != NULL) && (p > data) && (*(p-1) == '\r'))
 		crlf = 1;
***************
*** 1184,1188 ****
 	}
 
! 	odata = (char *) calloc(1, odatalen);
 
 	if (odata == NULL) {
--- 1184,1188 ----
 	}
 
! 	odata = (unsigned char *) calloc(1, odatalen);
 
 	if (odata == NULL) {
***************
*** 1257,1261 ****
 		}
 	}
! 	if ((rv = PyString_FromStringAndSize(odata, out)) == NULL) {
 		free (odata);
 		return NULL;
--- 1257,1261 ----
 		}
 	}
! 	if ((rv = PyString_FromStringAndSize((char *)odata, out)) == NULL) {
 		free (odata);
 		return NULL;

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