]> granicus.if.org Git - python/commitdiff
Make new gcc -Wall happy
authorGuido van Rossum <guido@python.org>
Fri, 10 Apr 1998 22:27:42 +0000 (22:27 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 10 Apr 1998 22:27:42 +0000 (22:27 +0000)
Modules/_tkinter.c
Modules/bsddbmodule.c
Modules/parsermodule.c
Modules/readline.c
Modules/regexpr.c
Modules/structmodule.c
Python/bltinmodule.c
Python/ceval.c
Python/getargs.c
Python/marshal.c
Python/thread_pthread.h

index d06700d7686f582ae0e14c8867291f6f22adcac4..d1da5356ac6e2651efe103147db459c845e6dd33 100644 (file)
@@ -358,7 +358,7 @@ Tkapp_New(screenName, baseName, className, interactive)
        }
 
        strcpy(argv0, className);
-       if (isupper(argv0[0]))
+       if (isupper((int)(argv0[0])))
                argv0[0] = tolower(argv0[0]);
        Tcl_SetVar(v->interp, "argv0", argv0, TCL_GLOBAL_ONLY);
        ckfree(argv0);
index b3474c4517d83e4ed302e6120e3c59e0b357515e..2f0d05de506969ce6cd3fcace8215bb6d439cc64 100644 (file)
@@ -433,7 +433,7 @@ bsddb_keys(dp, args)
 {
        PyObject *list, *item;
        DBT krec, drec;
-       char *data,buf[4096];
+       char *data=NULL,buf[4096];
        int status;
        int err;
 
@@ -556,8 +556,8 @@ bsddb_seq(dp, args, sequence_request)
 {
        int status;
        DBT krec, drec;
-       char *kdata,kbuf[4096];
-       char *ddata,dbuf[4096];
+       char *kdata=NULL,kbuf[4096];
+       char *ddata=NULL,dbuf[4096];
        PyObject *result;
 
        if (!PyArg_NoArgs(args))
index c09cccc739059b20e0cd218f91ecfd51300763bb..57fbf48018d56a866f0f8eebb27b0676e3d4e200 100644 (file)
@@ -1704,20 +1704,22 @@ validate_try(tree)
            res = (validate_numnodes(tree, 6, "try/finally")
                   && validate_colon(CHILD(tree, 4))
                   && validate_suite(CHILD(tree, 5)));
-       else if (res)
+       else if (res) {
            if (nch == (pos + 3)) {
                res = ((strcmp(STR(CHILD(tree, pos)), "except") == 0)
                       || (strcmp(STR(CHILD(tree, pos)), "else") == 0));
                if (!res)
                    err_string("Illegal trailing triple in try statement.");
            }
-           else if (nch == (pos + 6))
+           else if (nch == (pos + 6)) {
                res = (validate_name(CHILD(tree, pos), "except")
                       && validate_colon(CHILD(tree, pos + 1))
                       && validate_suite(CHILD(tree, pos + 2))
                       && validate_name(CHILD(tree, pos + 3), "else"));
+           }
            else
                res = validate_numnodes(tree, pos + 3, "try/except");
+       }
     }
     return (res);
 
index c74aee08c1676bd3c435e1add3f859222aa85e25..594732b32bcb4f84576cfc1f60e51808bdefc73b 100644 (file)
 /* GNU readline definitions */
 #include <readline/readline.h> /* You may need to add an -I option to Setup */
 
+extern int rl_parse_and_bind();
+extern int rl_read_init_file();
+extern int rl_insert_text();
+extern int rl_bind_key();
+extern int rl_bind_key_in_map();
+extern int rl_initialize();
+extern int add_history();
+
 /* Pointers needed from outside (but not declared in a header file). */
 extern int (*PyOS_InputHook)();
 extern char *(*PyOS_ReadlineFunctionPointer) Py_PROTO((char *));
index 64e199d9bef6722acf2f318d688df3cc0de25962..55b1dffa7b5dca78e1449ca1db2231df9a9c1f2c 100644 (file)
@@ -1271,11 +1271,12 @@ char *re_compile_pattern(regex, size, bufp)
                }
                case Rbol:
                {
-                       if (!beginning_context)
+                       if (!beginning_context) {
                                if (regexp_context_indep_ops)
                                        goto op_error;
                                else
                                        goto normal_char;
+                       }
                        opcode = Cbol;
                        goto store_opcode;
                }
