Skip to content

Commit

Permalink
clang format fixes
Browse files Browse the repository at this point in the history
Signed-off-by: naglera <[email protected]>
  • Loading branch information
naglera committed Jul 11, 2024
1 parent 5e4c13a commit 785603d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
6 changes: 2 additions & 4 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -2281,10 +2281,8 @@ static void numericConfigRewrite(standardConfig *config, const char *name, struc
}

#define createSpecialConfig(name, alias, modifiable, setfn, getfn, rewritefn, applyfn) \
{ \
.type = SPECIAL_CONFIG, \
embedCommonConfig(name, alias, modifiable) embedConfigInterface(NULL, setfn, getfn, rewritefn, applyfn) \
}
{.type = SPECIAL_CONFIG, \
embedCommonConfig(name, alias, modifiable) embedConfigInterface(NULL, setfn, getfn, rewritefn, applyfn)}

static int isValidActiveDefrag(int val, const char **err) {
#ifndef HAVE_DEFRAG
Expand Down
6 changes: 4 additions & 2 deletions src/replication.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ void backfillRdbReplicasToPsyncWait(void) {
if (replica_rdb_client->ref_repl_buf_node) continue;
replica_rdb_client->ref_repl_buf_node = ln;
head->refcount++;
serverLog(LL_DEBUG, "Attach rdb replica %llu to repl buf block", (long long unsigned int)replica_rdb_client->id);
serverLog(LL_DEBUG, "Attach rdb replica %llu to repl buf block",
(long long unsigned int)replica_rdb_client->id);
}
raxStop(&iter);
}
Expand All @@ -272,7 +273,8 @@ void removeReplicaFromPsyncWait(client *replica_main_client) {
replica_rdb_client->ref_repl_buf_node = NULL;
replica_rdb_client->flag.protected_rdb_conn = 0;
serverLog(LL_DEBUG, "Remove psync waiting replica %s with cid %llu, repl buffer block %s",
replicationGetReplicaName(replica_main_client), (long long unsigned int)replica_main_client->associated_rdb_client_id,
replicationGetReplicaName(replica_main_client),
(long long unsigned int)replica_main_client->associated_rdb_client_id,
o ? "ref count decreased" : "doesn't exist");
uint64_t id = htonu64(replica_rdb_client->id);
raxRemove(server.replicas_waiting_psync, (unsigned char *)&id, sizeof(id), NULL);
Expand Down
23 changes: 10 additions & 13 deletions src/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ struct hdr_histogram;
#define CONFIG_BGSAVE_RETRY_DELAY 5 /* Wait a few secs before trying again. */
#define CONFIG_DEFAULT_PID_FILE "/var/run/valkey.pid"
#define CONFIG_DEFAULT_BINDADDR_COUNT 2
#define CONFIG_DEFAULT_BINDADDR \
{ "*", "-::*" }
#define CONFIG_DEFAULT_BINDADDR {"*", "-::*"}
#define NET_HOST_STR_LEN 256 /* Longest valid hostname */
#define NET_IP_STR_LEN 46 /* INET6_ADDRSTRLEN is 46, but we need to be sure */
#define NET_ADDR_STR_LEN (NET_IP_STR_LEN + 32) /* Must be enough for ip:port */
Expand Down Expand Up @@ -691,7 +690,7 @@ typedef enum {
/* Extract encver / signature from a module type ID. */
#define VALKEYMODULE_TYPE_ENCVER_BITS 10
#define VALKEYMODULE_TYPE_ENCVER_MASK ((1 << VALKEYMODULE_TYPE_ENCVER_BITS) - 1)
#define VALKEYMODULE_TYPE_ENCVER(id) ((id)&VALKEYMODULE_TYPE_ENCVER_MASK)
#define VALKEYMODULE_TYPE_ENCVER(id) ((id) & VALKEYMODULE_TYPE_ENCVER_MASK)
#define VALKEYMODULE_TYPE_SIGN(id) \
(((id) & ~((uint64_t)VALKEYMODULE_TYPE_ENCVER_MASK)) >> VALKEYMODULE_TYPE_ENCVER_BITS)

Expand Down Expand Up @@ -1506,7 +1505,7 @@ struct serverMemOverhead {
size_t dbid;
size_t overhead_ht_main;
size_t overhead_ht_expires;
} * db;
} *db;
};

/* Replication error behavior determines the replica behavior
Expand Down Expand Up @@ -1536,8 +1535,7 @@ typedef struct rdbSaveInfo {
long long repl_offset; /* Replication offset. */
} rdbSaveInfo;

#define RDB_SAVE_INFO_INIT \
{ -1, 0, "0000000000000000000000000000000000000000", -1 }
#define RDB_SAVE_INFO_INIT {-1, 0, "0000000000000000000000000000000000000000", -1}

struct malloc_stats {
size_t zmalloc_used;
Expand Down Expand Up @@ -1860,12 +1858,11 @@ struct valkeyServer {
int set_proc_title; /* True if change proc title */
char *proc_title_template; /* Process title template format */
clientBufferLimitsConfig client_obuf_limits[CLIENT_TYPE_OBUF_COUNT];
int extended_redis_compat; /* True if extended Redis OSS compatibility is enabled */
int pause_cron; /* Don't run cron tasks (debug) */
int dict_resizing; /* Whether to allow main dict and expired dict to be resized (debug) */
int latency_tracking_enabled; /* 1 if extended latency tracking is enabled, 0 otherwise. */
double
*latency_tracking_info_percentiles; /* Extended latency tracking info output percentile list configuration. */
int extended_redis_compat; /* True if extended Redis OSS compatibility is enabled */
int pause_cron; /* Don't run cron tasks (debug) */
int dict_resizing; /* Whether to allow main dict and expired dict to be resized (debug) */
int latency_tracking_enabled; /* 1 if extended latency tracking is enabled, 0 otherwise. */
double *latency_tracking_info_percentiles; /* Extended latency tracking info output percentile list configuration. */
int latency_tracking_info_percentiles_len;
unsigned int max_new_tls_conns_per_cycle; /* The maximum number of tls connections that will be accepted during each
invocation of the event loop. */
Expand Down Expand Up @@ -3967,7 +3964,7 @@ sds getVersion(void);
* should be ignored due to low level. */
#define serverLog(level, ...) \
do { \
if (((level)&0xff) < server.verbosity) break; \
if (((level) & 0xff) < server.verbosity) break; \
_serverLog(level, __VA_ARGS__); \
} while (0)

Expand Down

0 comments on commit 785603d

Please sign in to comment.