- Don't return mac-style pathnames in unix-Python.
- Fixed up a lot more prototypes (gcc also wants them on static routines)
- Fixed various other gcc warnings.
diff --git a/Mac/Modules/macfsmodule.c b/Mac/Modules/macfsmodule.c
index af5d390..6204cee 100644
--- a/Mac/Modules/macfsmodule.c
+++ b/Mac/Modules/macfsmodule.c
@@ -101,9 +101,7 @@
 /* ---------------------------------------------------------------- */
 
 static PyObject *
-mfsa_Resolve(self, args)
-	mfsaobject *self;
-	PyObject *args;
+mfsa_Resolve(mfsaobject *self, PyObject *args)
 {
 	FSSpec from, *fromp, result;
 	Boolean changed;
@@ -125,9 +123,7 @@
 }
 
 static PyObject *
-mfsa_GetInfo(self, args)
-	mfsaobject *self;
-	PyObject *args;
+mfsa_GetInfo(mfsaobject *self, PyObject *args)
 {
 	Str63 value;
 	int i;
@@ -144,9 +140,7 @@
 }
 
 static PyObject *
-mfsa_Update(self, args)
-	mfsaobject *self;
-	PyObject *args;
+mfsa_Update(mfsaobject *self, PyObject *args)
 {
 	FSSpec target, fromfile, *fromfilep;
 	OSErr err;
@@ -179,9 +173,7 @@
 /* ---------- */
 
 static PyObject *
-mfsa_getattr(self, name)
-	mfsaobject *self;
-	char *name;
+mfsa_getattr(mfsaobject *self, char *name)
 {
 	if ( strcmp(name, "data") == 0 ) {
 		int size;
@@ -210,8 +202,7 @@
 
 
 static void
-mfsa_dealloc(self)
-	mfsaobject *self;
+mfsa_dealloc(mfsaobject *self)
 {
 #if 0
 	if ( self->alias ) {
@@ -254,7 +245,7 @@
 /* ---------- */
 
 static mfsiobject *
-newmfsiobject()
+newmfsiobject(void)
 {
 	mfsiobject *self;
 	
@@ -266,16 +257,13 @@
 }
 
 static void
-mfsi_dealloc(self)
-	mfsiobject *self;
+mfsi_dealloc(mfsiobject *self)
 {
 	PyMem_DEL(self);
 }
 
 static PyObject *
-mfsi_getattr(self, name)
-	mfsiobject *self;
-	char *name;
+mfsi_getattr(mfsiobject *self, char *name)
 {
 	if ( strcmp(name, "Type") == 0 )
 		return PyMac_BuildOSType(self->finfo.fdType);
@@ -293,10 +281,7 @@
 
 
 static int
-mfsi_setattr(self, name, v)
-	mfsiobject *self;
-	char *name;
-	PyObject *v;
+mfsi_setattr(mfsiobject *self, char *name, PyObject *v)
 {
 	int rv;
 	int i;
@@ -413,9 +398,8 @@
 ** Two generally useful routines
 */
 static OSErr
-PyMac_GetFileDates(fss, crdat, mddat, bkdat)
-	FSSpec *fss;
-	unsigned long *crdat, *mddat, *bkdat;
+PyMac_GetFileDates(FSSpec *fss, unsigned long *crdat, unsigned long *mddat, 
+		unsigned long *bkdat)
 {
 	CInfoPBRec pb;
 	OSErr error;
@@ -433,9 +417,8 @@
 }	
 
 static OSErr
-PyMac_SetFileDates(fss, crdat, mddat, bkdat)
-	FSSpec *fss;
-	unsigned long crdat, mddat, bkdat;
+PyMac_SetFileDates(FSSpec *fss, unsigned long crdat, unsigned long mddat, 
+		unsigned long bkdat)
 {
 	CInfoPBRec pb;
 	OSErr error;
@@ -458,10 +441,12 @@
 }
 
 static PyObject *
-mfss_as_pathname(self, args)
-	mfssobject *self;
-	PyObject *args;
+mfss_as_pathname(mfssobject *self, PyObject *args)
 {
+#if TARGET_API_MAC_OSX
+	PyErr_SetString(PyExc_NotImplementedError, "FSSpec.as_pathname not supported on this platform");
+	return 0;
+#else
 	char strbuf[257];
 	OSErr err;
 
@@ -473,12 +458,11 @@
 		return NULL;
 	}
 	return PyString_FromString(strbuf);
+#endif
 }
 
 static PyObject *
-mfss_as_tuple(self, args)
-	mfssobject *self;
-	PyObject *args;
+mfss_as_tuple(mfssobject *self, PyObject *args)
 {
 	if (!PyArg_ParseTuple(args, ""))
 		return NULL;
@@ -487,9 +471,7 @@
 }
 
 static PyObject *
-mfss_NewAlias(self, args)
-	mfssobject *self;
-	PyObject *args;
+mfss_NewAlias(mfssobject *self, PyObject *args)
 {
 	FSSpec src, *srcp;
 	OSErr err;
@@ -512,9 +494,7 @@
 }
 
 static PyObject *
-mfss_NewAliasMinimal(self, args)
-	mfssobject *self;
-	PyObject *args;
+mfss_NewAliasMinimal(mfssobject *self, PyObject *args)
 {
 	OSErr err;
 	AliasHandle alias;
@@ -530,9 +510,7 @@
 }
 
 static PyObject *
-mfss_FSpMakeFSRef(self, args)
-	mfssobject *self;
-	PyObject *args;
+mfss_FSpMakeFSRef(mfssobject *self, PyObject *args)
 {
 #if TARGET_API_MAC_OS8
 	PyErr_SetString(PyExc_NotImplementedError, "FSRef objects not supported on this platform");
@@ -554,9 +532,7 @@
 
 /* XXXX These routines should be replaced by a wrapper to the *FInfo routines */
 static PyObject *
-mfss_GetCreatorType(self, args)
-	mfssobject *self;
-	PyObject *args;
+mfss_GetCreatorType(mfssobject *self, PyObject *args)
 {
 	OSErr err;
 	FInfo info;
@@ -573,9 +549,7 @@
 }
 
 static PyObject *
-mfss_SetCreatorType(self, args)
-	mfssobject *self;
-	PyObject *args;
+mfss_SetCreatorType(mfssobject *self, PyObject *args)
 {
 	OSErr err;
 	OSType creator, type;
@@ -600,9 +574,7 @@
 }
 
 static PyObject *
-mfss_GetFInfo(self, args)
-	mfssobject *self;
-	PyObject *args;
+mfss_GetFInfo(mfssobject *self, PyObject *args)
 {
 	OSErr err;
 	mfsiobject *fip;
@@ -622,9 +594,7 @@
 }
 
 static PyObject *
-mfss_SetFInfo(self, args)
-	mfssobject *self;
-	PyObject *args;
+mfss_SetFInfo(mfssobject *self, PyObject *args)
 {
 	OSErr err;
 	mfsiobject *fip;
@@ -641,9 +611,7 @@
 }
 
 static PyObject *
-mfss_GetDates(self, args)
-	mfssobject *self;
-	PyObject *args;
+mfss_GetDates(mfssobject *self, PyObject *args)
 {
 	OSErr err;
 	unsigned long crdat, mddat, bkdat;
@@ -659,9 +627,7 @@
 }
 
 static PyObject *
-mfss_SetDates(self, args)
-	mfssobject *self;
-	PyObject *args;
+mfss_SetDates(mfssobject *self, PyObject *args)
 {
 	OSErr err;
 	double crdat, mddat, bkdat;
@@ -698,9 +664,7 @@
 /* ---------- */
 
 static PyObject *
-mfss_getattr(self, name)
-	mfssobject *self;
-	char *name;
+mfss_getattr(mfssobject *self, char *name)
 {
 	if ( strcmp(name, "data") == 0)
 		return PyString_FromStringAndSize((char *)&self->fsspec, sizeof(FSSpec));	
@@ -708,8 +672,7 @@
 }
 
 mfssobject *
-newmfssobject(fss)
-	FSSpec *fss;
+newmfssobject(FSSpec *fss)
 {
 	mfssobject *self;
 	
@@ -721,19 +684,17 @@
 }
 
 static void
-mfss_dealloc(self)
-	mfssobject *self;
+mfss_dealloc(mfssobject *self)
 {
 	PyMem_DEL(self);
 }
 
 static PyObject *
-mfss_repr(self)
-	mfssobject *self;
+mfss_repr(mfssobject *self)
 {
 	char buf[512];
 
-	sprintf(buf, "FSSpec((%d, %d, '%.*s'))",
+	sprintf(buf, "FSSpec((%d, %ld, '%.*s'))",
 		self->fsspec.vRefNum, 
 		self->fsspec.parID,
 		self->fsspec.name[0], self->fsspec.name+1);
@@ -741,8 +702,7 @@
 }
 
 static int
-mfss_compare(v, w)
-	mfssobject *v, *w;
+mfss_compare(mfssobject *v, mfssobject *w)
 {
 	int minlen;
 	int res;
@@ -783,9 +743,7 @@
 /* -------------------------------------------------------- */
 #if !TARGET_API_MAC_OS8
 static PyObject *
-mfsr_as_fsspec(self, args)
-	mfsrobject *self;
-	PyObject *args;
+mfsr_as_fsspec(mfsrobject *self, PyObject *args)
 {
 	OSErr err;
 	FSSpec fss;
@@ -822,9 +780,7 @@
 /* ---------- */
 
 static PyObject *
-mfsr_getattr(self, name)
-	mfsrobject *self;
-	char *name;
+mfsr_getattr(mfsrobject *self, char *name)
 {
 	if ( strcmp(name, "data") == 0)
 		return PyString_FromStringAndSize((char *)&self->fsref, sizeof(FSRef));	
@@ -832,8 +788,7 @@
 }
 
 mfsrobject *
-newmfsrobject(fsr)
-	FSRef *fsr;
+newmfsrobject(FSRef *fsr)
 {
 	mfsrobject *self;
 	
@@ -845,8 +800,7 @@
 }
 
 static int
-mfsr_compare(v, w)
-	mfsrobject *v, *w;
+mfsr_compare(mfsrobject *v, mfsrobject *w)
 {
 	OSErr err;
 	
@@ -860,8 +814,7 @@
 }
 
 static void
-mfsr_dealloc(self)
-	mfsrobject *self;
+mfsr_dealloc(mfsrobject *self)
 {
 	PyMem_DEL(self);
 }
@@ -890,9 +843,7 @@
 /* -------------------------------------------------------- */
 
 static PyObject *
-mfs_ResolveAliasFile(self, args)
-	PyObject *self;	/* Not used */
-	PyObject *args;
+mfs_ResolveAliasFile(PyObject *self, PyObject *args)
 {
 	FSSpec fss;
 	Boolean chain = 1, isfolder, wasaliased;
@@ -910,9 +861,7 @@
 
 #if !TARGET_API_MAC_CARBON
 static PyObject *
-mfs_StandardGetFile(self, args)
-	PyObject *self;	/* Not used */
-	PyObject *args;
+mfs_StandardGetFile(PyObject *self, PyObject *args)
 {
 	SFTypeList list;
 	short numtypes;
@@ -934,9 +883,7 @@
 }
 
 static PyObject *
-mfs_PromptGetFile(self, args)
-	PyObject *self;	/* Not used */
-	PyObject *args;
+mfs_PromptGetFile(PyObject *self, PyObject *args)
 {
 	SFTypeList list;
 	short numtypes;
@@ -959,9 +906,7 @@
 }
 
 static PyObject *
-mfs_StandardPutFile(self, args)
-	PyObject *self;	/* Not used */
-	PyObject *args;
+mfs_StandardPutFile(PyObject *self, PyObject *args)
 {
 	Str255 prompt, dft;
 	StandardFileReply reply;
@@ -976,9 +921,7 @@
 /*
 ** Set initial directory for file dialogs */
 static PyObject *
-mfs_SetFolder(self, args)
-	PyObject *self;
-	PyObject *args;
+mfs_SetFolder(PyObject *self, PyObject *args)
 {
 	FSSpec spec;
 	FSSpec ospec;
@@ -1002,9 +945,7 @@
 #endif
 
 static PyObject *
-mfs_FSSpec(self, args)
-	PyObject *self;	/* Not used */
-	PyObject *args;
+mfs_FSSpec(PyObject *self, PyObject *args)
 {
 	FSSpec fss;
 
@@ -1014,9 +955,7 @@
 }
 
 static PyObject *
-mfs_FSRef(self, args)
-	PyObject *self;	/* Not used */
-	PyObject *args;
+mfs_FSRef(PyObject *self, PyObject *args)
 {
 #if TARGET_API_MAC_OS8
 	PyErr_SetString(PyExc_NotImplementedError, "FSRef objects not supported on this platform");
@@ -1031,9 +970,7 @@
 }
 
 static PyObject *
-mfs_RawFSSpec(self, args)
-	PyObject *self;	/* Not used */
-	PyObject *args;
+mfs_RawFSSpec(PyObject *self, PyObject *args)
 {
 	FSSpec *fssp;
 	int size;
@@ -1048,9 +985,7 @@
 }
 
 static PyObject *
-mfs_RawAlias(self, args)
-	PyObject *self;	/* Not used */
-	PyObject *args;
+mfs_RawAlias(PyObject *self, PyObject *args)
 {
 	char *dataptr;
 	Handle h;
@@ -1071,9 +1006,7 @@
 
 #if !TARGET_API_MAC_CARBON
 static PyObject *
-mfs_GetDirectory(self, args)
-	PyObject *self;	/* Not used */
-	PyObject *args;
+mfs_GetDirectory(PyObject *self, PyObject *args)
 {
 	FSSpec fsdir;
 	int ok;
@@ -1088,9 +1021,7 @@
 #endif
 
 static PyObject *
-mfs_FindFolder(self, args)
-	PyObject *self;	/* Not used */
-	PyObject *args;
+mfs_FindFolder(PyObject *self, PyObject *args)
 {
 	OSErr err;
 	short where;
@@ -1110,9 +1041,7 @@
 }
 
 static PyObject *
-mfs_FindApplication(self, args)
-	PyObject *self;	/* Not used */
-	PyObject *args;
+mfs_FindApplication(PyObject *self, PyObject *args)
 {
 	OSErr err;
 	OSType which;
@@ -1129,17 +1058,13 @@
 }
 
 static PyObject *
-mfs_FInfo(self, args)
-	PyObject *self;
-	PyObject *args;
+mfs_FInfo(PyObject *self, PyObject *args)
 {	
 	return (PyObject *)newmfsiobject();
 }
 
 static PyObject *
-mfs_NewAliasMinimalFromFullPath(self, args)
-	PyObject *self;	/* Not used */
-	PyObject *args;
+mfs_NewAliasMinimalFromFullPath(PyObject *self, PyObject *args)
 {
 	OSErr err;
 	char *fullpath;
@@ -1277,7 +1202,7 @@
 /* Initialization function for the module (*must* be called initmacfs) */
 
 void
-initmacfs()
+initmacfs(void)
 {
 	PyObject *m, *d;
 
diff --git a/Mac/Modules/macosmodule.c b/Mac/Modules/macosmodule.c
index c99aa4b..0b8d856 100644
--- a/Mac/Modules/macosmodule.c
+++ b/Mac/Modules/macosmodule.c
@@ -44,8 +44,6 @@
 #define bufferIsSmall -607	/*error returns from Post and Accept */
 #endif
 
-static PyObject *ErrorObject;
-
 /* ----------------------------------------------------- */
 
 /* Declarations for objects of type Resource fork */
@@ -63,8 +61,7 @@
 /* ---------------------------------------------------------------- */
 
 static void
-do_close(self)
-	rfobject *self;
+do_close(rfobject *self)
 {
 	if (self->isclosed ) return;
 	(void)FSClose(self->fRefNum);
@@ -76,9 +73,7 @@
 ;
 
 static PyObject *
-rf_read(self, args)
-	rfobject *self;
-	PyObject *args;
+rf_read(rfobject *self, PyObject *args)
 {
 	long n;
 	PyObject *v;
@@ -112,9 +107,7 @@
 ;
 
 static PyObject *
-rf_write(self, args)
-	rfobject *self;
-	PyObject *args;
+rf_write(rfobject *self, PyObject *args)
 {
 	char *buffer;
 	long size;
@@ -141,9 +134,7 @@
 ;
 
 static PyObject *
-rf_seek(self, args)
-	rfobject *self;
-	PyObject *args;
+rf_seek(rfobject *self, PyObject *args)
 {
 	long amount, pos;
 	int whence = SEEK_SET;
@@ -157,12 +148,12 @@
 	if (!PyArg_ParseTuple(args, "l|i", &amount, &whence))
 		return NULL;
 	
-	if ( err = GetEOF(self->fRefNum, &eof))
+	if ((err = GetEOF(self->fRefNum, &eof)))
 		goto ioerr;
 	
 	switch (whence) {
 	case SEEK_CUR:
-		if (err = GetFPos(self->fRefNum, &pos))
+		if ((err = GetFPos(self->fRefNum, &pos)))
 			goto ioerr; 
 		break;
 	case SEEK_END:
@@ -184,7 +175,7 @@
 		return NULL;
 	}
 	
-	if ( err = SetFPos(self->fRefNum, fsFromStart, pos) ) {
+	if ((err = SetFPos(self->fRefNum, fsFromStart, pos)) ) {
 ioerr:
 		PyMac_Error(err);
 		return NULL;
@@ -199,9 +190,7 @@
 ;
 
 static PyObject *
-rf_tell(self, args)
-	rfobject *self;
-	PyObject *args;
+rf_tell(rfobject *self, PyObject *args)
 {
 	long where;
 	OSErr err;
@@ -212,7 +201,7 @@
 	}
 	if (!PyArg_ParseTuple(args, ""))
 		return NULL;
-	if ( err = GetFPos(self->fRefNum, &where) ) {
+	if ((err = GetFPos(self->fRefNum, &where)) ) {
 		PyMac_Error(err);
 		return NULL;
 	}
@@ -224,9 +213,7 @@
 ;
 
 static PyObject *
-rf_close(self, args)
-	rfobject *self;
-	PyObject *args;
+rf_close(rfobject *self, PyObject *args)
 {
 	if (!PyArg_ParseTuple(args, ""))
 		return NULL;
@@ -237,11 +224,11 @@
 
 
 static struct PyMethodDef rf_methods[] = {
-	{"read",	rf_read,	1,	rf_read__doc__},
- {"write",	rf_write,	1,	rf_write__doc__},
- {"seek",	rf_seek,	1,	rf_seek__doc__},
- {"tell",	rf_tell,	1,	rf_tell__doc__},
- {"close",	rf_close,	1,	rf_close__doc__},
+ {"read",	(PyCFunction)rf_read,	1,	rf_read__doc__},
+ {"write",	(PyCFunction)rf_write,	1,	rf_write__doc__},
+ {"seek",	(PyCFunction)rf_seek,	1,	rf_seek__doc__},
+ {"tell",	(PyCFunction)rf_tell,	1,	rf_tell__doc__},
+ {"close",	(PyCFunction)rf_close,	1,	rf_close__doc__},
  
 	{NULL,		NULL}		/* sentinel */
 };
@@ -250,7 +237,7 @@
 
 
 static rfobject *
-newrfobject()
+newrfobject(void)
 {
 	rfobject *self;
 	
@@ -263,17 +250,14 @@
 
 
 static void
-rf_dealloc(self)
-	rfobject *self;
+rf_dealloc(rfobject *self)
 {
 	do_close(self);
 	PyMem_DEL(self);
 }
 
 static PyObject *
-rf_getattr(self, name)
-	rfobject *self;
-	char *name;
+rf_getattr(rfobject *self, char *name)
 {
 	return Py_FindMethod(rf_methods, (PyObject *)self, name);
 }
@@ -457,9 +441,7 @@
 static char setevh_doc[] = "Set python event handler to be called in mainloop";
 
 static PyObject *
-MacOS_SetEventHandler(self, args)
-	PyObject *self;
-	PyObject *args;
+MacOS_SetEventHandler(PyObject *self, PyObject *args)
 {
 	PyObject *evh = NULL;
 	
@@ -614,6 +596,7 @@
 		
 	err = HOpenRF(fss.vRefNum, fss.parID, fss.name, permission, &fp->fRefNum);
 	
+#if !TARGET_API_MAC_OSX
 	if ( err == fnfErr ) {
 		/* In stead of doing complicated things here to get creator/type
 		** correct we let the standard i/o library handle it
@@ -635,6 +618,7 @@
 		fclose(tfp);
 		err = HOpenRF(fss.vRefNum, fss.parID, fss.name, permission, &fp->fRefNum);
 	}
+#endif
 	if ( err ) {
 		Py_DECREF(fp);
 		PyMac_Error(err);
@@ -742,7 +726,7 @@
 
 
 void
-initMacOS()
+initMacOS(void)
 {
 	PyObject *m, *d;
 	
@@ -769,9 +753,11 @@
 		if( PyDict_SetItemString(d, "string_id_to_buffer", Py_BuildValue("i", off)) != 0)
 			return;
 	}
+#if !TARGET_API_MAC_OSX
 	if (PyDict_SetItemString(d, "AppearanceCompliant", 
 				Py_BuildValue("i", PyMac_AppearanceCompliant)) != 0)
 		return;
+#endif
 #if TARGET_API_MAC_OSX
 #define PY_RUNTIMEMODEL "macho"
 #elif TARGET_API_MAC_OS8