reorder vars

master
Ray Slakinski 2010-11-23 08:36:37 -05:00
parent b201a84ba1
commit f7bae96d11
2 changed files with 13 additions and 17 deletions

View File

@ -475,17 +475,17 @@ static PyObject *_PylibMC_RunSetCommandSingle(PylibMC_Client *self,
_PylibMC_SetCommand f, char *fname, PyObject *args, _PylibMC_SetCommand f, char *fname, PyObject *args,
PyObject *kwds) { PyObject *kwds) {
/* function called by the set/add/etc commands */ /* function called by the set/add/etc commands */
static char *kws[] = { "key", "val", "time", "custom_flag", "min_compress_len", NULL }; static char *kws[] = { "key", "val", "time", "min_compress_len", "custom_flag", NULL };
PyObject *key; PyObject *key;
PyObject *value; PyObject *value;
unsigned int time = 0; /* this will be turned into a time_t */ unsigned int time = 0; /* this will be turned into a time_t */
unsigned int custom_flag = 0;
unsigned int min_compress = 0; unsigned int min_compress = 0;
unsigned int custom_flag = 0;
bool success = false; bool success = false;
if (!PyArg_ParseTupleAndKeywords(args, kwds, "SO|III", kws, if (!PyArg_ParseTupleAndKeywords(args, kwds, "SO|III", kws,
&key, &value, &key, &value, &time,
&time, &custom_flag, &min_compress)) { &min_compress, &custom_flag)) {
return NULL; return NULL;
} }
@ -505,8 +505,8 @@ static PyObject *_PylibMC_RunSetCommandSingle(PylibMC_Client *self,
success = _PylibMC_RunSetCommand(self, f, fname, success = _PylibMC_RunSetCommand(self, f, fname,
&serialized, 1, &serialized, 1,
custom_flag, min_compress,
min_compress); custom_flag);
cleanup: cleanup:
_PylibMC_FreeMset(&serialized); _PylibMC_FreeMset(&serialized);
@ -532,13 +532,12 @@ static PyObject *_PylibMC_RunSetCommandMulti(PylibMC_Client* self,
PyObject * retval = NULL; PyObject * retval = NULL;
size_t idx = 0; size_t idx = 0;
static char *kws[] = { "keys", "time", "key_prefix", "custom_flag", "min_compress_len", NULL }; static char *kws[] = { "keys", "time", "key_prefix", "min_compress_len", "custom_flag", NULL };
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!|ISII", kws, if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!|ISII", kws,
&PyDict_Type, &keys, &PyDict_Type, &keys,
&time, &key_prefix, &time, &key_prefix,
&custom_flag, &min_compress, &custom_flag)) {
&min_compress)) {
return NULL; return NULL;
} }
@ -587,9 +586,8 @@ static PyObject *_PylibMC_RunSetCommandMulti(PylibMC_Client* self,
} }
bool allsuccess = _PylibMC_RunSetCommand(self, f, fname, bool allsuccess = _PylibMC_RunSetCommand(self, f, fname,
serialized, nkeys, serialized, nkeys,
custom_flag, min_compress, custom_flag);
min_compress);
if (PyErr_Occurred() != NULL) { if (PyErr_Occurred() != NULL) {
goto cleanup; goto cleanup;
@ -815,8 +813,7 @@ static int _PylibMC_SerializeValue(PyObject* key_obj,
static bool _PylibMC_RunSetCommand(PylibMC_Client* self, static bool _PylibMC_RunSetCommand(PylibMC_Client* self,
_PylibMC_SetCommand f, char *fname, _PylibMC_SetCommand f, char *fname,
pylibmc_mset* msets, size_t nkeys, pylibmc_mset* msets, size_t nkeys,
size_t custom_flag, size_t min_compress, size_t custom_flag) {
size_t min_compress) {
memcached_st* mc = self->mc; memcached_st* mc = self->mc;
memcached_return rc = MEMCACHED_SUCCESS; memcached_return rc = MEMCACHED_SUCCESS;
int pos; int pos;

View File

@ -63,7 +63,7 @@ typedef ssize_t Py_ssize_t;
/* Note: this is an addition! python-memcached doesn't handle bools. */ /* Note: this is an addition! python-memcached doesn't handle bools. */
#define PYLIBMC_FLAG_BOOL (1 << 4) #define PYLIBMC_FLAG_BOOL (1 << 4)
#define PYLIBMC_FLAG_TYPES (PYLIBMC_FLAG_PICKLE | PYLIBMC_FLAG_INTEGER | \ #define PYLIBMC_FLAG_TYPES (PYLIBMC_FLAG_PICKLE | PYLIBMC_FLAG_INTEGER | \
PYLIBMC_FLAG_LONG | PYLIBMC_FLAG_BOOL | PYLIBMC_FLAG_CUSTOM) PYLIBMC_FLAG_LONG | PYLIBMC_FLAG_BOOL)
/* Modifier flags */ /* Modifier flags */
#define PYLIBMC_FLAG_ZLIB (1 << 3) #define PYLIBMC_FLAG_ZLIB (1 << 3)
/* }}} */ /* }}} */
@ -278,8 +278,7 @@ static PyObject *_PylibMC_RunSetCommandMulti(PylibMC_Client* self,
static bool _PylibMC_RunSetCommand(PylibMC_Client* self, static bool _PylibMC_RunSetCommand(PylibMC_Client* self,
_PylibMC_SetCommand f, char *fname, _PylibMC_SetCommand f, char *fname,
pylibmc_mset* msets, size_t nkeys, pylibmc_mset* msets, size_t nkeys,
size_t custom_flag, size_t min_compress, size_t custom_flag);
size_t min_compress);
static int _PylibMC_Deflate(char* value, size_t value_len, static int _PylibMC_Deflate(char* value, size_t value_len,
char** result, size_t *result_len); char** result, size_t *result_len);
static bool _PylibMC_IncrDecr(PylibMC_Client*, pylibmc_incr*, size_t); static bool _PylibMC_IncrDecr(PylibMC_Client*, pylibmc_incr*, size_t);