@@ -1289,11 +1290,12 @@ char *re_compile_pattern(regex, size, bufp)
                              ((regexp_syntax & RE_NO_BK_PARENS)?
                               (regex[pos] == ')'):
                               (pos+1 < size && regex[pos] == '\134' &&
-                               regex[pos+1] == ')'))))
+                               regex[pos+1] == ')')))) {
                                if (regexp_context_indep_ops)
                                        goto op_error;
                                else
                                        goto normal_char;
+                       }
                        opcode = Ceol;
                        goto store_opcode;
                        /* NOTREACHED */
@@ -1301,11 +1303,12 @@ char *re_compile_pattern(regex, size, bufp)
                }
                case Roptional:
                {
-                       if (beginning_context)
+                       if (beginning_context) {
                                if (regexp_context_indep_ops)
                                        goto op_error;
                                else
                                        goto normal_char;
+                       }
                        if (CURRENT_LEVEL_START == pattern_offset)
                                break; /* ignore empty patterns for ? */
                        ALLOC(3);
@@ -1316,11 +1319,12 @@ char *re_compile_pattern(regex, size, bufp)
                case Rstar:
                case Rplus:
                {
-                       if (beginning_context)
+                       if (beginning_context) {
                                if (regexp_context_indep_ops)
                                        goto op_error;
                                else
                                        goto normal_char;
+                       }
                        if (CURRENT_LEVEL_START == pattern_offset)
                                break; /* ignore empty patterns for + and * */
                        ALLOC(9);
@@ -2061,11 +2065,12 @@ int re_search(bufp,
        else
                dir = 1;
 
-       if (anchor == 2)
+       if (anchor == 2) {
                if (pos != 0)
                        return -1;
                else
                        range = 0;
+       }
 
        for (; range >= 0; range--, pos += dir)
        {
index 065ec6f5adf25c0c1709f016320acb860b7e3733..0cf996fb99f071560f7f17729ccffce92a223bdb 100644 (file)
@@ -1008,7 +1008,7 @@ calcsize(fmt, f)
        s = fmt;
        size = 0;
        while ((c = *s++) != '\0') {
-               if (isspace(c))
+               if (isspace((int)c))
                        continue;
                if ('0' <= c && c <= '9') {
                        num = c - '0';
@@ -1110,7 +1110,7 @@ struct_pack(self, args)
        res = restart = PyString_AsString(result);
 
        while ((c = *s++) != '\0') {
-               if (isspace(c))
+               if (isspace((int)c))
                        continue;
                if ('0' <= c && c <= '9') {
                        num = c - '0';
@@ -1242,7 +1242,7 @@ struct_unpack(self, args)
        str = start;
        s = fmt;
        while ((c = *s++) != '\0') {
-               if (isspace(c))
+               if (isspace((int)c))
                        continue;
                if ('0' <= c && c <= '9') {
                        num = c - '0';
index 87005f5ba229bc88dd4a98bd1494f32343b8c017..32973327d4efe319b44231381db3b90cf61f8d5a 100644 (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);
index 28360f444b2370611218d870d882df8ec07d2932..05275373cdf1efe19b8d9d022e486c10a717cbc8 100644 (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,
index 7bc150d1e470c5e45bb63e31e42ee92c575bded3..502944dacf69ab68e8953c5e502d63e7881bbdd1 100644 (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,
index 75a20c23ec844c270960c6575abb5a1dc47aaff8..9daeeb3eec9eb058721492bac4ee7aabf5478994 100644 (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
index 5b70fa4e3cf62a475715bfc095f01321c0330e66..2f57b36e19a3eb610a1d1f606ff2cf9ef12e9bc6 100644 (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()