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