]> granicus.if.org Git - python/commitdiff
Fix nearly all compilation warnings under Apple gcc-4.0. Tested with OPT="-g
authorJeffrey Yasskin <jyasskin@gmail.com>
Fri, 29 May 2009 03:44:31 +0000 (03:44 +0000)
committerJeffrey Yasskin <jyasskin@gmail.com>
Fri, 29 May 2009 03:44:31 +0000 (03:44 +0000)
-Wall -Wstrict-prototypes -Werror" in both --with-pydebug mode and --without.
There's still a batch of non-prototype warnings in Xlib.h that I don't know how
to fix.

Mac/Modules/carbonevt/_CarbonEvtmodule.c
Mac/Modules/ctl/_Ctlmodule.c
Modules/_ssl.c
Modules/_struct.c
Python/compile.c

index 66e4e27fbb4257ba556f7e1793ee6aa853818265..893beec9afcfc16f26795f7e30a0766a8ff79923 100755 (executable)
@@ -27,12 +27,6 @@ PyObject *EventHandlerCallRef_New(EventHandlerCallRef itself);
 PyObject *EventRef_New(EventRef itself);
 
 /********** EventTypeSpec *******/
-static PyObject*
-EventTypeSpec_New(EventTypeSpec *in)
-{
-        return Py_BuildValue("ll", in->eventClass, in->eventKind);
-}
-
 static int
 EventTypeSpec_Convert(PyObject *v, EventTypeSpec *out)
 {
@@ -67,12 +61,6 @@ HIPoint_Convert(PyObject *v, HIPoint *out)
 
 /********** EventHotKeyID *******/
 
-static PyObject*
-EventHotKeyID_New(EventHotKeyID *in)
-{
-        return Py_BuildValue("ll", in->signature, in->id);
-}
-
 static int
 EventHotKeyID_Convert(PyObject *v, EventHotKeyID *out)
 {
index d7d4d0a7291b0ff6d7879af597a72d69e4323a03..cdb85571242d28215536a01baa824e88f77d4811 100644 (file)
@@ -1598,7 +1598,7 @@ static PyObject *CtlObj_GetBevelButtonMenuValue(ControlObject *_self, PyObject *
 {
        PyObject *_res = NULL;
        OSErr _err;
-       SInt16 outValue;
+       UInt16 outValue;
 #ifndef GetBevelButtonMenuValue
        PyMac_PRECHECK(GetBevelButtonMenuValue);
 #endif
index 4b0958a6bb9318dadadc43acd52faa122d288ea1..643693eecb33abdd9f6de7e9d36067935a1d52ce 100644 (file)
@@ -667,7 +667,7 @@ _get_peer_alt_names (X509 *certificate) {
        char buf[2048];
        char *vptr;
        int len;
-       const unsigned char *p;
+       unsigned char *p;
 
        if (certificate == NULL)
                return peer_alt_names;
index b8f1525f6c1248db5153bbbe3c7bd5ef018daafe..a7fce105a0b946a3bf52a8cd5e05c5c482ae7af3 100644 (file)
@@ -182,6 +182,7 @@ get_long(PyObject *v, long *p)
 
 /* Same, but handling unsigned long */
 
+#ifndef PY_STRUCT_OVERFLOW_MASKING
 static int
 get_ulong(PyObject *v, unsigned long *p)
 {
@@ -201,6 +202,7 @@ get_ulong(PyObject *v, unsigned long *p)
        }
        return 0;
 }
+#endif  /* PY_STRUCT_OVERFLOW_MASKING */
 
 #ifdef HAVE_LONG_LONG
 
index df12bde44067810ef3201c6b022de315796b390b..00e0462c4d3d5e6ea4c0a89bb7e7b17c4323710a 100644 (file)
@@ -535,18 +535,6 @@ compiler_exit_scope(struct compiler *c)
 
 }
 
-/* Allocate a new "anonymous" local variable.
-   Used by list comprehensions and with statements.
-*/
-
-static PyObject *
-compiler_new_tmpname(struct compiler *c)
-{
-       char tmpname[256];
-       PyOS_snprintf(tmpname, sizeof(tmpname), "_[%d]", ++c->u->u_tmpname);
-       return PyString_FromString(tmpname);
-}
-
 /* Allocate a new block and return a pointer to it.
    Returns NULL on error.
 */