[Python-checkins] python/dist/src/Mac/Modules/list _Listmodule.c,1.13,1.14 listsupport.py,1.16,1.17

jackjansen@users.sourceforge.net jackjansen@users.sourceforge.net
2002年12月12日 02:32:23 -0800


Update of /cvsroot/python/python/dist/src/Mac/Modules/list
In directory sc8-pr-cvs1:/tmp/cvs-serv21368/Modules/list
Modified Files:
	_Listmodule.c listsupport.py 
Log Message:
Getting rid of pre-Carbon (MacOS8) support. All code depending on
TARGET_API_MAC_OS8 (or !TARGET_API_MAC_CARBON) is gone. Also some
TARGET_API_MAC_OSX conditional code is gone, because it is no longer
used on OSX-only Python (only in MacPython-OS9).
Index: _Listmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/list/_Listmodule.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** _Listmodule.c	3 Dec 2002 23:40:20 -0000	1.13
--- _Listmodule.c	12 Dec 2002 10:31:51 -0000	1.14
***************
*** 65,101 ****
 static ListDefUPP myListDefFunctionUPP;
 
- #if !TARGET_API_MAC_CARBON
- 
- #define kJumpAbs 0x4EF9
- 
- #pragma options align=mac68k
- typedef struct {
- 	short jmpabs; /* 4EF9 */
- 	ListDefUPP theUPP; /* 00000000 */
- } LDEFStub, **LDEFStubHandle;
- #pragma options align=reset
- 
- static OSErr installLDEFStub(ListHandle list) {
- 	LDEFStubHandle stubH;
- 
- 	stubH = (LDEFStubHandle)NewHandleClear(sizeof(LDEFStub));
- 	if (stubH == NULL)
- 		return MemError();
- 	
- 	(*stubH)->jmpabs = kJumpAbs;
- 	(*stubH)->theUPP = myListDefFunctionUPP;
- 	HLock((Handle) stubH);
- 	
- 	(*list)->listDefProc = (Handle)stubH;
- 	return noErr;
- }
- 
- static void removeLDEFStub(ListHandle list) {
- 	if ((*list)->listDefProc)
- 		DisposeHandle((Handle)(*list)->listDefProc);
- 	(*list)->listDefProc = NULL;
- }
- 
- #endif
 
 static PyObject *List_Error;
--- 65,68 ----
***************
*** 111,115 ****
 	ListHandle ob_itself;
 	PyObject *ob_ldef_func;
- 	int ob_have_ldef_stub;
 	int ob_must_be_disposed;
 } ListObject;
--- 78,81 ----
***************
*** 126,130 ****
 	it->ob_itself = itself;
 	it->ob_ldef_func = NULL;
- 	it->ob_have_ldef_stub = 0;
 	it->ob_must_be_disposed = 1;
 	SetListRefCon(itself, (long)it);
--- 92,95 ----
***************
*** 146,152 ****
 	Py_XDECREF(self->ob_ldef_func);
 	self->ob_ldef_func = NULL;
- #if !TARGET_API_MAC_CARBON
- 	if (self->ob_have_ldef_stub) removeLDEFStub(self->ob_itself);
- #endif
 	SetListRefCon(self->ob_itself, (long)0);
 	if (self->ob_must_be_disposed && self->ob_itself) LDispose(self->ob_itself);
--- 111,114 ----
***************
*** 902,906 ****
 
 
- #if TARGET_API_MAC_CARBON
 	/* Carbon applications use the CreateCustomList API */ 
 	theSpec.u.userProc = myListDefFunctionUPP;
--- 864,867 ----
***************
*** 916,937 ****
 	 &outList);
 
- #else
- 	/* pre-Carbon applications set the address in the LDEF
- 	to a routine descriptor referring to their list
- 	definition routine. */
- 	outList = LNew(&rView,
- 	 &dataBounds,
- 	 cellSize,
- 	 0,
- 	 theWindow,
- 	 drawIt, /* XXX must be false */
- 	 hasGrow,
- 	 scrollHoriz,
- 	 scrollVert);
- 	if (installLDEFStub(outList) != noErr) {
- 		PyErr_SetString(PyExc_MemoryError, "can't create LDEF stub");
- 		return NULL;
- 	}
- #endif
 
 	_res = ListObj_New(outList);
