Properly cast types in get_behaviors.

This commit is contained in:
lericson 2009-09-18 11:23:25 +02:00
parent 391878b095
commit 9fb94c12c0

View File

@ -663,10 +663,12 @@ static PyObject *PylibMC_Client_get_behaviors(PylibMC_Client *self) {
PylibMC_Behavior *b; PylibMC_Behavior *b;
for (b = PylibMC_behaviors; b->name != NULL; b++) { for (b = PylibMC_behaviors; b->name != NULL; b++) {
uint64_t bval = memcached_behavior_get(self->mc, b->flag); uint64_t bval;
PyObject *x = PyInt_FromLong(bval); PyObject *x;
if (x == NULL || PyDict_SetItemString(retval, b->name, x)) { bval = memcached_behavior_get(self->mc, b->flag);
x = PyInt_FromLong((long)bval);
if (x == NULL || PyDict_SetItemString(retval, b->name, x) == -1) {
goto error; goto error;
} }