summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-04-11 20:37:35 (GMT)
committerGuido van Rossum <guido@python.org>1997-04-11 20:37:35 (GMT)
commit6bf62dad9e83003a70aef4158df063697926ba7c (patch)
tree8aa964aef3976a2a0b7d1215bdbd7c61b0b8f16d /Python
parent90126035cab1aad6edbc62376a9ff9cb0453523f (diff)
downloadcpython-6bf62dad9e83003a70aef4158df063697926ba7c.zip
cpython-6bf62dad9e83003a70aef4158df063697926ba7c.tar.gz
cpython-6bf62dad9e83003a70aef4158df063697926ba7c.tar.bz2
Keep gcc -Wall and Microsoft VC happy.
Diffstat (limited to 'Python')
-rw-r--r--Python/bltinmodule.c8
-rw-r--r--Python/cgensupport.c14
-rw-r--r--Python/getargs.c10
-rw-r--r--Python/import.c11
-rw-r--r--Python/traceback.c2
5 files changed, 24 insertions, 21 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index cee167c..da76f18 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -42,6 +42,8 @@ PERFORMANCE OF THIS SOFTWARE.
#include "mymath.h"
+#include <ctype.h>
+
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
@@ -233,7 +235,7 @@ builtin_chr(self, args)
err_setstr(ValueError, "chr() arg not in range(256)");
return NULL;
}
- s[0] = x;
+ s[0] = (char)x;
return newsizedstringobject(s, 1);
}
@@ -301,7 +303,7 @@ builtin_complex(self, args)
object *args;
{
object *r, *i, *tmp;
- number_methods *nbr, *nbi;
+ number_methods *nbr, *nbi = NULL;
Py_complex cr, ci;
int own_r = 0;
@@ -484,7 +486,7 @@ builtin_eval(self, args)
return NULL;
}
str = getstringvalue(cmd);
- if (strlen(str) != getstringsize(cmd)) {
+ if ((int)strlen(str) != getstringsize(cmd)) {
err_setstr(ValueError,
"embedded '\\0' in string arg");
return NULL;
diff --git a/Python/cgensupport.c b/Python/cgensupport.c
index d8a6014..fd2bad6 100644
--- a/Python/cgensupport.c
+++ b/Python/cgensupport.c
@@ -93,7 +93,7 @@ getishortarg(args, nargs, i, p_arg)
long x;
if (!getilongarg(args, nargs, i, &x))
return 0;
- *p_arg = x;
+ *p_arg = (short) x;
return 1;
}
@@ -129,15 +129,15 @@ extractfloat(v, p_arg)
/* Fall through to error return at end of function */
}
else if (is_floatobject(v)) {
- *p_arg = GETFLOATVALUE((floatobject *)v);
+ *p_arg = (float) GETFLOATVALUE((floatobject *)v);
return 1;
}
else if (is_intobject(v)) {
- *p_arg = GETINTVALUE((intobject *)v);
+ *p_arg = (float) GETINTVALUE((intobject *)v);
return 1;
}
else if (is_longobject(v)) {
- *p_arg = dgetlongvalue(v);
+ *p_arg = (float) dgetlongvalue(v);
return 1;
}
return err_badarg();
@@ -221,7 +221,7 @@ getishortarraysize(args, nargs, i, p_arg)
long x;
if (!getilongarraysize(args, nargs, i, &x))
return 0;
- *p_arg = x;
+ *p_arg = (short) x;
return 1;
}
@@ -287,7 +287,7 @@ getishortarray(args, nargs, i, n, p_arg)
if (!is_intobject(w)) {
return err_badarg();
}
- p_arg[i] = getintvalue(w);
+ p_arg[i] = (short) getintvalue(w);
}
return 1;
}
@@ -300,7 +300,7 @@ getishortarray(args, nargs, i, n, p_arg)
if (!is_intobject(w)) {
return err_badarg();
}
- p_arg[i] = getintvalue(w);
+ p_arg[i] = (short) getintvalue(w);
}
return 1;
}
diff --git a/Python/getargs.c b/Python/getargs.c
index 506cd38..4ac934d 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -453,7 +453,7 @@ convertsimple1(arg, p_format, p_va)
if (ival == -1 && err_occurred())
return "integer<b>";
else
- *p = ival;
+ *p = (char) ival;
break;
}
@@ -464,7 +464,7 @@ convertsimple1(arg, p_format, p_va)
if (ival == -1 && err_occurred())
return "integer<h>";
else
- *p = ival;
+ *p = (short) ival;
break;
}
@@ -497,7 +497,7 @@ convertsimple1(arg, p_format, p_va)
if (err_occurred())
return "float<f>";
else
- *p = dval;
+ *p = (float) dval;
break;
}
@@ -548,7 +548,7 @@ convertsimple1(arg, p_format, p_va)
*q = getstringsize(arg);
format++;
}
- else if (strlen(*p) != getstringsize(arg))
+ else if ((int)strlen(*p) != getstringsize(arg))
return "string without null bytes";
break;
}
@@ -571,7 +571,7 @@ convertsimple1(arg, p_format, p_va)
format++;
}
else if (*p != NULL &&
- strlen(*p) != getstringsize(arg))
+ (int)strlen(*p) != getstringsize(arg))
return "None or string without null bytes";
break;
}
diff --git a/Python/import.c b/Python/import.c
index 06350b7..8dadc0e 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -436,6 +436,7 @@ find_module(name, path, buf, buflen, p_fp)
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 @@ find_module(name, path, buf, buflen, p_fp)
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 @@ imp_get_magic(self, args)
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);
}
diff --git a/Python/traceback.c b/Python/traceback.c
index 3f80ef5..f9b840e 100644
--- a/Python/traceback.c
+++ b/Python/traceback.c
@@ -196,7 +196,7 @@ tb_displayline(f, filename, lineno, name)
if (len + 1 + taillen >= MAXPATHLEN)
continue; /* Too long */
strcpy(namebuf, getstringvalue(v));
- if (strlen(namebuf) != len)
+ if ((int)strlen(namebuf) != len)
continue; /* v contains '\0' */
if (len > 0 && namebuf[len-1] != SEP)
namebuf[len++] = SEP;