--- 877,880 ----
***************
*** 940,946 ****
 	Py_INCREF(listDefFunc);
 	((ListObject*)_res)->ob_ldef_func = listDefFunc;
- #if !TARGET_API_MAC_CARBON
- 	((ListObject*)_res)->ob_have_ldef_stub = 1;
- #endif
 	return _res;
 }
--- 883,886 ----
Index: listsupport.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/list/listsupport.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** listsupport.py	3 Dec 2002 23:40:20 -0000	1.16
--- listsupport.py	12 Dec 2002 10:31:51 -0000	1.17
***************
*** 84,120 ****
 static ListDefUPP myListDefFunctionUPP;
 
- #if !TARGET_API_MAC_CARBON
- 
- #define kJumpAbs 0x4EF9
- 
- #pragma options align=mac68k
- typedef struct {
- 	short jmpabs; /* 4EF9 */
- 	ListDefUPP theUPP; /* 00000000 */
- } LDEFStub, **LDEFStubHandle;
- #pragma options align=reset
- 
- static OSErr installLDEFStub(ListHandle list) {
- 	LDEFStubHandle stubH;
- 
- 	stubH = (LDEFStubHandle)NewHandleClear(sizeof(LDEFStub));
- 	if (stubH == NULL)
- 		return MemError();
- 	
- 	(*stubH)->jmpabs = kJumpAbs;
- 	(*stubH)->theUPP = myListDefFunctionUPP;
- 	HLock((Handle) stubH);
- 	
- 	(*list)->listDefProc = (Handle)stubH;
- 	return noErr;
- }
- 
- static void removeLDEFStub(ListHandle list) {
- 	if ((*list)->listDefProc)
- 		DisposeHandle((Handle)(*list)->listDefProc);
- 	(*list)->listDefProc = NULL;
- }
- 
- #endif
 """
 
--- 84,87 ----
***************
*** 160,164 ****
 		ObjectDefinition.outputStructMembers(self)
 		Output("PyObject *ob_ldef_func;")
- 		Output("int ob_have_ldef_stub;")
 		Output("int ob_must_be_disposed;")
 
--- 127,130 ----
***************
*** 172,176 ****
 		ObjectDefinition.outputInitStructMembers(self)
 		Output("it->ob_ldef_func = NULL;")
- 		Output("it->ob_have_ldef_stub = 0;")
 		Output("it->ob_must_be_disposed = 1;")
 		Output("SetListRefCon(itself, (long)it);")
--- 138,141 ----
***************
*** 179,185 ****
 		Output("Py_XDECREF(self->ob_ldef_func);")
 		Output("self->ob_ldef_func = NULL;")
- 		Output("#if !TARGET_API_MAC_CARBON")
- 		Output("if (self->ob_have_ldef_stub) removeLDEFStub(self->ob_itself);");
- 		Output("#endif");
 		Output("SetListRefCon(self->ob_itself, (long)0);")
 		Output("if (self->ob_must_be_disposed && %s) LDispose(%s);", itselfname, itselfname)
--- 144,147 ----
***************
*** 286,290 ****
 
 
- #if TARGET_API_MAC_CARBON
 /* Carbon applications use the CreateCustomList API */ 
 theSpec.u.userProc = myListDefFunctionUPP;
--- 248,251 ----
***************
*** 300,321 ****
 &outList);
 
- #else
- /* pre-Carbon applications set the address in the LDEF
- to a routine descriptor referring to their list
- definition routine. */
- outList = LNew(&rView,
- &dataBounds,
- cellSize,
- 0,
- theWindow,
- drawIt, /* XXX must be false */
- hasGrow,
- scrollHoriz,
- scrollVert);
- if (installLDEFStub(outList) != noErr) {
- 	PyErr_SetString(PyExc_MemoryError, "can't create LDEF stub");
- 	return NULL;
- }
- #endif
 
 _res = ListObj_New(outList);
--- 261,264 ----
***************
*** 324,330 ****
 Py_INCREF(listDefFunc);
 ((ListObject*)_res)->ob_ldef_func = listDefFunc;
- #if !TARGET_API_MAC_CARBON
- ((ListObject*)_res)->ob_have_ldef_stub = 1;
- #endif
 return _res;\
 """
--- 267,270 ----

AltStyle によって変換されたページ (->オリジナル) /