summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDwayne Litzenberger <dlitz@dlitz.net>2013-07-14 16:41:02 -0700
committerDwayne Litzenberger <dlitz@dlitz.net>2013-07-14 19:14:35 -0700
commit539b46f390d6fe0b67ae059c56d4102935de84ce (patch)
tree217e5796307a41bc922dccb36492d1dccbaf906e /src
parent96579d92769c47adbaa00f8407b85f93eb856c66 (diff)
downloadpycrypto-539b46f390d6fe0b67ae059c56d4102935de84ce.tar.gz
Py3k cleanup: PyVarObject_HEAD_INIT
Diffstat (limited to 'src')
-rw-r--r--src/_counter.c10
-rw-r--r--src/_fastmath.c10
-rw-r--r--src/block_template.c5
-rw-r--r--src/hash_template.c5
-rw-r--r--src/pycrypto_compat.h1
-rw-r--r--src/stream_template.c5
-rw-r--r--src/winrand.c5
7 files changed, 1 insertions, 40 deletions
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*/