mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 00:28:26 -05:00
redis-check-dump: use names instead of magic nums
Use constants to avoid magic numbers in `types`, which is an array that stores the names of `REDIS` types. Closes #1681
This commit is contained in:
parent
c49378fe3e
commit
9b4efe6cf4
@ -138,8 +138,10 @@ typedef struct {
|
||||
* at runtime to avoid strange compiler optimizations. */
|
||||
static double R_Zero, R_PosInf, R_NegInf, R_Nan;
|
||||
|
||||
#define MAX_TYPES_NUM 256
|
||||
#define MAX_TYPE_NAME_LEN 16
|
||||
/* store string types for output */
|
||||
static char types[256][16];
|
||||
static char types[MAX_TYPES_NUM][MAX_TYPE_NAME_LEN];
|
||||
|
||||
/* Return true if 't' is a valid object type. */
|
||||
int checkType(unsigned char t) {
|
||||
|
Loading…
Reference in New Issue
Block a user