diff Modules/structmodule.c @ 5318:2c4b802a3b5d legacy-trunk

Keep Microsoft VC happy.
author Guido van Rossum <guido@python.org>
date Fri, 11 Apr 1997 20:44:04 +0000
parents 03bcdd22f6a4
children 9e432468f756
line wrap: on
line diff
--- a/Modules/structmodule.c	Fri Apr 11 20:37:35 1997 +0000
+++ b/Modules/structmodule.c	Fri Apr 11 20:44:04 1997 +0000
@@ -179,7 +179,7 @@
 	p += incr;
 
 	/* Second byte */
-	*p = ((e&1)<<7) | (fbits>>16);
+	*p = (char) (((e&1)<<7) | (fbits>>16));
 	p += incr;
 
 	/* Third byte */
@@ -255,7 +255,7 @@
 	p += incr;
 
 	/* Second byte */
-	*p = ((e&0xF)<<4) | (fhi>>24);
+	*p = (char) (((e&0xF)<<4) | (fhi>>24));
 	p += incr;
 
 	/* Third byte */
@@ -508,7 +508,7 @@
 	long x;
 	if (get_long(v, &x) < 0)
 		return -1;
-	*p = x;
+	*p = (char)x;
 	return 0;
 }
 
@@ -536,7 +536,7 @@
 	long x;
 	if (get_long(v, &x) < 0)
 		return -1;
-	* (short *)p = x;
+	* (short *)p = (short)x;
 	return 0;
 }
 
@@ -700,7 +700,7 @@
 		return -1;
 	i = f->size;
 	do {
-		p[--i] = x;
+		p[--i] = (char)x;
 		x >>= 8;
 	} while (i > 0);
 	return 0;
@@ -718,7 +718,7 @@
 		return -1;
 	i = f->size;
 	do {
-		p[--i] = x;
+		p[--i] = (char)x;
 		x >>= 8;
 	} while (i > 0);
 	return 0;
@@ -830,7 +830,7 @@
 		return -1;
 	i = f->size;
 	do {
-		*p++ = x;
+		*p++ = (char)x;
 		x >>= 8;
 	} while (--i > 0);
 	return 0;
@@ -848,7 +848,7 @@
 		return -1;
 	i = f->size;
 	do {
-		*p++ = x;
+		*p++ = (char)x;
 		x >>= 8;
 	} while (--i > 0);
 	return 0;