From 539b46f390d6fe0b67ae059c56d4102935de84ce Mon Sep 17 00:00:00 2001 From: Dwayne Litzenberger Date: Sun, 14 Jul 2013 16:41:02 -0700 Subject: Py3k cleanup: PyVarObject_HEAD_INIT --- src/_counter.c | 10 ---------- src/_fastmath.c | 10 ---------- src/block_template.c | 5 ----- src/hash_template.c | 5 ----- src/pycrypto_compat.h | 1 + src/stream_template.c | 5 ----- src/winrand.c | 5 ----- 7 files changed, 1 insertion(+), 40 deletions(-) (limited to 'src') diff --git a/src/_counter.c b/src/_counter.c index 618ee89..525b5cf 100644 --- a/src/_counter.c +++ b/src/_counter.c @@ -353,12 +353,7 @@ CounterBEObject_getattr(PyObject *s, char *name) static PyTypeObject PCT_CounterLEType = { -#ifdef IS_PY3K PyVarObject_HEAD_INIT(NULL, 0) /* deferred type init for compilation on Windows, type will be filled in at runtime */ -#else - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ -#endif "_counter.CounterLE", /* tp_name */ sizeof(PCT_CounterObject), /* tp_basicsize */ 0, /* tp_itemsize */ @@ -401,12 +396,7 @@ PCT_CounterLEType = { static PyTypeObject PCT_CounterBEType = { -#ifdef IS_PY3K PyVarObject_HEAD_INIT(NULL, 0) /* deferred type init for compilation on Windows, type will be filled in at runtime */ -#else - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ -#endif "_counter.CounterBE", /* tp_name */ sizeof(PCT_CounterObject), /* tp_basicsize */ 0, /* tp_itemsize */ diff --git a/src/_fastmath.c b/src/_fastmath.c index afbe931..e048676 100644 --- a/src/_fastmath.c +++ b/src/_fastmath.c @@ -361,12 +361,7 @@ static PyMethodDef rsaKey__methods__[] = { static PyObject *fastmathError; /* raised on errors */ static PyTypeObject dsaKeyType = { -#ifdef IS_PY3K PyVarObject_HEAD_INIT (NULL, 0) /* deferred type init for compilation on Windows, type will be filled in at runtime */ -#else - PyObject_HEAD_INIT (NULL) - 0, /*ob_size*/ -#endif "dsaKey", sizeof (dsaKey), 0, @@ -403,12 +398,7 @@ static PyTypeObject dsaKeyType = { }; static PyTypeObject rsaKeyType = { -#ifdef IS_PY3K PyVarObject_HEAD_INIT (NULL, 0) /* deferred type init for compilation on Windows, type will be filled in at runtime */ -#else - PyObject_HEAD_INIT (NULL) - 0, /*ob_size*/ -#endif "rsaKey", /*tp_name*/ sizeof (rsaKey), /*tp_size*/ 0, /*tp_itemsize*/ diff --git a/src/block_template.c b/src/block_template.c index d5e68c1..78af81e 100644 --- a/src/block_template.c +++ b/src/block_template.c @@ -690,12 +690,7 @@ static struct PyMethodDef modulemethods[] = static PyTypeObject ALGtype = { -#ifdef IS_PY3K PyVarObject_HEAD_INIT(NULL, 0) /* deferred type init for compilation on Windows, type will be filled in at runtime */ -#else - PyObject_HEAD_INIT(NULL) - 0, /*ob_size*/ -#endif _MODULE_STRING, /*tp_name*/ sizeof(ALGobject), /*tp_size*/ 0, /*tp_itemsize*/ diff --git a/src/hash_template.c b/src/hash_template.c index 1134942..8f3ea4b 100644 --- a/src/hash_template.c +++ b/src/hash_template.c @@ -214,12 +214,7 @@ ALG_getattr(PyObject *self, char *name) } static PyTypeObject ALGtype = { -#ifdef IS_PY3K PyVarObject_HEAD_INIT(NULL, 0) /* deferred type init for compilation on Windows, type will be filled in at runtime */ -#else - PyObject_HEAD_INIT(NULL) - 0, /*ob_size*/ -#endif _MODULE_STRING, /*tp_name*/ sizeof(ALGobject), /*tp_size*/ 0, /*tp_itemsize*/ diff --git a/src/pycrypto_compat.h b/src/pycrypto_compat.h index 804e54a..a5a713b 100644 --- a/src/pycrypto_compat.h +++ b/src/pycrypto_compat.h @@ -48,6 +48,7 @@ # define PyLong_MASK MASK # define PyLong_SHIFT SHIFT # define PyUnicode_FromString PyString_FromString +# define PyVarObject_HEAD_INIT(a,b) PyObject_HEAD_INIT(a) 0, # endif # if PY_MINOR_VERSION <= 1 /* Python 2.1 only */ # define METH_O METH_OLDARGS /* METH_O is a subset of what METH_OLDARGS provides */ diff --git a/src/stream_template.c b/src/stream_template.c index 7832484..522ac7b 100644 --- a/src/stream_template.c +++ b/src/stream_template.c @@ -233,12 +233,7 @@ static struct PyMethodDef modulemethods[] = static PyTypeObject ALGtype = { -#ifdef IS_PY3K PyVarObject_HEAD_INIT(NULL, 0) /* deferred type init for compilation on Windows, type will be filled in at runtime */ -#else - PyObject_HEAD_INIT(NULL) - 0, /*ob_size*/ -#endif _MODULE_STRING, /*tp_name*/ sizeof(ALGobject), /*tp_size*/ 0, /*tp_itemsize*/ diff --git a/src/winrand.c b/src/winrand.c index 09dcf75..c72812e 100644 --- a/src/winrand.c +++ b/src/winrand.c @@ -221,12 +221,7 @@ WRgetattr(PyObject *s, char *name) static PyTypeObject WRtype = { - #ifdef IS_PY3K PyVarObject_HEAD_INIT(NULL, 0) /* deferred type init for compilation on Windows, type will be filled in at runtime */ -#else - PyObject_HEAD_INIT(NULL) - 0, /*ob_size*/ -#endif "winrandom.WinRandom", /*tp_name*/ sizeof(WRobject), /*tp_size*/ 0, /*tp_itemsize*/ -- cgit v1.2.1