summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngus Pearson <angus@toaster.cc>2019-07-08 11:04:37 +0100
committerAngus Pearson <angus@toaster.cc>2019-07-08 11:04:37 +0100
commit6eb52e200ce3af68433b69e50e2a5044f7074b08 (patch)
treec10294affe527e8115346d182d626917f538c16f
parent38cd5fd9f66aecc0d9a09892701cb938a48d61b1 (diff)
downloadredis-6eb52e200ce3af68433b69e50e2a5044f7074b08.tar.gz
Change typeNameCanonicalize -> getObjectTypeName, and other style changes
-rw-r--r--src/db.c6
-rw-r--r--src/server.h9
2 files changed, 7 insertions, 8 deletions
diff --git a/src/db.c b/src/db.c
index 6557ddc3c..bb53081f6 100644
--- a/src/db.c
+++ b/src/db.c
@@ -767,7 +767,7 @@ void scanGenericCommand(client *c, robj *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);
+ char* type = getObjectTypeName(typecheck);
if (strcasecmp((char*) typename, type)) filter = 1;
}
@@ -827,7 +827,7 @@ void lastsaveCommand(client *c) {
addReplyLongLong(c,server.lastsave);
}
-char* typeNameCanonicalize(robj *o) {
+char* getObjectTypeName(robj *o) {
char* type;
if (o == NULL) {
type = "none";
@@ -852,7 +852,7 @@ char* typeNameCanonicalize(robj *o) {
void typeCommand(client *c) {
robj *o;
o = lookupKeyReadWithFlags(c->db,c->argv[1],LOOKUP_NOTOUCH);
- addReplyStatus(c, typeNameCanonicalize(o));
+ addReplyStatus(c, getObjectTypeName(o));
}
void shutdownCommand(client *c) {
diff --git a/src/server.h b/src/server.h
index dc02edb5c..19ef1ac59 100644
--- a/src/server.h
+++ b/src/server.h
@@ -646,11 +646,10 @@ typedef struct redisObject {
void *ptr;
} robj;
-/* The 'canonical' name for a type as enumerated above is given by the
- * 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*);
+/* The a string name for an object's type as listed above
+ * Native types are checked against the OBJ_STRING, OBJ_LIST, OBJ_* defines,
+ * and Module types have their registered name returned. */
+char *getObjectTypeName(robj*);
/* Macro used to initialize a Redis object allocated on the stack.
* Note that this macro is taken near the structure definition to make sure