Make new gcc -Wall happy

This commit is contained in:
Guido van Rossum 1998-04-10 22:27:42 +00:00
parent 1109fbca76
commit 730806d3d9
11 changed files with 45 additions and 23 deletions

View file

@ -348,13 +348,15 @@ builtin_complex(self, args)
}
if (PyComplex_Check(r)) {
cr = ((PyComplexObject*)r)->cval;
if (own_r)
if (own_r) {
Py_DECREF(r);
}
}
else {
tmp = (*nbr->nb_float)(r);
if (own_r)
if (own_r) {
Py_DECREF(r);
}
if (tmp == NULL)
return NULL;
cr.real = PyFloat_AsDouble(tmp);

View file

@ -2745,8 +2745,9 @@ build_class(methods, bases, name)
callable, args);
Py_DECREF(args);
}
if (callable != basetype)
if (callable != basetype) {
Py_DECREF(callable);
}
return newclass;
}
PyErr_SetString(PyExc_TypeError,

View file

@ -257,7 +257,7 @@ vgetargs1(args, format, p_va, compat)
}
}
if (*format != '\0' && !isalpha(*format) &&
if (*format != '\0' && !isalpha((int)(*format)) &&
*format != '(' &&
*format != '|' && *format != ':' && *format != ';') {
PyErr_Format(PyExc_SystemError,

View file

@ -143,12 +143,15 @@ w_object(v, p)
{
int i, n;
if (v == NULL)
if (v == NULL) {
w_byte(TYPE_NULL, p);
else if (v == Py_None)
}
else if (v == Py_None) {
w_byte(TYPE_NONE, p);
else if (v == Py_Ellipsis)
w_byte(TYPE_ELLIPSIS, p);
}
else if (v == Py_Ellipsis) {
w_byte(TYPE_ELLIPSIS, p);
}
else if (PyInt_Check(v)) {
long x = PyInt_AS_LONG((PyIntObject *)v);
#if SIZEOF_LONG > 4

View file

@ -175,11 +175,12 @@ long get_thread_ident _P0()
static void do_exit_thread _P1(no_cleanup, int no_cleanup)
{
dprintf(("exit_thread called\n"));
if (!initialized)
if (!initialized) {
if (no_cleanup)
_exit(0);
else
exit(0);
}
}
void exit_thread _P0()