summaryrefslogtreecommitdiff
path: root/src/server.h
diff options
context:
space:
mode:
authorWang Yuan <wangyuan21@baidu.com>2022-01-18 21:55:20 +0800
committerGitHub <noreply@github.com>2022-01-18 15:55:20 +0200
commitd697daa7a5600ca82a0098bc7c857bc7167bb35e (patch)
tree303549e26aa773c5fd5544c6d3a9948711b77d9d /src/server.h
parent99ab4236afb210dc118fad892210b9fbb369aa8e (diff)
downloadredis-d697daa7a5600ca82a0098bc7c857bc7167bb35e.tar.gz
Use const char pointer in redismodule.h as far as possible (#10064)
When I used C++ to develop a redis module. i used `string.data()` as the second parameter `ele` of `RedisModule_DigestAddStringBuffer`, but there is a warning, since we never change the `ele`, i think we should use `const char` for it. This PR adds const to just a handful of module APIs that required it, all not very widely used. The implication is a breaking change in terms of compilation error that's easy to resolve, and no ABI impact. The affected APIs are around Digest, Info injection, and Cluster bus messages.
Diffstat (limited to 'src/server.h')
-rw-r--r--src/server.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server.h b/src/server.h
index 8c8cfcf9b..3978201a7 100644
--- a/src/server.h
+++ b/src/server.h
@@ -3367,8 +3367,8 @@ void applyWatchdogPeriod();
void watchdogScheduleSignal(int period);
void serverLogHexDump(int level, char *descr, void *value, size_t len);
int memtest_preserving_test(unsigned long *m, size_t bytes, int passes);
-void mixDigest(unsigned char *digest, void *ptr, size_t len);
-void xorDigest(unsigned char *digest, void *ptr, size_t len);
+void mixDigest(unsigned char *digest, const void *ptr, size_t len);
+void xorDigest(unsigned char *digest, const void *ptr, size_t len);
int populateSingleCommand(struct redisCommand *c, char *strflags);
void commandAddSubcommand(struct redisCommand *parent, struct redisCommand *subcommand);
void populateCommandMovableKeys(struct redisCommand *cmd);