From 1108f3fad26f744c2418d22a547a17669522ce2e Mon Sep 17 00:00:00 2001 From: Erik Johansson Date: Tue, 6 Mar 2012 13:58:31 +0100 Subject: [PATCH] Return type for callbacks is void, not void* --- examples/python/callbacks.py | 10 +++++----- examples/python/sensors/sensorscallback.py | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/python/callbacks.py b/examples/python/callbacks.py index 2108fd28..a5a02a27 100644 --- a/examples/python/callbacks.py +++ b/examples/python/callbacks.py @@ -58,11 +58,11 @@ def rawcallbackfunction(data, controllerId, callbackId, context): print string_at(data) if (platform.system() == 'Windows'): - CMPFUNC = WINFUNCTYPE(c_void_p, c_int, c_int, POINTER(c_ubyte), c_int, c_void_p) #first is return type - CMPFUNCRAW = WINFUNCTYPE(c_void_p, POINTER(c_ubyte), c_int, c_int, c_void_p) + CMPFUNC = WINFUNCTYPE(None, c_int, c_int, POINTER(c_ubyte), c_int, c_void_p) #first is return type + CMPFUNCRAW = WINFUNCTYPE(None, POINTER(c_ubyte), c_int, c_int, c_void_p) else: - CMPFUNC = CFUNCTYPE(c_void_p, c_int, c_int, POINTER(c_ubyte), c_int, c_void_p) - CMPFUNCRAW = CFUNCTYPE(c_void_p, POINTER(c_ubyte), c_int, c_int, c_void_p) + CMPFUNC = CFUNCTYPE(None, c_int, c_int, POINTER(c_ubyte), c_int, c_void_p) + CMPFUNCRAW = CFUNCTYPE(None, POINTER(c_ubyte), c_int, c_int, c_void_p) cmp_func = CMPFUNC(callbackfunction) cmp_funcraw = CMPFUNCRAW(rawcallbackfunction) @@ -73,4 +73,4 @@ lib.tdRegisterDeviceEvent(cmp_func, 0) print "Waiting for events..." while(1): - time.sleep(0.5) #don't exit \ No newline at end of file + time.sleep(0.5) #don't exit diff --git a/examples/python/sensors/sensorscallback.py b/examples/python/sensors/sensorscallback.py index 7a592b89..8dc5ffd8 100644 --- a/examples/python/sensors/sensorscallback.py +++ b/examples/python/sensors/sensorscallback.py @@ -29,9 +29,9 @@ def callbackfunction(protocol, model, id, dataType, value, timestamp, callbackId if (platform.system() == 'Windows'): - CMPFUNC = WINFUNCTYPE(c_void_p, POINTER(c_ubyte), POINTER(c_ubyte), c_int, c_int, POINTER(c_ubyte), c_int, c_int, c_void_p) #first is return type + CMPFUNC = WINFUNCTYPE(None, POINTER(c_ubyte), POINTER(c_ubyte), c_int, c_int, POINTER(c_ubyte), c_int, c_int, c_void_p) #first is return type else: - CMPFUNC = CFUNCTYPE(c_void_p, POINTER(c_ubyte), POINTER(c_ubyte), c_int, c_int, POINTER(c_ubyte), c_int, c_int, c_void_p) + CMPFUNC = CFUNCTYPE(None, POINTER(c_ubyte), POINTER(c_ubyte), c_int, c_int, POINTER(c_ubyte), c_int, c_int, c_void_p) cmp_func = CMPFUNC(callbackfunction)