summaryrefslogtreecommitdiff
path: root/src/quicklist.c
diff options
context:
space:
mode:
authorsundb <sundbcn@gmail.com>2021-01-10 01:52:42 +0800
committerGitHub <noreply@github.com>2021-01-09 19:52:42 +0200
commit36f1dea5e19982fac81d44de5bb0a4febe456b06 (patch)
tree52d7dbd912896da125d18fb7862d862a2104e8f2 /src/quicklist.c
parent8dd16caec833aebde3a12c7d7f9b6456554c8616 (diff)
downloadredis-36f1dea5e19982fac81d44de5bb0a4febe456b06.tar.gz
Fix compile warning when define REDIS_TEST (#8261)
Co-authored-by: Oran Agra <oran@redislabs.com>
Diffstat (limited to 'src/quicklist.c')
-rw-r--r--src/quicklist.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/src/quicklist.c b/src/quicklist.c
index 4dc3576ae..32871ac12 100644
--- a/src/quicklist.c
+++ b/src/quicklist.c
@@ -66,7 +66,7 @@ static const size_t optimization_level[] = {4096, 8192, 16384, 32768, 65536};
#else
#define D(...) \
do { \
- printf("%s:%s:%d:\t", __FILE__, __FUNCTION__, __LINE__); \
+ printf("%s:%s:%d:\t", __FILE__, __func__, __LINE__); \
printf(__VA_ARGS__); \
printf("\n"); \
} while (0)
@@ -1508,15 +1508,6 @@ void quicklistBookmarksClear(quicklist *ql) {
#include <stdint.h>
#include <sys/time.h>
-#define assert(_e) \
- do { \
- if (!(_e)) { \
- printf("\n\n=== ASSERTION FAILED ===\n"); \
- printf("==> %s:%d '%s' is not true\n", __FILE__, __LINE__, #_e); \
- err++; \
- } \
- } while (0)
-
#define yell(str, ...) printf("ERROR! " str "\n\n", __VA_ARGS__)
#define OK printf("\tOK\n")
@@ -1529,7 +1520,7 @@ void quicklistBookmarksClear(quicklist *ql) {
#define ERR(x, ...) \
do { \
- printf("%s:%s:%d:\t", __FILE__, __FUNCTION__, __LINE__); \
+ printf("%s:%s:%d:\t", __FILE__, __func__, __LINE__); \
printf("ERROR! " x "\n", __VA_ARGS__); \
err++; \
} while (0)
@@ -1614,7 +1605,7 @@ static int _ql_verify(quicklist *ql, uint32_t len, uint32_t count,
ql_info(ql);
if (len != ql->len) {
- yell("quicklist length wrong: expected %d, got %u", len, ql->len);
+ yell("quicklist length wrong: expected %d, got %lu", len, ql->len);
errors++;
}
@@ -1670,7 +1661,7 @@ static int _ql_verify(quicklist *ql, uint32_t len, uint32_t count,
if (node->encoding != QUICKLIST_NODE_ENCODING_RAW) {
yell("Incorrect compression: node %d is "
"compressed at depth %d ((%u, %u); total "
- "nodes: %u; size: %u; recompress: %d)",
+ "nodes: %lu; size: %u; recompress: %d)",
at, ql->compress, low_raw, high_raw, ql->len, node->sz,
node->recompress);
errors++;
@@ -1680,7 +1671,7 @@ static int _ql_verify(quicklist *ql, uint32_t len, uint32_t count,
!node->attempted_compress) {
yell("Incorrect non-compression: node %d is NOT "
"compressed at depth %d ((%u, %u); total "
- "nodes: %u; size: %u; recompress: %d; attempted: %d)",
+ "nodes: %lu; size: %u; recompress: %d; attempted: %d)",
at, ql->compress, low_raw, high_raw, ql->len, node->sz,
node->recompress, node->attempted_compress);
errors++;
@@ -2706,7 +2697,7 @@ int quicklistTest(int argc, char *argv[]) {
if (node->encoding != QUICKLIST_NODE_ENCODING_RAW) {
ERR("Incorrect compression: node %d is "
"compressed at depth %d ((%u, %u); total "
- "nodes: %u; size: %u)",
+ "nodes: %lu; size: %u)",
at, depth, low_raw, high_raw, ql->len,
node->sz);
}
@@ -2714,7 +2705,7 @@ int quicklistTest(int argc, char *argv[]) {
if (node->encoding != QUICKLIST_NODE_ENCODING_LZF) {
ERR("Incorrect non-compression: node %d is NOT "
"compressed at depth %d ((%u, %u); total "
- "nodes: %u; size: %u; attempted: %d)",
+ "nodes: %lu; size: %u; attempted: %d)",
at, depth, low_raw, high_raw, ql->len,
node->sz, node->attempted_compress);
}