Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
别团等shy哥发育
redis
提交
1cf1db97
R
redis
项目概览
别团等shy哥发育
/
redis
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
redis
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
1cf1db97
编写于
6月 10, 2015
作者:
E
Enrico Giordani
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Final portability fixes for 'long' type.
上级
365c4c75
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
23 addition
and
23 deletion
+23
-23
src/aof.c
src/aof.c
+1
-1
src/latency.c
src/latency.c
+1
-1
src/memtest.c
src/memtest.c
+2
-2
src/object.c
src/object.c
+1
-1
src/redis.c
src/redis.c
+6
-6
src/replication.c
src/replication.c
+1
-1
src/sentinel.c
src/sentinel.c
+9
-9
src/zmalloc.c
src/zmalloc.c
+2
-2
未找到文件。
src/aof.c
浏览文件 @
1cf1db97
...
...
@@ -180,7 +180,7 @@ void stopAppendOnly(void) {
server
.
aof_state
=
REDIS_AOF_OFF
;
/* rewrite operation in progress? kill it, wait child exit */
if
(
server
.
aof_child_pid
!=
-
1
)
{
redisLog
(
REDIS_NOTICE
,
"Killing running AOF rewrite child: %Id"
,
/* PORTABILITY FIX
%ld -> %Id */
redisLog
(
REDIS_NOTICE
,
"Killing running AOF rewrite child: %Id"
,
WIN_PORT_FIX
/*
%ld -> %Id */
(
PORT_LONG
)
server
.
aof_child_pid
);
#ifdef _WIN32
AbortForkOperation
();
...
...
src/latency.c
浏览文件 @
1cf1db97
...
...
@@ -537,7 +537,7 @@ sds latencyCommandGenSparkeline(char *event, struct latencyTimeSeries *ts) {
}
graph
=
sdscatprintf
(
graph
,
"%s - high %Iu ms, low %Iu ms (all time high %Iu ms)
\n
"
,
event
,
/* PORTABILITY FIX
%ld -> %Id, %lu -> %Iu */
"%s - high %Iu ms, low %Iu ms (all time high %Iu ms)
\n
"
,
event
,
WIN_PORT_FIX
/*
%ld -> %Id, %lu -> %Iu */
(
PORT_ULONG
)
max
,
(
PORT_ULONG
)
min
,
(
PORT_ULONG
)
ts
->
max
);
for
(
j
=
0
;
j
<
LATENCY_GRAPH_COLS
;
j
++
)
graph
=
sdscatlen
(
graph
,
"-"
,
1
);
...
...
src/memtest.c
浏览文件 @
1cf1db97
...
...
@@ -232,8 +232,8 @@ void memtest_test(size_t megabytes, int passes) {
int
pass
=
0
;
if
(
m
==
NULL
)
{
fprintf
(
stderr
,
"Unable to allocate %Iu megabytes: %s"
,
megabytes
,
strerror
(
errno
));
WIN_PORT_FIX
/* %zu -> %Iu */
fprintf
(
stderr
,
"Unable to allocate %Iu megabytes: %s"
,
WIN_PORT_FIX
/* %zu -> %Iu */
megabytes
,
strerror
(
errno
));
exit
(
1
);
}
while
(
pass
!=
passes
)
{
...
...
src/object.c
浏览文件 @
1cf1db97
...
...
@@ -100,7 +100,7 @@ robj *createStringObjectFromLongDouble(PORT_LONGDOUBLE value, int humanfriendly)
* way that is "non surprising" for the user (that is, most small
* decimal numbers will be represented in a way that when converted
* back into a string are exactly the same as what the user typed.) */
len
=
snprintf
(
buf
,
sizeof
(
buf
),
"%.15Lf"
,
value
);
WIN_PORT_FIX
/* %.17 -> %.15 on Windows the magic number is 15 */
len
=
snprintf
(
buf
,
sizeof
(
buf
),
"%.15Lf"
,
value
);
WIN_PORT_FIX
/* %.17 -> %.15 on Windows the magic number is 15 */
/* Now remove trailing zeroes after the '.' */
if
(
strchr
(
buf
,
'.'
)
!=
NULL
)
{
char
*
p
=
buf
+
len
-
1
;
...
...
src/redis.c
浏览文件 @
1cf1db97
...
...
@@ -1087,10 +1087,10 @@ int serverCron(struct aeEventLoop *eventLoop, PORT_LONGLONG id, void *clientData
if
(
!
server
.
sentinel_mode
)
{
run_with_period
(
5000
)
{
redisLog
(
REDIS_VERBOSE
,
"%Iu clients connected (%Iu slaves), %Iu bytes in use"
,
"%Iu clients connected (%Iu slaves), %Iu bytes in use"
,
WIN_PORT_FIX
/* %zu -> %Iu */
listLength
(
server
.
clients
)
-
listLength
(
server
.
slaves
),
listLength
(
server
.
slaves
),
zmalloc_used_memory
());
WIN_PORT_FIX
/* %zu -> %Iu */
zmalloc_used_memory
());
}
}
...
...
@@ -2750,7 +2750,7 @@ sds genRedisInfoString(char *section) {
"aof_current_size:%lld
\r\n
"
"aof_base_size:%lld
\r\n
"
"aof_pending_rewrite:%d
\r\n
"
"aof_buffer_length:%Iu
\r\n
"
"aof_buffer_length:%Iu
\r\n
"
WIN_PORT_FIX
/* %zu -> %Iu */
"aof_rewrite_buffer_length:%lu
\r\n
"
"aof_pending_bio_fsync:%llu
\r\n
"
"aof_delayed_fsync:%lu
\r\n
"
,
...
...
@@ -2760,7 +2760,7 @@ sds genRedisInfoString(char *section) {
sdslen
(
server
.
aof_buf
),
aofRewriteBufferSize
(),
bioPendingJobsOfType
(
REDIS_BIO_AOF_FSYNC
),
server
.
aof_delayed_fsync
);
WIN_PORT_FIX
/* %zu -> %Iu */
server
.
aof_delayed_fsync
);
}
if
(
server
.
loading
)
{
...
...
@@ -3398,8 +3398,8 @@ void loadDataFromDisk(void) {
}
void
redisOutOfMemoryHandler
(
size_t
allocation_size
)
{
redisLog
(
REDIS_WARNING
,
"Out Of Memory allocating %Iu bytes!"
,
allocation_size
);
WIN_PORT_FIX
/* %zu -> %Iu */
redisLog
(
REDIS_WARNING
,
"Out Of Memory allocating %Iu bytes!"
,
WIN_PORT_FIX
/* %zu -> %Iu */
allocation_size
);
redisPanic
(
"Redis aborting for OUT OF MEMORY"
);
}
...
...
src/replication.c
浏览文件 @
1cf1db97
...
...
@@ -283,7 +283,7 @@ void replicationFeedMonitors(redisClient *c, list *monitors, int dictid, robj **
for
(
j
=
0
;
j
<
argc
;
j
++
)
{
if
(
argv
[
j
]
->
encoding
==
REDIS_ENCODING_INT
)
{
cmdrepr
=
sdscatprintf
(
cmdrepr
,
"
\"
%Id
\"
"
,
(
PORT_LONG
)
argv
[
j
]
->
ptr
);
/* PORTABILITY FIX
%ld -> %Id */
cmdrepr
=
sdscatprintf
(
cmdrepr
,
"
\"
%Id
\"
"
,
(
PORT_LONG
)
argv
[
j
]
->
ptr
);
WIN_PORT_FIX
/*
%ld -> %Id */
}
else
{
cmdrepr
=
sdscatrepr
(
cmdrepr
,(
char
*
)
argv
[
j
]
->
ptr
,
sdslen
(
argv
[
j
]
->
ptr
));
...
...
src/sentinel.c
浏览文件 @
1cf1db97
...
...
@@ -775,7 +775,7 @@ void sentinelRunPendingScripts(void) {
CloseHandle
(
pi
.
hThread
);
sentinel
.
running_scripts
++
;
sentinelEvent
(
REDIS_DEBUG
,
"+script-child"
,
NULL
,
"%
ld"
,
(
long
)
sj
->
pid
);
/* BUGBUG: fix %l
d */
sentinelEvent
(
REDIS_DEBUG
,
"+script-child"
,
NULL
,
"%
Id"
,
(
PORT_LONG
)
sj
->
pid
);
WIN_PORT_FIX
/* %ld -> %I
d */
}
else
{
sentinelEvent
(
REDIS_WARNING
,
"-script-error"
,
NULL
,
"%s %d %d"
,
sj
->
argv
[
0
],
99
,
0
);
...
...
@@ -844,8 +844,8 @@ void sentinelCollectTerminatedScripts(void) {
if
(
WaitForSingleObject
(
sj
->
hScriptProcess
,
0
)
==
WAIT_OBJECT_0
)
{
GetExitCodeProcess
(
sj
->
hScriptProcess
,
&
exitCode
);
sentinelEvent
(
REDIS_DEBUG
,
"-script-child"
,
NULL
,
"%ld %d %d"
,
(
long
)
sj
->
pid
,
exitCode
,
0
);
/* BUGBUG: fix %ld */
sentinelEvent
(
REDIS_DEBUG
,
"-script-child"
,
NULL
,
"%Id %d %d"
,
WIN_PORT_FIX
/* %ld -> %Id*/
(
PORT_LONG
)
sj
->
pid
,
exitCode
,
0
);
/* at this point the process ID may be recycled by Windows */
CloseHandle
(
sj
->
hScriptProcess
);
...
...
@@ -931,8 +931,8 @@ void sentinelKillTimedoutScripts(void) {
if
(
sj
->
flags
&
SENTINEL_SCRIPT_RUNNING
&&
(
now
-
sj
->
start_time
)
>
SENTINEL_SCRIPT_MAX_RUNTIME
)
{
sentinelEvent
(
REDIS_WARNING
,
"-script-timeout"
,
NULL
,
"%s %
ld"
,
sj
->
argv
[
0
],
(
long
)
sj
->
pid
);
/* BUGBUG */
sentinelEvent
(
REDIS_WARNING
,
"-script-timeout"
,
NULL
,
"%s %
Id"
,
WIN_PORT_FIX
/* %ld -> %Id*/
sj
->
argv
[
0
],
(
PORT_LONG
)
sj
->
pid
);
#ifdef _WIN32
TerminateProcess
(
sj
->
hScriptProcess
,
1
);
#else
...
...
@@ -1606,16 +1606,16 @@ void rewriteConfigSentinelOption(struct rewriteConfigState *state) {
/* sentinel down-after-milliseconds */
if
(
master
->
down_after_period
!=
SENTINEL_DEFAULT_DOWN_AFTER
)
{
line
=
sdscatprintf
(
sdsempty
(),
"sentinel down-after-milliseconds %s %
ld"
,
master
->
name
,
(
long
)
master
->
down_after_period
);
/* BUGBUG */
"sentinel down-after-milliseconds %s %
Id"
,
WIN_PORT_FIX
/* %ld -> %Id*/
master
->
name
,
(
PORT_LONG
)
master
->
down_after_period
);
rewriteConfigRewriteLine
(
state
,
"sentinel"
,
line
,
1
);
}
/* sentinel failover-timeout */
if
(
master
->
failover_timeout
!=
SENTINEL_DEFAULT_FAILOVER_TIMEOUT
)
{
line
=
sdscatprintf
(
sdsempty
(),
"sentinel failover-timeout %s %
ld"
,
master
->
name
,
(
long
)
master
->
failover_timeout
);
/* BUGBUG */
"sentinel failover-timeout %s %
Id"
,
WIN_PORT_FIX
/* %ld -> %Id*/
master
->
name
,
(
PORT_LONG
)
master
->
failover_timeout
);
rewriteConfigRewriteLine
(
state
,
"sentinel"
,
line
,
1
);
}
...
...
src/zmalloc.c
浏览文件 @
1cf1db97
...
...
@@ -131,8 +131,8 @@ pthread_mutex_t used_memory_mutex = PTHREAD_MUTEX_INITIALIZER;
#endif
static
void
zmalloc_default_oom
(
size_t
size
)
{
fprintf
(
stderr
,
"zmalloc: Out of memory trying to allocate %Iu bytes
\n
"
,
size
);
WIN_PORT_FIX
/* %zu -> %Iu */
fprintf
(
stderr
,
"zmalloc: Out of memory trying to allocate %Iu bytes
\n
"
,
WIN_PORT_FIX
/* %zu -> %Iu */
size
);
fflush
(
stderr
);
abort
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录