Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
36f1dea5
Unverified
Commit
36f1dea5
authored
Jan 10, 2021
by
sundb
Committed by
GitHub
Jan 09, 2021
Browse files
Fix compile warning when define REDIS_TEST (#8261)
Co-authored-by:
Oran Agra
<
oran@redislabs.com
>
parent
8dd16cae
Changes
5
Show whitespace changes
Inline
Side-by-side
src/crc64.c
View file @
36f1dea5
...
...
@@ -134,7 +134,7 @@ int crc64Test(int argc, char *argv[]) {
printf
(
"[calcula]: e9c6d914c4b8d9ca == %016"
PRIx64
"
\n
"
,
(
uint64_t
)
_crc64
(
0
,
"123456789"
,
9
));
printf
(
"[64speed]: e9c6d914c4b8d9ca == %016"
PRIx64
"
\n
"
,
(
uint64_t
)
crc64
(
0
,
"123456789"
,
9
));
(
uint64_t
)
crc64
(
0
,
(
unsigned
char
*
)
"123456789"
,
9
));
char
li
[]
=
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed "
"do eiusmod tempor incididunt ut labore et dolore magna "
"aliqua. Ut enim ad minim veniam, quis nostrud exercitation "
...
...
@@ -146,7 +146,7 @@ int crc64Test(int argc, char *argv[]) {
printf
(
"[calcula]: c7794709e69683b3 == %016"
PRIx64
"
\n
"
,
(
uint64_t
)
_crc64
(
0
,
li
,
sizeof
(
li
)));
printf
(
"[64speed]: c7794709e69683b3 == %016"
PRIx64
"
\n
"
,
(
uint64_t
)
crc64
(
0
,
li
,
sizeof
(
li
)));
(
uint64_t
)
crc64
(
0
,
(
unsigned
char
*
)
li
,
sizeof
(
li
)));
return
0
;
}
...
...
src/intset.c
View file @
36f1dea5
...
...
@@ -358,12 +358,6 @@ static long long usec(void) {
return
(((
long
long
)
tv
.
tv_sec
)
*
1000000
)
+
tv
.
tv_usec
;
}
#define assert(_e) ((_e)?(void)0:(_assert(#_e,__FILE__,__LINE__),exit(1)))
static
void
_assert
(
char
*
estr
,
char
*
file
,
int
line
)
{
printf
(
"
\n\n
=== ASSERTION FAILED ===
\n
"
);
printf
(
"==> %s:%d '%s' is not true
\n
"
,
file
,
line
,
estr
);
}
static
intset
*
createSet
(
int
bits
,
int
size
)
{
uint64_t
mask
=
(
1
<<
bits
)
-
1
;
uint64_t
value
;
...
...
src/quicklist.c
View file @
36f1dea5
...
...
@@ -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 %
l
u"
,
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: %
l
u; 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: %
l
u; 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: %
l
u; 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: %
l
u; size: %u; attempted: %d)"
,
at
,
depth
,
low_raw
,
high_raw
,
ql
->
len
,
node
->
sz
,
node
->
attempted_compress
);
}
...
...
src/rax.c
View file @
36f1dea5
...
...
@@ -61,7 +61,7 @@ void raxDebugShowNode(const char *msg, raxNode *n);
#ifdef RAX_DEBUG_MSG
#define debugf(...) \
if (raxDebugMsg) { \
printf("%s:%s:%d:\t", __FILE__, __
FUNCTION
__, __LINE__); \
printf("%s:%s:%d:\t", __FILE__, __
func
__, __LINE__);
\
printf(__VA_ARGS__); \
fflush(stdout); \
}
...
...
src/ziplist.c
View file @
36f1dea5
...
...
@@ -1713,7 +1713,7 @@ int ziplistTest(int argc, char **argv) {
if
(
p
==
NULL
)
{
printf
(
"No entry
\n
"
);
}
else
{
printf
(
"ERROR: Out of range index should return NULL, returned offset: %ld
\n
"
,
p
-
zl
);
printf
(
"ERROR: Out of range index should return NULL, returned offset: %ld
\n
"
,
(
long
)(
p
-
zl
)
)
;
return
1
;
}
printf
(
"
\n
"
);
...
...
@@ -1763,7 +1763,7 @@ int ziplistTest(int argc, char **argv) {
if
(
p
==
NULL
)
{
printf
(
"No entry
\n
"
);
}
else
{
printf
(
"ERROR: Out of range index should return NULL, returned offset: %ld
\n
"
,
p
-
zl
);
printf
(
"ERROR: Out of range index should return NULL, returned offset: %ld
\n
"
,
(
long
)(
p
-
zl
)
)
;
return
1
;
}
printf
(
"
\n
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment