[Python-checkins] python/dist/src/Python ceval.c, 2.372, 2.373 errors.c, 2.80, 2.81 import.c, 2.224, 2.225 pythonrun.c, 2.200, 2.201 strerror.c, 2.11, 2.12 structmember.c, 2.23, 2.24

jackjansen at users.sourceforge.net jackjansen at users.sourceforge.net
Wed Nov 19 20:45:00 EST 2003


Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1:/tmp/cvs-serv1623/Python
Modified Files:
	ceval.c errors.c import.c pythonrun.c strerror.c 
	structmember.c 
Log Message:
Getting rid of all the code inside #ifdef macintosh too.
Index: ceval.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v
retrieving revision 2.372
retrieving revision 2.373
diff -C2 -d -r2.372 -r2.373
*** ceval.c	5 Nov 2003 17:29:35 -0000	2.372
--- ceval.c	20 Nov 2003 01:44:58 -0000	2.373
***************
*** 15,22 ****
 #include "structmember.h"
 
- #ifdef macintosh
- #include "macglue.h"
- #endif
- 
 #include <ctype.h>
 
--- 15,18 ----
***************
*** 802,806 ****
 				}
 			}
! #if !defined(HAVE_SIGNAL_H) || defined(macintosh)
 			/* If we have true signals, the signal handler
 			 will call Py_AddPendingCall() so we don't
--- 798,802 ----
 				}
 			}
! #if !defined(HAVE_SIGNAL_H)
 			/* If we have true signals, the signal handler
 			 will call Py_AddPendingCall() so we don't
Index: errors.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/errors.c,v
retrieving revision 2.80
retrieving revision 2.81
diff -C2 -d -r2.80 -r2.81
*** errors.c	25 Oct 2003 14:29:27 -0000	2.80
--- errors.c	20 Nov 2003 01:44:58 -0000	2.81
***************
*** 4,13 ****
 #include "Python.h"
 
- #ifdef macintosh
- extern char *PyMac_StrError(int);
- #undef strerror
- #define strerror PyMac_StrError
- #endif /* macintosh */
- 
 #ifndef __STDC__
 #ifndef MS_WINDOWS
--- 4,7 ----
Index: import.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/import.c,v
retrieving revision 2.224
retrieving revision 2.225
diff -C2 -d -r2.224 -r2.225
*** import.c	20 Oct 2003 14:01:55 -0000	2.224
--- import.c	20 Nov 2003 01:44:58 -0000	2.225
***************
*** 12,18 ****
 #include "osdefs.h"
 #include "importdl.h"
- #ifdef macintosh
- #include "macglue.h"
- #endif
 
 #ifdef HAVE_FCNTL_H
--- 12,15 ----
***************
*** 836,842 ****
 	if (Py_VerboseFlag)
 		PySys_WriteStderr("# wrote %s\n", cpathname);
- #ifdef macintosh
- 	PyMac_setfiletype(cpathname, 'Pyth', 'PYC ');
- #endif
 }
 
--- 833,836 ----
***************
*** 1124,1134 ****
 		strcat(buf, name);
 		strcpy(name, buf);
- #ifdef macintosh
- 		/* Freezing on the mac works different, and the modules are
- 		** actually on sys.path. So we don't take the quick exit but
- 		** continue with the normal flow.
- 		*/
- 		path = NULL;
- #else
 		if (find_frozen(name) != NULL) {
 			strcpy(buf, name);
--- 1118,1121 ----
***************
*** 1138,1142 ****
 			 "No frozen submodule named %.200s", name);
 		return NULL;
- #endif
 	}
 	if (path == NULL) {
--- 1125,1128 ----
***************
*** 1234,1264 ****
 		}
 
