no complier warnings

This commit is contained in:
Øyvind Saltvik 2012-08-11 18:17:03 +02:00
parent d9ac1d3638
commit 4065f7dc40
2 changed files with 4 additions and 4 deletions

View file

@ -323,7 +323,7 @@ else:
libraries = ['telldus-core'] libraries = ['telldus-core']
define_macros = [] define_macros = []
define_macros.extend([('DATA_LENGTH', 20)]) define_macros.extend([('DATA_LENGTH', 20), ('CALLBACK_LENGTH', 20)])
telldus = Extension( telldus = Extension(
'telldus', 'telldus',

View file

@ -23,12 +23,12 @@ typedef struct {
int callbackId; int callbackId;
} callbackInfo; } callbackInfo;
static callbackInfo callbackList[20]; static callbackInfo callbackList[CALLBACK_LENGTH];
void void
addCallback(PyObject *func, int callbackId) addCallback(PyObject *func, int callbackId)
{ {
if (callbackLen < 20) { if (callbackLen < CALLBACK_LENGTH) {
callbackList[callbackLen].func = func; callbackList[callbackLen].func = func;
callbackList[callbackLen].callbackId = callbackId; callbackList[callbackLen].callbackId = callbackId;
callbackLen++; callbackLen++;
@ -687,7 +687,7 @@ telldus_tdSensorValue(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "ssll", &protocol, &model, &sensorId, &dataType)) if (!PyArg_ParseTuple(args, "ssll", &protocol, &model, &sensorId, &dataType))
return NULL; return NULL;
result = tdSensorValue(protocol, model, sensorId, dataType, &value, DATA_LENGTH, &timestamp); result = tdSensorValue(protocol, model, sensorId, dataType, value, DATA_LENGTH, &timestamp);
if (result == TELLSTICK_SUCCESS) if (result == TELLSTICK_SUCCESS)
{ {