Skip to content

Commit 7937d93

Browse files
committed
Fix nearly all compilation warnings under Apple gcc-4.0. Tested with OPT="-g
-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.
1 parent 822b87f commit 7937d93

File tree

5 files changed

+4
-26
lines changed

5 files changed

+4
-26
lines changed

Mac/Modules/carbonevt/_CarbonEvtmodule.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@ PyObject *EventHandlerCallRef_New(EventHandlerCallRef itself);
2727
PyObject *EventRef_New(EventRef itself);
2828

2929
/********** EventTypeSpec *******/
30-
static PyObject*
31-
EventTypeSpec_New(EventTypeSpec *in)
32-
{
33-
return Py_BuildValue("ll", in->eventClass, in->eventKind);
34-
}
35-
3630
static int
3731
EventTypeSpec_Convert(PyObject *v, EventTypeSpec *out)
3832
{
@@ -67,12 +61,6 @@ HIPoint_Convert(PyObject *v, HIPoint *out)
6761

6862
/********** EventHotKeyID *******/
6963

70-
static PyObject*
71-
EventHotKeyID_New(EventHotKeyID *in)
72-
{
73-
return Py_BuildValue("ll", in->signature, in->id);
74-
}
75-
7664
static int
7765
EventHotKeyID_Convert(PyObject *v, EventHotKeyID *out)
7866
{

Mac/Modules/ctl/_Ctlmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1598,7 +1598,7 @@ static PyObject *CtlObj_GetBevelButtonMenuValue(ControlObject *_self, PyObject *
15981598
{
15991599
PyObject *_res = NULL;
16001600
OSErr _err;
1601-
SInt16 outValue;
1601+
UInt16 outValue;
16021602
#ifndef GetBevelButtonMenuValue
16031603
PyMac_PRECHECK(GetBevelButtonMenuValue);
16041604
#endif

Modules/_ssl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ _get_peer_alt_names (X509 *certificate) {
667667
char buf[2048];
668668
char *vptr;
669669
int len;
670-
const unsigned char *p;
670+
unsigned char *p;
671671

672672
if (certificate == NULL)
673673
return peer_alt_names;

Modules/_struct.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ get_long(PyObject *v, long *p)
182182

183183
/* Same, but handling unsigned long */
184184

185+
#ifndef PY_STRUCT_OVERFLOW_MASKING
185186
static int
186187
get_ulong(PyObject *v, unsigned long *p)
187188
{
@@ -201,6 +202,7 @@ get_ulong(PyObject *v, unsigned long *p)
201202
}
202203
return 0;
203204
}
205+
#endif /* PY_STRUCT_OVERFLOW_MASKING */
204206

205207
#ifdef HAVE_LONG_LONG
206208

Python/compile.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -535,18 +535,6 @@ compiler_exit_scope(struct compiler *c)
535535

536536
}
537537

538-
/* Allocate a new "anonymous" local variable.
539-
Used by list comprehensions and with statements.
540-
*/
541-
542-
static PyObject *
543-
compiler_new_tmpname(struct compiler *c)
544-
{
545-
char tmpname[256];
546-
PyOS_snprintf(tmpname, sizeof(tmpname), "_[%d]", ++c->u->u_tmpname);
547-
return PyString_FromString(tmpname);
548-
}
549-
550538
/* Allocate a new block and return a pointer to it.
551539
Returns NULL on error.
552540
*/

0 commit comments

Comments
 (0)