From a3054323d3fa1dadff1675e7f8ec672a991d8e56 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 26 Jan 2013 08:58:46 +1100 Subject: [PATCH] pymessaging: Use correct unsigned types for server ID tuple elememnts This is needed if we start using the top bits of these values. Andrew Bartlett Reviewed-by: Matthieu Patou Reviewed-by: Stefan Metzmacher --- source4/lib/messaging/pymessaging.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source4/lib/messaging/pymessaging.c b/source4/lib/messaging/pymessaging.c index cb79d72065f..f8703b25afe 100644 --- a/source4/lib/messaging/pymessaging.c +++ b/source4/lib/messaging/pymessaging.c @@ -51,10 +51,10 @@ static bool server_id_from_py(PyObject *object, struct server_id *server_id) return true; } if (PyTuple_Size(object) == 3) { - return PyArg_ParseTuple(object, "iii", &server_id->pid, &server_id->task_id, &server_id->vnn); + return PyArg_ParseTuple(object, "KII", &server_id->pid, &server_id->task_id, &server_id->vnn); } else { int pid, task_id; - if (!PyArg_ParseTuple(object, "ii", &pid, &task_id)) + if (!PyArg_ParseTuple(object, "KI", &pid, &task_id)) return false; *server_id = cluster_id(pid, task_id); return true; @@ -165,7 +165,7 @@ static void py_msg_callback_wrapper(struct imessaging_context *msg, void *privat { PyObject *callback = (PyObject *)private_data; - PyObject_CallFunction(callback, discard_const_p(char, "i(iii)s#"), msg_type, + PyObject_CallFunction(callback, discard_const_p(char, "i(KII)s#"), msg_type, server_id.pid, server_id.task_id, server_id.vnn, data->data, data->length); } -- 2.11.4.GIT