summaryrefslogtreecommitdiffstats
path: root/src/python
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2012-08-16 04:56:47 -0400
committerJakub Hrozek <jhrozek@redhat.com>2012-08-16 13:34:19 +0200
commit56ad566af1e595dacfcc5a213d906e8070bb263c (patch)
treeee2d0e72d1ba88eb64b16dcba49027e0766c7c47 /src/python
parentf004e23af14fe020d81b8f97f30b448105b79606 (diff)
downloadsssd_unused-56ad566af1e595dacfcc5a213d906e8070bb263c.tar.gz
sssd_unused-56ad566af1e595dacfcc5a213d906e8070bb263c.tar.xz
sssd_unused-56ad566af1e595dacfcc5a213d906e8070bb263c.zip
Fix compilation error in Python murmurhash bindings
The compilation produced an error due to missing declaration of uint32_t and a couple of warnings caused by different prototypes of argument parsing functions in older Python releases.
Diffstat (limited to 'src/python')
-rw-r--r--src/python/pysss_murmur.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/python/pysss_murmur.c b/src/python/pysss_murmur.c
index 1e89681c..a193c56d 100644
--- a/src/python/pysss_murmur.c
+++ b/src/python/pysss_murmur.c
@@ -19,6 +19,7 @@
*/
#include <Python.h>
+#include "util/sss_python.h"
#include "util/murmurhash3.h"
@@ -36,7 +37,8 @@ static PyObject * py_murmurhash3(PyObject *module, PyObject *args)
long long seed;
uint32_t hash;
- if (!PyArg_ParseTuple(args, "slL", &key, &key_len, &seed)) {
+ if (!PyArg_ParseTuple(args, sss_py_const_p(char, "slL"),
+ &key, &key_len, &seed)) {
PyErr_Format(PyExc_ValueError, "Invalid argument\n");
return NULL;
}
@@ -53,13 +55,15 @@ static PyObject * py_murmurhash3(PyObject *module, PyObject *args)
}
static PyMethodDef methods[] = {
- {"murmurhash3", (PyCFunction) py_murmurhash3, METH_VARARGS, murmurhash3_doc},
- {NULL,NULL, 0, NULL}
+ { sss_py_const_p(char, "murmurhash3"), (PyCFunction) py_murmurhash3,
+ METH_VARARGS, murmurhash3_doc },
+ { NULL,NULL, 0, NULL }
};
PyMODINIT_FUNC
initpysss_murmur(void)
{
- Py_InitModule3("pysss_murmur", methods, "murmur hash functions");
+ Py_InitModule3(sss_py_const_p(char, "pysss_murmur"),
+ methods, sss_py_const_p(char, "murmur hash functions"));
}