Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
fc2c0f7a
Commit
fc2c0f7a
authored
May 29, 2010
by
Pieter Noordhuis
Browse files
fix some warnings
parent
4812cf28
Changes
1
Show whitespace changes
Inline
Side-by-side
ziplist.c
View file @
fc2c0f7a
...
...
@@ -124,7 +124,7 @@ static int zipTryEncoding(unsigned char *entry, long long *v, char *encoding) {
char
*
eptr
;
if
(
entry
[
0
]
==
'-'
||
(
entry
[
0
]
>=
'0'
&&
entry
[
0
]
<=
'9'
))
{
value
=
strtoll
(
entry
,
&
eptr
,
10
);
value
=
strtoll
(
(
char
*
)
entry
,
&
eptr
,
10
);
if
(
eptr
[
0
]
!=
'\0'
)
return
0
;
if
(
value
>=
SHRT_MIN
&&
value
<=
SHRT_MAX
)
{
*
encoding
=
ZIP_ENC_SHORT
;
...
...
@@ -327,7 +327,7 @@ unsigned int ziplistGet(unsigned char *p, unsigned char **e, unsigned int *elen,
/* Delete a range of entries from the ziplist. */
unsigned
char
*
ziplistDeleteRange
(
unsigned
char
*
zl
,
unsigned
int
index
,
unsigned
int
num
)
{
unsigned
char
*
p
,
*
first
=
ziplistIndex
(
zl
,
index
);
unsigned
int
i
,
deleted
=
0
,
totlen
,
newlen
;
unsigned
int
i
,
totlen
,
deleted
=
0
;
for
(
p
=
first
,
i
=
0
;
*
p
!=
ZIP_END
&&
i
<
num
;
i
++
)
{
p
+=
zipRawEntryLength
(
p
);
deleted
++
;
...
...
@@ -419,7 +419,6 @@ unsigned int ziplistSize(unsigned char *zl) {
void
ziplistRepr
(
unsigned
char
*
zl
)
{
unsigned
char
*
p
,
encoding
;
unsigned
int
l
,
lsize
;
long
long
value
;
printf
(
"{total bytes %d} {length %u}
\n
"
,
ZIPLIST_BYTES
(
zl
),
ZIPLIST_LENGTH
(
zl
));
p
=
ziplistHead
(
zl
);
...
...
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