Fix compile errors from merges

Former-commit-id: 27a927fe0011536c6539d7c2a79ccfdaf78cee22
This commit is contained in:
John Sully 2019-07-18 23:35:51 -04:00
parent 7b615e7274
commit e642441354
2 changed files with 10 additions and 10 deletions

View File

@ -681,7 +681,7 @@ void scanGenericCommand(client *c, robj_roptr o, unsigned long cursor) {
listNode *node, *nextnode;
long count = 10;
sds pat = NULL;
sds typename = NULL;
sds type = NULL;
int patlen = 0, use_pattern = 0;
dict *ht;
@ -718,9 +718,9 @@ void scanGenericCommand(client *c, robj_roptr o, unsigned long cursor) {
use_pattern = !(pat[0] == '*' && patlen == 1);
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 */
typename = c->argv[i+1]->ptr;
type = szFromObj(c->argv[i+1]);
i+= 2;
} else {
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. */
if (!filter && o == NULL && typename){
robj* typecheck = lookupKeyReadWithFlags(c->db, kobj, LOOKUP_NOTOUCH);
char* type = typeNameCanonicalize(typecheck);
if (strcasecmp((char*) typename, type)) filter = 1;
if (!filter && o == nullptr && type){
robj_roptr typecheck = lookupKeyReadWithFlags(c->db, kobj, LOOKUP_NOTOUCH);
const char* type = typeNameCanonicalize(typecheck);
if (strcasecmp((char*) type, type)) filter = 1;
}
/* Filter element if it is an expired key. */
@ -879,9 +879,9 @@ void lastsaveCommand(client *c) {
addReplyLongLong(c,g_pserver->lastsave);
}
const char* typeNameCanonicalize(robj *o) {
const char* typeNameCanonicalize(robj_roptr o) {
const char* type;
if (o == NULL) {
if (o == nullptr) {
type = "none";
} else {
switch(o->type) {

View File

@ -750,7 +750,7 @@ __attribute__((always_inline)) inline char *szFromObj(const robj *o)
* below function. Native types are checked against the OBJ_STRING,
* OBJ_LIST, OBJ_* defines, and Module types have their registered name
* returned.*/
char* typeNameCanonicalize(robj*);
const char* typeNameCanonicalize(robj_roptr o);
/* Macro used to initialize a Redis object allocated on the stack.
* Note that this macro is taken near the structure definition to make sure