git » pytipc » commit a148d73

All TIPC struct's integers are unsigned, treat them as such.

author Alberto Bertogli
2007-12-17 03:38:43 UTC
committer Alberto Bertogli
2007-12-17 03:38:46 UTC
parent e9467d98f7286bde8328516ab1f3fdd5bb728172

All TIPC struct's integers are unsigned, treat them as such.

Signed-off-by: Alberto Bertogli <albertito@gmail.com>

tipc_ll.c +5 -5

diff --git a/tipc_ll.c b/tipc_ll.c
index eb14260..29a3b19 100644
--- a/tipc_ll.c
+++ b/tipc_ll.c
@@ -28,7 +28,7 @@ static int fill_sockaddr(struct sockaddr_tipc *sa, PyObject *addr)
 	unsigned int atype, stype, lower, upper;
 	unsigned int scope = TIPC_CLUSTER_SCOPE;
 
-	if (!PyArg_ParseTuple(addr, "iiii|i;Invalid TIPC address format",
+	if (!PyArg_ParseTuple(addr, "IIII|I;Invalid TIPC address format",
 				&atype, &stype, &lower, &upper, &scope))
 		return 0;
 
@@ -53,14 +53,14 @@ static int fill_sockaddr(struct sockaddr_tipc *sa, PyObject *addr)
 static PyObject *sa_to_tuple(const struct sockaddr_tipc *sa)
 {
 	if (sa->addrtype == TIPC_ADDR_NAMESEQ) {
-		return Py_BuildValue("iiiii",
+		return Py_BuildValue("IIIII",
 				sa->addrtype,
 				sa->addr.nameseq.type,
 				sa->addr.nameseq.lower,
 				sa->addr.nameseq.upper,
 				sa->scope);
 	} else {
-		return Py_BuildValue("iiiii",
+		return Py_BuildValue("IIIII",
 				sa->addrtype,
 				sa->addr.name.name.type,
 				sa->addr.name.name.instance,
@@ -220,7 +220,7 @@ static PyObject *tipc_build_subscr(PyObject *self, PyObject *args)
 	uint32_t timeout, filter;
 	struct tipc_subscr subs;
 
-	if (!PyArg_ParseTuple(args, "iiiii:tipc_build_subscr",
+	if (!PyArg_ParseTuple(args, "IIIII:tipc_build_subscr",
 				&stype, &lower, &upper, &timeout, &filter)) {
 		return NULL;
 	}
@@ -252,7 +252,7 @@ static PyObject *tipc_parse_event(PyObject *self, PyObject *args)
 
 	event = (struct tipc_event *) buf;
 
-	return Py_BuildValue("iii(iiiii)",
+	return Py_BuildValue("III(IIIII)",
 			event->event,
 			event->found_lower,
 			event->found_upper,