Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 044d95e

Browse files
committed
A few more gcc warnings bite the dust.
1 parent 28341ce commit 044d95e

5 files changed

Lines changed: 28 additions & 11 deletions

File tree

Mac/Modules/qd/_Qdmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ PyObject *QdRGB_New(RGBColorPtr itself)
122122
return Py_BuildValue("lll", (long)itself->red, (long)itself->green, (long)itself->blue);
123123
}
124124

125-
QdRGB_Convert(PyObject *v, RGBColorPtr p_itself)
125+
int QdRGB_Convert(PyObject *v, RGBColorPtr p_itself)
126126
{
127127
long red, green, blue;
128128

Mac/Modules/qd/qdsupport.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def declareSize(self, name):
167167
return Py_BuildValue("lll", (long)itself->red, (long)itself->green, (long)itself->blue);
168168
}
169169
170-
QdRGB_Convert(PyObject *v, RGBColorPtr p_itself)
170+
int QdRGB_Convert(PyObject *v, RGBColorPtr p_itself)
171171
{
172172
long red, green, blue;
173173

Mac/Modules/res/_Resmodule.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,8 @@ static PyObject *ResObj_AutoDispose(ResourceObject *_self, PyObject *_args)
440440
_self->ob_freeit = PyMac_AutoDisposeHandle;
441441
else
442442
_self->ob_freeit = NULL;
443-
return Py_BuildValue("i", old);
443+
_res = Py_BuildValue("i", old);
444+
return _res;
444445

445446
}
446447

@@ -1378,7 +1379,8 @@ static PyObject *Res_Resource(PyObject *_self, PyObject *_args)
13781379
HLock(h);
13791380
memcpy(*h, buf, len);
13801381
HUnlock(h);
1381-
return ResObj_New(h);
1382+
_res = ResObj_New(h);
1383+
return _res;
13821384

13831385
}
13841386

@@ -1403,7 +1405,8 @@ static PyObject *Res_Handle(PyObject *_self, PyObject *_args)
14031405
HUnlock(h);
14041406
rv = (ResourceObject *)ResObj_New(h);
14051407
rv->ob_freeit = PyMac_AutoDisposeHandle;
1406-
return (PyObject *)rv;
1408+
_res = (PyObject *)rv;
1409+
return _res;
14071410

14081411
}
14091412

Mac/Modules/res/resedit.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
HLock(h);
1414
memcpy(*h, buf, len);
1515
HUnlock(h);
16-
return ResObj_New(h);
16+
_res = ResObj_New(h);
17+
return _res;
1718
"""
1819

1920
f = ManualGenerator("Resource", resource_body)
@@ -43,7 +44,8 @@
4344
HUnlock(h);
4445
rv = (ResourceObject *)ResObj_New(h);
4546
rv->ob_freeit = PyMac_AutoDisposeHandle;
46-
return (PyObject *)rv;
47+
_res = (PyObject *)rv;
48+
return _res;
4749
"""
4850

4951
f = ManualGenerator("Handle", handle_body)
@@ -92,7 +94,8 @@ def genresconverter(longname, shortname):
9294
_self->ob_freeit = PyMac_AutoDisposeHandle;
9395
else
9496
_self->ob_freeit = NULL;
95-
return Py_BuildValue("i", old);
97+
_res = Py_BuildValue("i", old);
98+
return _res;
9699
"""
97100
f = ManualGenerator("AutoDispose", AutoDispose_body)
98101
f.docstring = lambda: "(int)->int. Automatically DisposeHandle the object on Python object cleanup"

Mac/Modules/waste/wastemodule.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,20 @@
55

66

77

8+
#ifdef _WIN32
9+
#include "pywintoolbox.h"
10+
#else
811
#include "macglue.h"
912
#include "pymactoolbox.h"
13+
#endif
14+
15+
/* Macro to test whether a weak-loaded CFM function exists */
16+
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
17+
PyErr_SetString(PyExc_NotImplementedError, \
18+
"Not available in this shared library/OS version"); \
19+
return NULL; \
20+
}} while(0)
21+
1022

1123
#include <WASTE.h>
1224
#include <WEObjectHandlers.h>
@@ -213,7 +225,7 @@ PyObject *WEOObj_New(WEObjectReference itself)
213225
it->ob_itself = itself;
214226
return (PyObject *)it;
215227
}
216-
WEOObj_Convert(PyObject *v, WEObjectReference *p_itself)
228+
int WEOObj_Convert(PyObject *v, WEObjectReference *p_itself)
217229
{
218230
if (!WEOObj_Check(v))
219231
{
@@ -381,7 +393,7 @@ PyObject *wasteObj_New(WEReference itself)
381393
WESetInfo(weRefCon, (void *)&it, itself);
382394
return (PyObject *)it;
383395
}
384-
wasteObj_Convert(PyObject *v, WEReference *p_itself)
396+
int wasteObj_Convert(PyObject *v, WEReference *p_itself)
385397
{
386398
if (!wasteObj_Check(v))
387399
{
@@ -1061,7 +1073,6 @@ static PyObject *wasteObj_WEInsert(wasteObject *_self, PyObject *_args)
10611073
if (_err != noErr) return PyMac_Error(_err);
10621074
Py_INCREF(Py_None);
10631075
_res = Py_None;
1064-
pText__error__: ;
10651076
return _res;
10661077
}
10671078

0 commit comments

Comments
 (0)