Fix compile errors from merges
Former-commit-id: 27a927fe0011536c6539d7c2a79ccfdaf78cee22
This commit is contained in:
parent
7b615e7274
commit
e642441354
18
src/db.cpp
18
src/db.cpp
@ -681,7 +681,7 @@ void scanGenericCommand(client *c, robj_roptr o, unsigned long cursor) {
|
|||||||
listNode *node, *nextnode;
|
listNode *node, *nextnode;
|
||||||
long count = 10;
|
long count = 10;
|
||||||
sds pat = NULL;
|
sds pat = NULL;
|
||||||
sds typename = NULL;
|
sds type = NULL;
|
||||||
int patlen = 0, use_pattern = 0;
|
int patlen = 0, use_pattern = 0;
|
||||||
dict *ht;
|
dict *ht;
|
||||||
|
|
||||||
@ -718,9 +718,9 @@ void scanGenericCommand(client *c, robj_roptr o, unsigned long cursor) {
|
|||||||
use_pattern = !(pat[0] == '*' && patlen == 1);
|
use_pattern = !(pat[0] == '*' && patlen == 1);
|
||||||
|
|
||||||
i += 2;
|
i += 2;
|
||||||
} else if (!strcasecmp(c->argv[i]->ptr, "type") && o == NULL && j >= 2) {
|
} else if (!strcasecmp(szFromObj(c->argv[i]), "type") && o == nullptr && j >= 2) {
|
||||||
/* SCAN for a particular type only applies to the db dict */
|
/* SCAN for a particular type only applies to the db dict */
|
||||||
typename = c->argv[i+1]->ptr;
|
type = szFromObj(c->argv[i+1]);
|
||||||
i+= 2;
|
i+= 2;
|
||||||
} else {
|
} else {
|
||||||
addReply(c,shared.syntaxerr);
|
addReply(c,shared.syntaxerr);
|
||||||
@ -817,10 +817,10 @@ void scanGenericCommand(client *c, robj_roptr o, unsigned long cursor) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Filter an element if it isn't the type we want. */
|
/* Filter an element if it isn't the type we want. */
|
||||||
if (!filter && o == NULL && typename){
|
if (!filter && o == nullptr && type){
|
||||||
robj* typecheck = lookupKeyReadWithFlags(c->db, kobj, LOOKUP_NOTOUCH);
|
robj_roptr typecheck = lookupKeyReadWithFlags(c->db, kobj, LOOKUP_NOTOUCH);
|
||||||
char* type = typeNameCanonicalize(typecheck);
|
const char* type = typeNameCanonicalize(typecheck);
|
||||||
if (strcasecmp((char*) typename, type)) filter = 1;
|
if (strcasecmp((char*) type, type)) filter = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Filter element if it is an expired key. */
|
/* Filter element if it is an expired key. */
|
||||||
@ -879,9 +879,9 @@ void lastsaveCommand(client *c) {
|
|||||||
addReplyLongLong(c,g_pserver->lastsave);
|
addReplyLongLong(c,g_pserver->lastsave);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* typeNameCanonicalize(robj *o) {
|
const char* typeNameCanonicalize(robj_roptr o) {
|
||||||
const char* type;
|
const char* type;
|
||||||
if (o == NULL) {
|
if (o == nullptr) {
|
||||||
type = "none";
|
type = "none";
|
||||||
} else {
|
} else {
|
||||||
switch(o->type) {
|
switch(o->type) {
|
||||||
|
@ -750,7 +750,7 @@ __attribute__((always_inline)) inline char *szFromObj(const robj *o)
|
|||||||
* below function. Native types are checked against the OBJ_STRING,
|
* below function. Native types are checked against the OBJ_STRING,
|
||||||
* OBJ_LIST, OBJ_* defines, and Module types have their registered name
|
* OBJ_LIST, OBJ_* defines, and Module types have their registered name
|
||||||
* returned.*/
|
* returned.*/
|
||||||
char* typeNameCanonicalize(robj*);
|
const char* typeNameCanonicalize(robj_roptr o);
|
||||||
|
|
||||||
/* Macro used to initialize a Redis object allocated on the stack.
|
/* Macro used to initialize a Redis object allocated on the stack.
|
||||||
* Note that this macro is taken near the structure definition to make sure
|
* Note that this macro is taken near the structure definition to make sure
|
||||||
|
Loading…
x
Reference in New Issue
Block a user