From cc9557db6a969c871489670c1e841701b23fc919 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Mon, 7 Dec 2009 15:39:43 +0100 Subject: [PATCH] src/pyvalues.c: Cast `void *' to a int that's guaranteed to be big enough. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit For some weird reason `int' is only 4 bytes long on x86_64, so casting `void *' to `int' results in compiler warnings / errors. --- src/pyvalues.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pyvalues.c b/src/pyvalues.c index 9542a40b..da7c21d3 100644 --- a/src/pyvalues.c +++ b/src/pyvalues.c @@ -91,7 +91,7 @@ static PyMemberDef PluginData_members[] = { }; static PyObject *PluginData_getstring(PyObject *self, void *data) { - const char *value = ((char *) self) + (int) data; + const char *value = ((char *) self) + (intptr_t) data; return PyString_FromString(value); } @@ -106,7 +106,7 @@ static int PluginData_setstring(PyObject *self, PyObject *value, void *data) { } new = PyString_AsString(value); if (new == NULL) return -1; - old = ((char *) self) + (int) data; + old = ((char *) self) + (intptr_t) data; sstrncpy(old, new, DATA_MAX_NAME_LEN); return 0; } @@ -127,7 +127,7 @@ static int PluginData_settype(PyObject *self, PyObject *value, void *data) { return -1; } - old = ((char *) self) + (int) data; + old = ((char *) self) + (intptr_t) data; sstrncpy(old, new, DATA_MAX_NAME_LEN); return 0; } @@ -677,7 +677,7 @@ static int Notification_setstring(PyObject *self, PyObject *value, void *data) { } new = PyString_AsString(value); if (new == NULL) return -1; - old = ((char *) self) + (int) data; + old = ((char *) self) + (intptr_t) data; sstrncpy(old, new, NOTIF_MAX_MSG_LEN); return 0; } -- 2.30.2