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
688996f4
You need to sign in or sign up before continuing.
Commit
688996f4
authored
Jun 10, 2016
by
Salvatore Sanfilippo
Committed by
GitHub
Jun 10, 2016
Browse files
Merge pull request #3295 from catwell/pr-1-warnings
fix some compiler warnings
parents
b4327ae5
188d90fc
Changes
3
Show whitespace changes
Inline
Side-by-side
src/bitops.c
View file @
688996f4
...
...
@@ -306,7 +306,7 @@ int checkUnsignedBitfieldOverflow(uint64_t value, int64_t incr, uint64_t bits, i
handle_wrap:
{
uint64_t
mask
=
((
int64_t
)
-
1
)
<<
bits
;
uint64_t
mask
=
((
u
int64_t
)
-
1
)
<<
bits
;
uint64_t
res
=
value
+
incr
;
res
&=
~
mask
;
...
...
@@ -349,7 +349,7 @@ int checkSignedBitfieldOverflow(int64_t value, int64_t incr, uint64_t bits, int
handle_wrap:
{
uint64_t
mask
=
((
int64_t
)
-
1
)
<<
bits
;
uint64_t
mask
=
((
u
int64_t
)
-
1
)
<<
bits
;
uint64_t
msb
=
(
uint64_t
)
1
<<
(
bits
-
1
);
uint64_t
a
=
value
,
b
=
incr
,
c
;
c
=
a
+
b
;
/* Perform addition as unsigned so that's defined. */
...
...
src/rdb.c
View file @
688996f4
...
...
@@ -736,7 +736,7 @@ ssize_t rdbSaveObject(rio *rdb, robj *o) {
/* Then write the module-specific representation. */
mt
->
rdb_save
(
&
io
,
mv
->
value
);
return
io
.
error
?
-
1
:
io
.
bytes
;
return
io
.
error
?
-
1
:
(
ssize_t
)
io
.
bytes
;
}
else
{
serverPanic
(
"Unknown object type"
);
}
...
...
src/redis-check-rdb.c
View file @
688996f4
...
...
@@ -275,7 +275,8 @@ static char* loadStringObject() {
return
loadLzfStringObject
();
default:
/* unknown encoding */
SHIFT_ERROR
(
offset
,
"Unknown string encoding (0x%02llx)"
,
len
);
SHIFT_ERROR
(
offset
,
"Unknown string encoding (0x%02llx)"
,
(
unsigned
long
long
)
len
);
return
NULL
;
}
}
...
...
@@ -390,7 +391,8 @@ static int loadPair(entry *e) {
for
(
i
=
0
;
i
<
length
;
i
++
)
{
offset
=
CURR_OFFSET
;
if
(
!
processStringObject
(
NULL
))
{
SHIFT_ERROR
(
offset
,
"Error reading element at index %llu (length: %llu)"
,
i
,
length
);
SHIFT_ERROR
(
offset
,
"Error reading element at index %llu (length: %llu)"
,
(
unsigned
long
long
)
i
,
(
unsigned
long
long
)
length
);
return
0
;
}
}
...
...
@@ -399,12 +401,14 @@ static int loadPair(entry *e) {
for
(
i
=
0
;
i
<
length
;
i
++
)
{
offset
=
CURR_OFFSET
;
if
(
!
processStringObject
(
NULL
))
{
SHIFT_ERROR
(
offset
,
"Error reading element key at index %llu (length: %llu)"
,
i
,
length
);
SHIFT_ERROR
(
offset
,
"Error reading element key at index %llu (length: %llu)"
,
(
unsigned
long
long
)
i
,
(
unsigned
long
long
)
length
);
return
0
;
}
offset
=
CURR_OFFSET
;
if
(
!
processDoubleValue
(
NULL
))
{
SHIFT_ERROR
(
offset
,
"Error reading element value at index %llu (length: %llu)"
,
i
,
length
);
SHIFT_ERROR
(
offset
,
"Error reading element value at index %llu (length: %llu)"
,
(
unsigned
long
long
)
i
,
(
unsigned
long
long
)
length
);
return
0
;
}
}
...
...
@@ -413,12 +417,14 @@ static int loadPair(entry *e) {
for
(
i
=
0
;
i
<
length
;
i
++
)
{
offset
=
CURR_OFFSET
;
if
(
!
processStringObject
(
NULL
))
{
SHIFT_ERROR
(
offset
,
"Error reading element key at index %llu (length: %llu)"
,
i
,
length
);
SHIFT_ERROR
(
offset
,
"Error reading element key at index %llu (length: %llu)"
,
(
unsigned
long
long
)
i
,
(
unsigned
long
long
)
length
);
return
0
;
}
offset
=
CURR_OFFSET
;
if
(
!
processStringObject
(
NULL
))
{
SHIFT_ERROR
(
offset
,
"Error reading element value at index %llu (length: %llu)"
,
i
,
length
);
SHIFT_ERROR
(
offset
,
"Error reading element value at index %llu (length: %llu)"
,
(
unsigned
long
long
)
i
,
(
unsigned
long
long
)
length
);
return
0
;
}
}
...
...
@@ -451,7 +457,8 @@ static entry loadEntry() {
return
e
;
}
if
(
length
>
63
)
{
SHIFT_ERROR
(
offset
[
1
],
"Database number out of range (%llu)"
,
length
);
SHIFT_ERROR
(
offset
[
1
],
"Database number out of range (%llu)"
,
(
unsigned
long
long
)
length
);
return
e
;
}
}
else
if
(
e
.
type
==
RDB_OPCODE_EOF
)
{
...
...
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