- #ifdef macintosh
- 		/*
- 		** Speedup: each sys.path item is interned, and
- 		** FindResourceModule remembers which items refer to
- 		** folders (so we don't have to bother trying to look
- 		** into them for resources). We only do this for string
- 		** items.
- 		*/
- 		if (PyString_Check(PyList_GET_ITEM(path, i))) {
- 			PyString_InternInPlace(&PyList_GET_ITEM(path, i));
- 			v = PyList_GET_ITEM(path, i);
- 			if (PyMac_FindResourceModule((PyStringObject *)v, name, buf)) {
- 				static struct filedescr resfiledescr =
- 					{"", "", PY_RESOURCE};
- 
- 				Py_XDECREF(copy);
- 				return &resfiledescr;
- 			}
- 			if (PyMac_FindCodeResourceModule((PyStringObject *)v, name, buf)) {
- 				static struct filedescr resfiledescr =
- 					{"", "", PY_CODERESOURCE};
- 
- 				Py_XDECREF(copy);
- 				return &resfiledescr;
- 			}
- 		}
- #endif
 		if (len > 0 && buf[len-1] != SEP
 #ifdef ALTSEP
--- 1220,1223 ----
***************
*** 1291,1298 ****
 #endif
 #endif
- #ifdef macintosh
- 		fdp = PyMac_FindModuleExtension(buf, &len, name);
- 		if (fdp) {
- #else
 #if defined(PYOS_OS2)
 		/* take a snapshot of the module spec for restoration
--- 1250,1253 ----
***************
*** 1332,1336 ****
 			if (Py_VerboseFlag > 1)
 				PySys_WriteStderr("# trying %s\n", buf);
- #endif /* !macintosh */
 			filemode = fdp->mode;
 			if (filemode[0] == 'U') 
--- 1287,1290 ----
***************
*** 1409,1415 ****
 #include <dir.h>
 
- #elif defined(macintosh)
- #include <TextUtils.h>
- 
 #elif defined(__MACH__) && defined(__APPLE__) && defined(HAVE_DIRENT_H)
 #include <sys/types.h>
--- 1363,1366 ----
***************
*** 1476,1497 ****
 	return strncmp(ffblk.ff_name, name, namelen) == 0;
 
- /* macintosh */
- #elif defined(macintosh)
- 	FSSpec fss;
- 	OSErr err;
- 
- 	if (Py_GETENV("PYTHONCASEOK") != NULL)
- 		return 1;
- 
- 	err = FSMakeFSSpec(0, 0, Pstring(buf), &fss);
- 	if (err) {
- 		PyErr_Format(PyExc_NameError,
- 		 "Can't find file for module %.100s\n(filename %.300s)",
- 		 name, buf);
- 		return 0;
- 	}
- 	return fss.name[0] >= namelen &&
- 	 strncmp(name, (char *)fss.name+1, namelen) == 0;
- 
 /* new-fangled macintosh (macosx) */
 #elif defined(__MACH__) && defined(__APPLE__) && defined(HAVE_DIRENT_H)
--- 1427,1430 ----
***************
*** 1710,1722 ****
 #endif
 
- #ifdef macintosh
- 	case PY_RESOURCE:
- 		m = PyMac_LoadResourceModule(name, buf);
- 		break;
- 	case PY_CODERESOURCE:
- 		m = PyMac_LoadCodeResourceModule(name, buf);
- 		break;
- #endif
- 
 	case PKG_DIRECTORY:
 		m = load_package(name, buf);
--- 1643,1646 ----
***************
*** 2679,2697 ****
 }
 
- #ifdef macintosh
- static PyObject *
- imp_load_resource(PyObject *self, PyObject *args)
- {
- 	char *name;
- 	char *pathname;
- 	PyObject *m;
- 
- 	if (!PyArg_ParseTuple(args, "ss:load_resource", &name, &pathname))
- 		return NULL;
- 	m = PyMac_LoadResourceModule(name, pathname);
- 	return m;
- }
- #endif /* macintosh */
- 
 static PyObject *
 imp_load_module(PyObject *self, PyObject *args)
--- 2603,2606 ----
***************
*** 2823,2829 ****
 #endif
 	{"load_package",	imp_load_package,	METH_VARARGS},
- #ifdef macintosh
- 	{"load_resource",	imp_load_resource,	METH_VARARGS},
- #endif
 	{"load_source",		imp_load_source,	METH_VARARGS},
 	{NULL,			NULL}		/* sentinel */
--- 2732,2735 ----
Index: pythonrun.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v
retrieving revision 2.200
retrieving revision 2.201
diff -C2 -d -r2.200 -r2.201
*** pythonrun.c	19 Nov 2003 15:24:47 -0000	2.200
--- pythonrun.c	20 Nov 2003 01:44:58 -0000	2.201
***************
*** 28,34 ****
 #endif
 
- #ifdef macintosh
- #include "macglue.h"
- #endif
 extern char *Py_GetPath(void);
 
--- 28,31 ----
***************
*** 756,766 ****
 		return 1;
 
- #ifdef macintosh
- 	/* On a mac, we also assume a pyc file for types 'PYC ' and 'APPL' */
- 	if (PyMac_getfiletype((char *)filename) == 'PYC '
- 	 || PyMac_getfiletype((char *)filename) == 'APPL')
- 		return 1;
- #endif /* macintosh */
- 
 	/* Only look into the file if we are allowed to close it, since
 	 it then should also be seekable. */
--- 753,756 ----
***************
*** 1543,1551 ****
 	Py_Finalize();
 
- #ifdef macintosh
- 	PyMac_Exit(sts);
- #else
 	exit(sts);
- #endif
 }
 
--- 1533,1537 ----
Index: strerror.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/strerror.c,v
retrieving revision 2.11
retrieving revision 2.12
diff -C2 -d -r2.11 -r2.12
*** strerror.c	28 Nov 2001 20:42:01 -0000	2.11
--- strerror.c	20 Nov 2003 01:44:58 -0000	2.12
***************
*** 18,24 ****
 	return buf;
 }
- 
- #ifdef macintosh
- int sys_nerr = 0;
- char *sys_errlist[1] = 0;
- #endif
--- 18,19 ----
Index: structmember.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/structmember.c,v
retrieving revision 2.23
retrieving revision 2.24
diff -C2 -d -r2.23 -r2.24
*** structmember.c	4 Dec 2001 16:23:42 -0000	2.23
--- structmember.c	20 Nov 2003 01:44:58 -0000	2.24
***************
*** 104,124 ****
 		v = PyString_FromString((char*)addr);
 		break;
- #ifdef macintosh
- 	case T_PSTRING:
- 		if (*(char**)addr == NULL) {
- 			Py_INCREF(Py_None);
- 			v = Py_None;
- 		}
- 		else
- 			v = PyString_FromStringAndSize(
- 				(*(char**)addr)+1,
- 				**(unsigned char**)addr);
- 		break;
- 	case T_PSTRING_INPLACE:
- 		v = PyString_FromStringAndSize(
- 			((char*)addr)+1,
- 			*(unsigned char*)addr);
- 		break;
- #endif /* macintosh */
 	case T_CHAR:
 		v = PyString_FromStringAndSize((char*)addr, 1);
--- 104,107 ----
***************
*** 169,177 ****
 	PyObject *oldv;
 
! 	if ((l->flags & READONLY) || l->type == T_STRING
! #ifdef macintosh
! 	 || l->type == T_PSTRING
! #endif
! 		)
 	{
 		PyErr_SetString(PyExc_TypeError, "readonly attribute");
--- 152,156 ----
 	PyObject *oldv;
 
! 	if ((l->flags & READONLY) || l->type == T_STRING)
 	{
 		PyErr_SetString(PyExc_TypeError, "readonly attribute");


More information about the Python-checkins mailing list

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