From def09488aa2787038a2e8047a836dd2e76763a7c Mon Sep 17 00:00:00 2001 From: 0del <53461381+0del@users.noreply.github.com> Date: Wed, 3 Apr 2024 16:07:28 +0700 Subject: [PATCH] Rename redis_member2struct ro server_member2struct (#166) part of #144 Signed-off-by: 0del --- src/multi.c | 4 ++-- src/server.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/multi.c b/src/multi.c index c3adf82b7..cb082f91e 100644 --- a/src/multi.c +++ b/src/multi.c @@ -390,7 +390,7 @@ void touchWatchedKey(serverDb *db, robj *key) { /* Check if we are already watching for this key */ listRewind(clients,&li); while((ln = listNext(&li))) { - watchedKey *wk = redis_member2struct(watchedKey, node, ln); + watchedKey *wk = server_member2struct(watchedKey, node, ln); client *c = wk->client; if (wk->expired) { @@ -443,7 +443,7 @@ void touchAllWatchedKeysInDb(serverDb *emptied, serverDb *replaced_with) { if (!clients) continue; listRewind(clients,&li); while((ln = listNext(&li))) { - watchedKey *wk = redis_member2struct(watchedKey, node, ln); + watchedKey *wk = server_member2struct(watchedKey, node, ln); if (wk->expired) { if (!replaced_with || !dbFind(replaced_with, key->ptr)) { /* Expired key now deleted. No logical change. Clear the diff --git a/src/server.h b/src/server.h index ec07b0a8c..f3613f877 100644 --- a/src/server.h +++ b/src/server.h @@ -103,7 +103,7 @@ struct hdr_histogram; #define max(a, b) ((a) > (b) ? (a) : (b)) /* Get the pointer of the outer struct from a member address */ -#define redis_member2struct(struct_name, member_name, member_addr) \ +#define server_member2struct(struct_name, member_name, member_addr) \ ((struct_name *)((char*)member_addr - offsetof(struct_name, member_name))) /* Error codes */