[Python-checkins] CVS: python/dist/src/Python pythonrun.c,2.116,2.117

Tim Peters python-dev@python.org
Thu, 04 Jan 2001 16:54:32 -0800


Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv25746/python/dist/src/python

Modified Files:
	pythonrun.c 
Log Message:
Fix signed/unsigned wng.  Unfortunately, (unsigned char) << int
has type int in C.


Index: pythonrun.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v
retrieving revision 2.116
retrieving revision 2.117
diff -C2 -r2.116 -r2.117
*** pythonrun.c	2001/01/04 20:30:56	2.116
--- pythonrun.c	2001/01/05 00:54:29	2.117
***************
*** 571,576 ****
  		unsigned int halfmagic = PyImport_GetMagicNumber() & 0xFFFF;
  		unsigned char buf[2];
! 		if (fread(buf, 1, 2, fp) == 2 
! 		    && (buf[1]<<8 | buf[0]) == halfmagic)
  			return 1;
  		fseek(fp, 0, SEEK_SET);
--- 571,576 ----
  		unsigned int halfmagic = PyImport_GetMagicNumber() & 0xFFFF;
  		unsigned char buf[2];
! 		if (fread(buf, 1, 2, fp) == 2
! 		    && ((unsigned int)buf[1]<<8 | buf[0]) == halfmagic)
  			return 1;
  		fseek(fp, 0, SEEK_SET);