diff Modules/_struct.c @ 40041:a2f26f944b65 2.5

Backport the .sln and .vcproj files for PCBuild8 from the python trunk to the 2.5 maintainance branch. This fixes build problems with visual studio 2005, and cleans up profile guided optimization.
author Kristján Valur Jónsson <kristjan@ccpgames.com>
date Sat, 07 Oct 2006 14:56:30 +0000
parents 9cb4565e60ca
children 4c7ebc397d94
line wrap: on
line diff
--- a/Modules/_struct.c	Fri Oct 06 12:46:33 2006 +0000
+++ b/Modules/_struct.c	Sat Oct 07 14:56:30 2006 +0000
@@ -820,7 +820,7 @@
 	} while (--i > 0);
 	/* Extend the sign bit. */
 	if (SIZEOF_LONG_LONG > f->size)
-		x |= -(x & (1L << ((8 * f->size) - 1)));
+		x |= -(x & ( (PY_LONG_LONG)1 << ((8 * f->size) - 1)));
 	if (x >= LONG_MIN && x <= LONG_MAX)
 		return PyInt_FromLong(Py_SAFE_DOWNCAST(x, PY_LONG_LONG, long));
 	return PyLong_FromLongLong(x);
@@ -1038,7 +1038,7 @@
 	} while (i > 0);
 	/* Extend the sign bit. */
 	if (SIZEOF_LONG_LONG > f->size)
-		x |= -(x & (1L << ((8 * f->size) - 1)));
+		x |= -(x & ( (PY_LONG_LONG)1 << ((8 * f->size) - 1)));
 	if (x >= LONG_MIN && x <= LONG_MAX)
 		return PyInt_FromLong(Py_SAFE_DOWNCAST(x, PY_LONG_LONG, long));
 	return PyLong_FromLongLong(x);