summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1996-12-05 23:27:02 (GMT)
committerGuido van Rossum <guido@python.org>1996-12-05 23:27:02 (GMT)
commit80bb9655f0e0843199b46719b032f2dc737cf013 (patch)
treeed12a68ba0a32b61f9c24346b40d46437e506e71 /Python
parented0af8fe702505001c67ec5e233fb84944529f7e (diff)
downloadcpython-80bb9655f0e0843199b46719b032f2dc737cf013.zip
cpython-80bb9655f0e0843199b46719b032f2dc737cf013.tar.gz
cpython-80bb9655f0e0843199b46719b032f2dc737cf013.tar.bz2
Keep gcc -Wall happy.
Diffstat (limited to 'Python')
-rw-r--r--Python/compile.c3
-rw-r--r--Python/getargs.c47
-rw-r--r--Python/import.c6
-rw-r--r--Python/mystrtoul.c2
-rw-r--r--Python/pythonrun.c4
-rw-r--r--Python/thread.c4
6 files changed, 38 insertions, 28 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 1c38cf4..adb0d09 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -994,7 +994,6 @@ com_sliceobj(c, n)
{
int i=0;
int ns=2; /* number of slice arguments */
- int first_missing=0;
node *ch;
/* first argument */
@@ -2871,7 +2870,7 @@ optimize(c)
{
unsigned char *next_instr, *cur_instr;
int opcode;
- int oparg;
+ int oparg = 0;
object *name;
object *error_type, *error_value, *error_traceback;
diff --git a/Python/getargs.c b/Python/getargs.c
index a73bc80..506cd38 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -685,12 +685,11 @@ vgetargskeywords(args, keywords, format, kwlist, p_va)
char *message = NULL;
int min = -1;
int max = 0;
- int level = 0;
char *formatsave = format;
int i, len, tplen, kwlen;
char *msg, *ks, **p;
int nkwds, pos, match, converted;
- object *key, *value, *item;
+ object *key, *value;
/* nested tuples cannot be parsed when using keyword arguments */
@@ -831,9 +830,11 @@ vgetargskeywords(args, keywords, format, kwlist, p_va)
converted = 0;
for (i = tplen; i < nkwds; i++) {
+ object *item;
if (*format == '|')
format++;
- if (item = PyMapping_GetItemString(keywords, kwlist[i])) {
+ item = PyMapping_GetItemString(keywords, kwlist[i]);
+ if (item != NULL) {
msg = convertitem(item, &format, p_va, levels, msgbuf);
if (msg) {
seterror(i+1, msg, levels, fname, message);
@@ -890,59 +891,59 @@ skipitem(p_format, p_va)
case 'b': /* byte -- very short int */
{
- va_arg(*p_va, char *);
+ (void) va_arg(*p_va, char *);
break;
}
case 'h': /* short int */
{
- va_arg(*p_va, short *);
+ (void) va_arg(*p_va, short *);
break;
}
case 'i': /* int */
{
- va_arg(*p_va, int *);
+ (void) va_arg(*p_va, int *);
break;
}
case 'l': /* long int */
{
- va_arg(*p_va, long *);
+ (void) va_arg(*p_va, long *);
break;
}
case 'f': /* float */
{
- va_arg(*p_va, float *);
+ (void) va_arg(*p_va, float *);
break;
}
case 'd': /* double */
{
- va_arg(*p_va, double *);
+ (void) va_arg(*p_va, double *);
break;
}
#ifndef WITHOUT_COMPLEX
case 'D': /* complex double */
{
- va_arg(*p_va, Py_complex *);
+ (void) va_arg(*p_va, Py_complex *);
break;
}
#endif /* WITHOUT_COMPLEX */
case 'c': /* char */
{
- va_arg(*p_va, char *);
+ (void) va_arg(*p_va, char *);
break;
}
case 's': /* string */
{
- va_arg(*p_va, char **);
+ (void) va_arg(*p_va, char **);
if (*format == '#') {
- va_arg(*p_va, int *);
+ (void) va_arg(*p_va, int *);
format++;
}
break;
@@ -950,9 +951,9 @@ skipitem(p_format, p_va)
case 'z': /* string */
{
- va_arg(*p_va, char **);
+ (void) va_arg(*p_va, char **);
if (*format == '#') {
- va_arg(*p_va, int *);
+ (void) va_arg(*p_va, int *);
format++;
}
break;
@@ -960,18 +961,16 @@ skipitem(p_format, p_va)
case 'S': /* string object */
{
- va_arg(*p_va, object **);
+ (void) va_arg(*p_va, object **);
break;
}
case 'O': /* object */
{
- typeobject *type;
- object **p;
if (*format == '!') {
format++;
- va_arg(*p_va, typeobject*);
- va_arg(*p_va, object **);
+ (void) va_arg(*p_va, typeobject*);
+ (void) va_arg(*p_va, object **);
}
#if 0
/* I don't know what this is for */
@@ -979,19 +978,19 @@ skipitem(p_format, p_va)
inquiry pred = va_arg(*p_va, inquiry);
format++;
if ((*pred)(arg)) {
- va_arg(*p_va, object **);
+ (void) va_arg(*p_va, object **);
}
}
#endif
else if (*format == '&') {
typedef int (*converter)
PROTO((object *, void *));
- va_arg(*p_va, converter);
- va_arg(*p_va, void *);
+ (void) va_arg(*p_va, converter);
+ (void) va_arg(*p_va, void *);
format++;
}
else {
- va_arg(*p_va, object **);
+ (void) va_arg(*p_va, object **);
}
break;
}
diff --git a/Python/import.c b/Python/import.c
index cd96951..de1772c 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -53,6 +53,10 @@ PERFORMANCE OF THIS SOFTWARE.
#include "macglue.h"
#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
extern long getmtime(); /* In getmtime.c */
/* Magic word to reject .pyc files generated by other Python versions */
@@ -419,7 +423,7 @@ find_module(name, path, buf, buflen, p_fp)
FILE **p_fp;
{
int i, npath, len, namelen;
- struct filedescr *fdp;
+ struct filedescr *fdp = NULL;
FILE *fp = NULL;
#ifdef MS_COREDLL
diff --git a/Python/mystrtoul.c b/Python/mystrtoul.c
index 0939438..a869b46 100644
--- a/Python/mystrtoul.c
+++ b/Python/mystrtoul.c
@@ -112,7 +112,7 @@ int base;
}
/* do the conversion */
- while (c = Py_CHARMASK(*str))
+ while ((c = Py_CHARMASK(*str)) != '\0')
{
if (isdigit(c) && c - '0' < base)
c -= '0';
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 8219f75..7cdcf46 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -47,6 +47,10 @@ PERFORMANCE OF THIS SOFTWARE.
#include "import.h"
#include "marshal.h"
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif
diff --git a/Python/thread.c b/Python/thread.c
index 9349e58..0e6d6ee 100644
--- a/Python/thread.c
+++ b/Python/thread.c
@@ -45,6 +45,10 @@ PERFORMANCE OF THIS SOFTWARE.
extern char *getenv();
#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
#include "thread.h"
#ifdef __ksr__