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
fd7d51c3
Commit
fd7d51c3
authored
May 03, 2021
by
Oran Agra
Browse files
Resolve nonsense static analysis warnings
parent
f0c5f920
Changes
7
Show whitespace changes
Inline
Side-by-side
deps/jemalloc/include/jemalloc/internal/jemalloc_internal_inlines_c.h
View file @
fd7d51c3
...
...
@@ -235,7 +235,7 @@ iget_defrag_hint(tsdn_t *tsdn, void* ptr) {
int
free_in_slab
=
extent_nfree_get
(
slab
);
if
(
free_in_slab
)
{
const
bin_info_t
*
bin_info
=
&
bin_infos
[
binind
];
int
curslabs
=
bin
->
stats
.
curslabs
;
unsigned
long
curslabs
=
bin
->
stats
.
curslabs
;
size_t
curregs
=
bin
->
stats
.
curregs
;
if
(
bin
->
slabcur
)
{
/* remove slabcur from the overall utilization */
...
...
src/lolwut.c
View file @
fd7d51c3
...
...
@@ -94,8 +94,8 @@ lwCanvas *lwCreateCanvas(int width, int height, int bgcolor) {
lwCanvas
*
canvas
=
zmalloc
(
sizeof
(
*
canvas
));
canvas
->
width
=
width
;
canvas
->
height
=
height
;
canvas
->
pixels
=
zmalloc
(
width
*
height
);
memset
(
canvas
->
pixels
,
bgcolor
,
width
*
height
);
canvas
->
pixels
=
zmalloc
(
(
size_t
)
width
*
height
);
memset
(
canvas
->
pixels
,
bgcolor
,
(
size_t
)
width
*
height
);
return
canvas
;
}
...
...
src/memtest.c
View file @
fd7d51c3
...
...
@@ -71,7 +71,7 @@ void memtest_progress_start(char *title, int pass) {
printf
(
"
\x1b
[H
\x1b
[2K"
);
/* Cursor home, clear current line. */
printf
(
"%s [%d]
\n
"
,
title
,
pass
);
/* Print title. */
progress_printed
=
0
;
progress_full
=
ws
.
ws_col
*
(
ws
.
ws_row
-
3
);
progress_full
=
(
size_t
)
ws
.
ws_col
*
(
ws
.
ws_row
-
3
);
fflush
(
stdout
);
}
...
...
src/object.c
View file @
fd7d51c3
...
...
@@ -836,7 +836,7 @@ size_t objectComputeSize(robj *o, size_t sample_size) {
if
(
samples
)
asize
+=
(
double
)
elesize
/
samples
*
dictSize
(
d
);
}
else
if
(
o
->
encoding
==
OBJ_ENCODING_INTSET
)
{
intset
*
is
=
o
->
ptr
;
asize
=
sizeof
(
*
o
)
+
sizeof
(
*
is
)
+
is
->
encoding
*
is
->
length
;
asize
=
sizeof
(
*
o
)
+
sizeof
(
*
is
)
+
(
size_t
)
is
->
encoding
*
is
->
length
;
}
else
{
serverPanic
(
"Unknown set encoding"
);
}
...
...
src/redis-check-rdb.c
View file @
fd7d51c3
...
...
@@ -250,7 +250,7 @@ int redis_check_rdb(char *rdbfilename, FILE *fp) {
rdbstate
.
doing
=
RDB_CHECK_DOING_READ_LEN
;
if
((
dbid
=
rdbLoadLen
(
&
rdb
,
NULL
))
==
RDB_LENERR
)
goto
eoferr
;
rdbCheckInfo
(
"Selecting DB ID %
d"
,
dbid
);
rdbCheckInfo
(
"Selecting DB ID %
llu"
,
(
unsigned
long
long
)
dbid
);
continue
;
/* Read type again. */
}
else
if
(
type
==
RDB_OPCODE_RESIZEDB
)
{
/* RESIZEDB: Hint about the size of the keys in the currently
...
...
src/redis-cli.c
View file @
fd7d51c3
...
...
@@ -5476,7 +5476,7 @@ static void clusterManagerNodeArrayReset(clusterManagerNodeArray *array) {
static void clusterManagerNodeArrayShift(clusterManagerNodeArray *array,
clusterManagerNode **nodeptr)
{
assert(array->
nodes < (array->nodes + array->len)
);
assert(array->
len > 0
);
/* If the first node to be shifted is not NULL, decrement count. */
if (*array->nodes != NULL) array->count--;
/* Store the first node to be shifted into 'nodeptr'. */
...
...
@@ -5489,7 +5489,7 @@ static void clusterManagerNodeArrayShift(clusterManagerNodeArray *array,
static void clusterManagerNodeArrayAdd(clusterManagerNodeArray *array,
clusterManagerNode *node)
{
assert(array->
nodes < (array->nodes + array->len)
);
assert(array->
len > 0
);
assert(node != NULL);
assert(array->count < array->len);
array->nodes[array->count++] = node;
...
...
@@ -6866,7 +6866,7 @@ void showLatencyDistSamples(struct distsamples *samples, long long tot) {
printf("\033[38;5;0m"); /* Set foreground color to black. */
for (j = 0; ; j++) {
int coloridx =
ceil((
float
) samples[j].count / tot * (spectrum_palette_size-1));
ceil((
double
) samples[j].count / tot * (spectrum_palette_size-1));
int color = spectrum_palette[coloridx];
printf("\033[48;5;%dm%c", (int)color, samples[j].character);
samples[j].count = 0;
...
...
src/sentinel.c
View file @
fd7d51c3
...
...
@@ -4119,16 +4119,16 @@ void sentinelSetCommand(client *c) {
int
numargs
=
j
-
old_j
+
1
;
switch
(
numargs
)
{
case
2
:
sentinelEvent
(
LL_WARNING
,
"+set"
,
ri
,
"%@ %s %s"
,
c
->
argv
[
old_j
]
->
ptr
,
c
->
argv
[
old_j
+
1
]
->
ptr
);
sentinelEvent
(
LL_WARNING
,
"+set"
,
ri
,
"%@ %s %s"
,
(
char
*
)
c
->
argv
[
old_j
]
->
ptr
,
(
char
*
)
c
->
argv
[
old_j
+
1
]
->
ptr
);
break
;
case
3
:
sentinelEvent
(
LL_WARNING
,
"+set"
,
ri
,
"%@ %s %s %s"
,
c
->
argv
[
old_j
]
->
ptr
,
c
->
argv
[
old_j
+
1
]
->
ptr
,
c
->
argv
[
old_j
+
2
]
->
ptr
);
sentinelEvent
(
LL_WARNING
,
"+set"
,
ri
,
"%@ %s %s %s"
,
(
char
*
)
c
->
argv
[
old_j
]
->
ptr
,
(
char
*
)
c
->
argv
[
old_j
+
1
]
->
ptr
,
(
char
*
)
c
->
argv
[
old_j
+
2
]
->
ptr
);
break
;
default:
sentinelEvent
(
LL_WARNING
,
"+set"
,
ri
,
"%@ %s"
,
c
->
argv
[
old_j
]
->
ptr
);
sentinelEvent
(
LL_WARNING
,
"+set"
,
ri
,
"%@ %s"
,
(
char
*
)
c
->
argv
[
old_j
]
->
ptr
);
break
;
}
}
...
...
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