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

Skip to content

Commit 65cbf93

Browse files
committed
Get rid of support for Universal Headers older than 3.4 and various other
outdated things.
1 parent 55309a3 commit 65cbf93

10 files changed

Lines changed: 6 additions & 78 deletions

File tree

Mac/Modules/ae/_AEmodule.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,7 @@ extern int _AEDesc_Convert(PyObject *, AEDesc *);
3838
#define AEDesc_Convert _AEDesc_Convert
3939
#endif
4040

41-
#if UNIVERSAL_INTERFACES_VERSION >= 0x0340
4241
typedef long refcontype;
43-
#else
44-
typedef unsigned long refcontype;
45-
#endif
4642

4743
static pascal OSErr GenericEventHandler(const AppleEvent *request, AppleEvent *reply, refcontype refcon); /* Forward */
4844

@@ -1426,11 +1422,7 @@ void init_AE(void)
14261422

14271423

14281424
upp_AEIdleProc = NewAEIdleUPP(AEIdleProc);
1429-
#if UNIVERSAL_INTERFACES_VERSION >= 0x03400
1430-
upp_GenericEventHandler = NewAEEventHandlerUPP(&GenericEventHandler);
1431-
#else
14321425
upp_GenericEventHandler = NewAEEventHandlerUPP(GenericEventHandler);
1433-
#endif
14341426
PyMac_INIT_TOOLBOX_OBJECT_NEW(AEDesc *, AEDesc_New);
14351427
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(AEDesc, AEDesc_Convert);
14361428

Mac/Modules/ae/aesupport.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,7 @@ def passInput(self, name):
100100
#define AEDesc_Convert _AEDesc_Convert
101101
#endif
102102
103-
#if UNIVERSAL_INTERFACES_VERSION >= 0x0340
104103
typedef long refcontype;
105-
#else
106-
typedef unsigned long refcontype;
107-
#endif
108104
109105
static pascal OSErr GenericEventHandler(const AppleEvent *request, AppleEvent *reply, refcontype refcon); /* Forward */
110106
@@ -163,11 +159,7 @@ def passInput(self, name):
163159

164160
initstuff = initstuff + """
165161
upp_AEIdleProc = NewAEIdleUPP(AEIdleProc);
166-
#if UNIVERSAL_INTERFACES_VERSION >= 0x03400
167-
upp_GenericEventHandler = NewAEEventHandlerUPP(&GenericEventHandler);
168-
#else
169162
upp_GenericEventHandler = NewAEEventHandlerUPP(GenericEventHandler);
170-
#endif
171163
PyMac_INIT_TOOLBOX_OBJECT_NEW(AEDesc *, AEDesc_New);
172164
PyMac_INIT_TOOLBOX_OBJECT_CONVERT(AEDesc, AEDesc_Convert);
173165
"""

Mac/Modules/dlg/_Dlgmodule.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,6 @@ extern int _DlgObj_Convert(PyObject *, DialogRef *);
3636
#define DlgObj_Convert _DlgObj_Convert
3737
#endif
3838

39-
#if !ACCESSOR_CALLS_ARE_FUNCTIONS && UNIVERSAL_INTERFACES_VERSION < 0x340
40-
#define GetDialogTextEditHandle(dlg) (((DialogPeek)(dlg))->textH)
41-
#define SetPortDialogPort(dlg) SetPort(dlg)
42-
#define GetDialogPort(dlg) ((CGrafPtr)(dlg))
43-
#define GetDialogFromWindow(win) ((DialogRef)(win))
44-
#endif
45-
4639
/* XXX Shouldn't this be a stack? */
4740
static PyObject *Dlg_FilterProc_callback = NULL;
4841

Mac/Modules/dlg/dlgsupport.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,6 @@
4747
#define DlgObj_Convert _DlgObj_Convert
4848
#endif
4949
50-
#if !ACCESSOR_CALLS_ARE_FUNCTIONS && UNIVERSAL_INTERFACES_VERSION < 0x340
51-
#define GetDialogTextEditHandle(dlg) (((DialogPeek)(dlg))->textH)
52-
#define SetPortDialogPort(dlg) SetPort(dlg)
53-
#define GetDialogPort(dlg) ((CGrafPtr)(dlg))
54-
#define GetDialogFromWindow(win) ((DialogRef)(win))
55-
#endif
56-
5750
/* XXX Shouldn't this be a stack? */
5851
static PyObject *Dlg_FilterProc_callback = NULL;
5952

Mac/Modules/hfsplusmodule.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,9 +1390,7 @@ static
13901390
int cataloginfo_from_dict(FSCatalogInfoBitmap bitmap, FSCatalogInfo *info, const PyObject *dict)
13911391
{
13921392
UInt32 storage;
1393-
#if UNIVERSAL_INTERFACES_VERSION > 0x0332
13941393
FSPermissionInfo *permissions;
1395-
#endif
13961394

13971395
// Dates
13981396
if (fetch_utcdatetime(bitmap, kFSCatInfoCreateDate, dict, _kFSCatInfoCreateDate, &info->createDate)) return NULL;
@@ -1401,7 +1399,6 @@ int cataloginfo_from_dict(FSCatalogInfoBitmap bitmap, FSCatalogInfo *info, const
14011399
if (fetch_utcdatetime(bitmap, kFSCatInfoAccessDate, dict, _kFSCatInfoAccessDate, &info->accessDate)) return NULL;
14021400
if (fetch_utcdatetime(bitmap, kFSCatInfoBackupDate, dict, _kFSCatInfoBackupDate, &info->backupDate)) return NULL;
14031401

1404-
#if UNIVERSAL_INTERFACES_VERSION > 0x0332
14051402
// Permissions
14061403
permissions = (FSPermissionInfo *) info->permissions;
14071404
if (fetch_long(bitmap, kFSCatInfoPermissions, dict, _kFSCatInfoUserID, &permissions->userID)) return NULL;
@@ -1410,7 +1407,6 @@ int cataloginfo_from_dict(FSCatalogInfoBitmap bitmap, FSCatalogInfo *info, const
14101407
permissions->mode = (UInt16) storage;
14111408
if (fetch_long(bitmap, kFSCatInfoPermissions, dict, _kFSCatInfoUserAccess, &storage)) return NULL;
14121409
permissions->userAccess = (UInt8) storage;
1413-
#endif
14141410
// IDs
14151411
if (fetch_long(bitmap, kFSCatInfoTextEncoding, dict, _kFSCatInfoTextEncoding, &info->textEncodingHint)) return NULL;
14161412
if (fetch_long(bitmap, kFSCatInfoNodeFlags, dict, _kFSCatInfoNodeFlags, &storage)) return NULL;
@@ -1441,9 +1437,7 @@ PyObject *dict_from_cataloginfo(FSCatalogInfoBitmap bitmap, const FSCatalogInfo
14411437
{
14421438
PyObject *dict;
14431439
PyObject *id;
1444-
#if UNIVERSAL_INTERFACES_VERSION > 0x0332
14451440
FSPermissionInfo *permissions;
1446-
#endif
14471441
char buffer[1024];
14481442

14491443
dict = PyDict_New();
@@ -1473,14 +1467,12 @@ PyObject *dict_from_cataloginfo(FSCatalogInfoBitmap bitmap, const FSCatalogInfo
14731467
if (insert_longlong(bitmap, kFSCatInfoRsrcSizes, dict, _kFSCatInfoRsrcLogical, info->rsrcLogicalSize)) return NULL;
14741468
if (insert_longlong(bitmap, kFSCatInfoRsrcSizes, dict, _kFSCatInfoRsrcPhysical, info->rsrcPhysicalSize)) return NULL;
14751469

1476-
#if UNIVERSAL_INTERFACES_VERSION > 0x0332
14771470
// Permissions
14781471
permissions = (FSPermissionInfo *) info->permissions;
14791472
if (insert_long(bitmap, kFSCatInfoPermissions, dict, _kFSCatInfoUserID, permissions->userID)) return NULL;
14801473
if (insert_long(bitmap, kFSCatInfoPermissions, dict, _kFSCatInfoGroupID, permissions->groupID)) return NULL;
14811474
if (insert_long(bitmap, kFSCatInfoPermissions, dict, _kFSCatInfoUserAccess, permissions->userAccess)) return NULL;
14821475
if (insert_long(bitmap, kFSCatInfoPermissions, dict, _kFSCatInfoMode, permissions->mode)) return NULL;
1483-
#endif
14841476

14851477
// Dates
14861478
if (insert_utcdatetime(bitmap, kFSCatInfoCreateDate, dict, _kFSCatInfoCreateDate, &info->createDate)) return NULL;

Mac/Modules/waste/wastemodule.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,15 @@ static PyObject *ExistingwasteObj_New(WEReference);
4343
** Parse/generate TextStyle records
4444
*/
4545
static
46-
PyObject *TextStyle_New(itself)
47-
TextStylePtr itself;
46+
PyObject *TextStyle_New(TextStylePtr itself)
4847
{
4948

5049
return Py_BuildValue("lllO&", (long)itself->tsFont, (long)itself->tsFace, (long)itself->tsSize, QdRGB_New,
5150
&itself->tsColor);
5251
}
5352

5453
static
55-
TextStyle_Convert(v, p_itself)
56-
PyObject *v;
57-
TextStylePtr p_itself;
54+
TextStyle_Convert(PyObject *v, TextStylePtr p_itself)
5855
{
5956
long font, face, size;
6057

@@ -70,8 +67,7 @@ TextStyle_Convert(v, p_itself)
7067
** Parse/generate RunInfo records
7168
*/
7269
static
73-
PyObject *RunInfo_New(itself)
74-
WERunInfo *itself;
70+
PyObject *RunInfo_New(WERunInfo *itself)
7571
{
7672

7773
return Py_BuildValue("llhhO&O&", itself->runStart, itself->runEnd, itself->runHeight,

Mac/Modules/waste/wastesupport.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,15 @@
8383
** Parse/generate TextStyle records
8484
*/
8585
static
86-
PyObject *TextStyle_New(itself)
87-
TextStylePtr itself;
86+
PyObject *TextStyle_New(TextStylePtr itself)
8887
{
8988
9089
return Py_BuildValue("lllO&", (long)itself->tsFont, (long)itself->tsFace, (long)itself->tsSize, QdRGB_New,
9190
&itself->tsColor);
9291
}
9392
9493
static
95-
TextStyle_Convert(v, p_itself)
96-
PyObject *v;
97-
TextStylePtr p_itself;
94+
TextStyle_Convert(PyObject *v, TextStylePtr p_itself)
9895
{
9996
long font, face, size;
10097
@@ -110,8 +107,7 @@
110107
** Parse/generate RunInfo records
111108
*/
112109
static
113-
PyObject *RunInfo_New(itself)
114-
WERunInfo *itself;
110+
PyObject *RunInfo_New(WERunInfo *itself)
115111
{
116112
117113
return Py_BuildValue("llhhO&O&", itself->runStart, itself->runEnd, itself->runHeight,

Mac/Modules/win/_Winmodule.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,10 @@ extern int _WinObj_Convert(PyObject *, WindowRef *);
3636
#define WinObj_Convert _WinObj_Convert
3737
#endif
3838

39-
#if !ACCESSOR_CALLS_ARE_FUNCTIONS && UNIVERSAL_INTERFACES_VERSION < 0x340
40-
/* Carbon calls that we emulate in classic mode */
41-
#define GetWindowSpareFlag(win) (((CWindowPeek)(win))->spareFlag)
42-
#define GetWindowFromPort(port) ((WindowRef)(port))
43-
#define GetWindowPortBounds(win, rectp) (*(rectp) = ((CWindowPeek)(win))->port.portRect)
44-
#endif
45-
#if !ACCESSOR_CALLS_ARE_FUNCTIONS
46-
#define IsPointerValid(p) (((long)p&3) == 0)
47-
#endif
48-
#if ACCESSOR_CALLS_ARE_FUNCTIONS
4939
/* Classic calls that we emulate in carbon mode */
5040
#define GetWindowUpdateRgn(win, rgn) GetWindowRegion((win), kWindowUpdateRgn, (rgn))
5141
#define GetWindowStructureRgn(win, rgn) GetWindowRegion((win), kWindowStructureRgn, (rgn))
5242
#define GetWindowContentRgn(win, rgn) GetWindowRegion((win), kWindowContentRgn, (rgn))
53-
#endif
5443

5544
/* Function to dispose a window, with a "normal" calling sequence */
5645
static void

Mac/Modules/win/winsupport.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,21 +74,10 @@
7474
#define WinObj_Convert _WinObj_Convert
7575
#endif
7676
77-
#if !ACCESSOR_CALLS_ARE_FUNCTIONS && UNIVERSAL_INTERFACES_VERSION < 0x340
78-
/* Carbon calls that we emulate in classic mode */
79-
#define GetWindowSpareFlag(win) (((CWindowPeek)(win))->spareFlag)
80-
#define GetWindowFromPort(port) ((WindowRef)(port))
81-
#define GetWindowPortBounds(win, rectp) (*(rectp) = ((CWindowPeek)(win))->port.portRect)
82-
#endif
83-
#if !ACCESSOR_CALLS_ARE_FUNCTIONS
84-
#define IsPointerValid(p) (((long)p&3) == 0)
85-
#endif
86-
#if ACCESSOR_CALLS_ARE_FUNCTIONS
8777
/* Classic calls that we emulate in carbon mode */
8878
#define GetWindowUpdateRgn(win, rgn) GetWindowRegion((win), kWindowUpdateRgn, (rgn))
8979
#define GetWindowStructureRgn(win, rgn) GetWindowRegion((win), kWindowStructureRgn, (rgn))
9080
#define GetWindowContentRgn(win, rgn) GetWindowRegion((win), kWindowContentRgn, (rgn))
91-
#endif
9281
9382
/* Function to dispose a window, with a "normal" calling sequence */
9483
static void

Mac/Python/macgetargv.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4545
#include <Carbon/Carbon.h>
4646
#endif /* WITHOUT_FRAMEWORKS */
4747

48-
#if UNIVERSAL_INTERFACES_VERSION >= 0x0340
4948
typedef long refcontype;
50-
#else
51-
typedef unsigned long refcontype;
52-
#endif
5349

5450
#include "Python.h"
5551
#include "macglue.h"

0 commit comments

Comments
 (0)