You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by GitBox <gi...@apache.org> on 2022/10/13 05:56:03 UTC

[GitHub] [incubator-kvrocks] torwig commented on a diff in pull request #981: Replace constant macros to constexpr variables and enums in headers

torwig commented on code in PR #981:
URL: https://github.com/apache/incubator-kvrocks/pull/981#discussion_r994175518


##########
src/config.h:
##########
@@ -38,20 +38,18 @@ class Server;
 namespace Engine {
 class Storage;
 }
-#define PORT_LIMIT 65535
 
-#define SUPERVISED_NONE 0
-#define SUPERVISED_AUTODETECT 1
-#define SUPERVISED_SYSTEMD 2
-#define SUPERVISED_UPSTART 3
+constexpr const uint16_t PORT_LIMIT = 65535;
 
-#define TLS_AUTH_CLIENTS_NO "no"
-#define TLS_AUTH_CLIENTS_OPTIONAL "optional"
+enum { SUPERVISED_NONE = 0, SUPERVISED_AUTODETECT, SUPERVISED_SYSTEMD, SUPERVISED_UPSTART };

Review Comment:
   Would you like to give a name to this enum?



##########
src/redis_zset.h:
##########
@@ -76,11 +76,13 @@ typedef struct {
   double score;
 } MemberScore;
 
-#define ZSET_INCR 1
-#define ZSET_NX (1 << 1)
-#define ZSET_XX (1 << 2)
-#define ZSET_REVERSED (1 << 3)
-#define ZSET_REMOVED 1 << 4
+enum {

Review Comment:
   And to give a name for `enum` here to add some extra meaning to these values?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org