[Python-checkins] r46154 - sandbox/trunk/newstruct/Modules/_newstruct.c

bob.ippolito python-checkins at python.org
Tue May 23 21:39:02 CEST 2006


Author: bob.ippolito
Date: Tue May 23 21:39:01 2006
New Revision: 46154

Modified:
   sandbox/trunk/newstruct/Modules/_newstruct.c
Log:
bring back fixes

Modified: sandbox/trunk/newstruct/Modules/_newstruct.c
==============================================================================
--- sandbox/trunk/newstruct/Modules/_newstruct.c	(original)
+++ sandbox/trunk/newstruct/Modules/_newstruct.c	Tue May 23 21:39:01 2006
@@ -8,6 +8,7 @@
 #include "structmember.h"
 #include <ctype.h>
 
+static PyTypeObject PyStructType;
 
 /* compatibility macros */
 #if (PY_VERSION_HEX < 0x02050000)
@@ -45,10 +46,9 @@
 	PyObject *weakreflist; /* List of weak references */
 } PyStructObject;
 
-PyAPI_DATA(PyTypeObject) PyStruct_Type;
 
-#define PyStruct_Check(op) PyObject_TypeCheck(op, &PyStruct_Type)
-#define PyStruct_CheckExact(op) ((op)->ob_type == &PyStruct_Type)
+#define PyStruct_Check(op) PyObject_TypeCheck(op, &PyStructType)
+#define PyStruct_CheckExact(op) ((op)->ob_type == &PyStructType)
 
 
 /* Exception */
@@ -1063,7 +1063,6 @@
 s_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
 {
 	PyObject *self;
-	static PyObject *not_yet_string;
 
 	assert(type != NULL && type->tp_alloc != NULL);
 
@@ -1104,7 +1103,6 @@
 static void
 s_dealloc(PyStructObject *s)
 {
-	int sts = 0;
 	if (s->weakreflist != NULL)
 		PyObject_ClearWeakRefs((PyObject *)s);
 	if (s->s_codes != NULL) {
@@ -1352,4 +1350,4 @@
 	PyModule_AddObject(m, "error", StructError);
 	Py_INCREF((PyObject*)&PyStructType);
 	PyModule_AddObject(m, "Struct", (PyObject*)&PyStructType);
-}
\ No newline at end of file
+}


More information about the Python-checkins mailing list