diff Python/import.c @ 5317:c72c7e1930b3 legacy-trunk

Keep gcc -Wall and Microsoft VC happy.
author Guido van Rossum <guido@python.org>
date Fri, 11 Apr 1997 20:37:35 +0000
parents 6bc56259cc4c
children 5880384d7c71
line wrap: on
line diff
--- a/Python/import.c	Fri Apr 11 20:27:03 1997 +0000
+++ b/Python/import.c	Fri Apr 11 20:37:35 1997 +0000
@@ -436,6 +436,7 @@
 	FILE *fp = NULL;
 
 #ifdef MS_COREDLL
+	extern FILE *PyWin_FindRegisteredModule();
 	if ((fp=PyWin_FindRegisteredModule(name, &fdp, buf, buflen))!=NULL) {
 		*p_fp = fp;
 		return fdp;
@@ -460,7 +461,7 @@
 		if (len + 2 + namelen + import_maxsuffixsize >= buflen)
 			continue; /* Too long */
 		strcpy(buf, getstringvalue(v));
-		if (strlen(buf) != len)
+		if ((int)strlen(buf) != len)
 			continue; /* v contains '\0' */
 #ifdef macintosh
 		if ( PyMac_FindResourceModule(name, buf) ) {
@@ -740,10 +741,10 @@
 
 	if (!newgetargs(args, ""))
 		return NULL;
-	buf[0] = (MAGIC >>  0) & 0xff;
-	buf[1] = (MAGIC >>  8) & 0xff;
-	buf[2] = (MAGIC >> 16) & 0xff;
-	buf[3] = (MAGIC >> 24) & 0xff;
+	buf[0] = (char) ((MAGIC >>  0) & 0xff);
+	buf[1] = (char) ((MAGIC >>  8) & 0xff);
+	buf[2] = (char) ((MAGIC >> 16) & 0xff);
+	buf[3] = (char) ((MAGIC >> 24) & 0xff);
 
 	return newsizedstringobject(buf, 4);
 }