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
6eaad663
Commit
6eaad663
authored
Jan 04, 2011
by
antirez
Browse files
Merge branch 'master' into unstable
parents
1190c6cb
04a2ade9
Changes
23
Hide whitespace changes
Inline
Side-by-side
src/redis.c
View file @
6eaad663
...
@@ -1441,7 +1441,7 @@ void createPidFile(void) {
...
@@ -1441,7 +1441,7 @@ void createPidFile(void) {
/* Try to write the pid file in a best-effort way. */
/* Try to write the pid file in a best-effort way. */
FILE
*
fp
=
fopen
(
server
.
pidfile
,
"w"
);
FILE
*
fp
=
fopen
(
server
.
pidfile
,
"w"
);
if
(
fp
)
{
if
(
fp
)
{
fprintf
(
fp
,
"%d
\n
"
,
getpid
());
fprintf
(
fp
,
"%d
\n
"
,
(
int
)
getpid
());
fclose
(
fp
);
fclose
(
fp
);
}
}
}
}
...
...
src/t_string.c
View file @
6eaad663
#include <limits.h>
#include "redis.h"
#include "redis.h"
/*-----------------------------------------------------------------------------
/*-----------------------------------------------------------------------------
...
...
src/ziplist.c
View file @
6eaad663
...
@@ -119,6 +119,7 @@ static unsigned int zipEntryEncoding(unsigned char *p) {
...
@@ -119,6 +119,7 @@ static unsigned int zipEntryEncoding(unsigned char *p) {
return
p
[
0
]
&
0xf0
;
return
p
[
0
]
&
0xf0
;
}
}
assert
(
NULL
);
assert
(
NULL
);
return
0
;
}
}
/* Return bytes needed to store integer encoded by 'encoding' */
/* Return bytes needed to store integer encoded by 'encoding' */
...
@@ -129,13 +130,14 @@ static unsigned int zipIntSize(unsigned char encoding) {
...
@@ -129,13 +130,14 @@ static unsigned int zipIntSize(unsigned char encoding) {
case
ZIP_INT_64B
:
return
sizeof
(
int64_t
);
case
ZIP_INT_64B
:
return
sizeof
(
int64_t
);
}
}
assert
(
NULL
);
assert
(
NULL
);
return
0
;
}
}
/* Decode the encoded length pointed by 'p'. If a pointer to 'lensize' is
/* Decode the encoded length pointed by 'p'. If a pointer to 'lensize' is
* provided, it is set to the number of bytes required to encode the length. */
* provided, it is set to the number of bytes required to encode the length. */
static
unsigned
int
zipDecodeLength
(
unsigned
char
*
p
,
unsigned
int
*
lensize
)
{
static
unsigned
int
zipDecodeLength
(
unsigned
char
*
p
,
unsigned
int
*
lensize
)
{
unsigned
char
encoding
=
zipEntryEncoding
(
p
);
unsigned
char
encoding
=
zipEntryEncoding
(
p
);
unsigned
int
len
;
unsigned
int
len
=
0
;
if
(
ZIP_IS_STR
(
encoding
))
{
if
(
ZIP_IS_STR
(
encoding
))
{
switch
(
encoding
)
{
switch
(
encoding
)
{
...
@@ -300,7 +302,7 @@ static void zipSaveInteger(unsigned char *p, int64_t value, unsigned char encodi
...
@@ -300,7 +302,7 @@ static void zipSaveInteger(unsigned char *p, int64_t value, unsigned char encodi
static
int64_t
zipLoadInteger
(
unsigned
char
*
p
,
unsigned
char
encoding
)
{
static
int64_t
zipLoadInteger
(
unsigned
char
*
p
,
unsigned
char
encoding
)
{
int16_t
i16
;
int16_t
i16
;
int32_t
i32
;
int32_t
i32
;
int64_t
i64
,
ret
;
int64_t
i64
,
ret
=
0
;
if
(
encoding
==
ZIP_INT_16B
)
{
if
(
encoding
==
ZIP_INT_16B
)
{
memcpy
(
&
i16
,
p
,
sizeof
(
i16
));
memcpy
(
&
i16
,
p
,
sizeof
(
i16
));
ret
=
i16
;
ret
=
i16
;
...
...
Prev
1
2
Next
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