Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
git
提交
cbf0240f
G
git
项目概览
李少辉-开发者
/
git
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
git
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cbf0240f
编写于
2月 13, 2018
作者:
J
Junio C Hamano
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'sg/cocci-move-array'
Code clean-up. * sg/cocci-move-array: Use MOVE_ARRAY
上级
e75c8621
f919ffeb
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
19 addition
and
27 deletion
+19
-27
cache-tree.c
cache-tree.c
+2
-3
commit.c
commit.c
+2
-4
diffcore-rename.c
diffcore-rename.c
+4
-4
dir.c
dir.c
+2
-2
parse-options.c
parse-options.c
+1
-1
read-cache.c
read-cache.c
+2
-3
refs/ref-cache.c
refs/ref-cache.c
+2
-4
replace_object.c
replace_object.c
+2
-4
rerere.c
rerere.c
+2
-2
未找到文件。
cache-tree.c
浏览文件 @
cbf0240f
...
@@ -84,9 +84,8 @@ static struct cache_tree_sub *find_subtree(struct cache_tree *it,
...
@@ -84,9 +84,8 @@ static struct cache_tree_sub *find_subtree(struct cache_tree *it,
down
->
namelen
=
pathlen
;
down
->
namelen
=
pathlen
;
if
(
pos
<
it
->
subtree_nr
)
if
(
pos
<
it
->
subtree_nr
)
memmove
(
it
->
down
+
pos
+
1
,
MOVE_ARRAY
(
it
->
down
+
pos
+
1
,
it
->
down
+
pos
,
it
->
down
+
pos
,
it
->
subtree_nr
-
pos
-
1
);
sizeof
(
down
)
*
(
it
->
subtree_nr
-
pos
-
1
));
it
->
down
[
pos
]
=
down
;
it
->
down
[
pos
]
=
down
;
return
down
;
return
down
;
}
}
...
...
commit.c
浏览文件 @
cbf0240f
...
@@ -126,10 +126,8 @@ int register_commit_graft(struct commit_graft *graft, int ignore_dups)
...
@@ -126,10 +126,8 @@ int register_commit_graft(struct commit_graft *graft, int ignore_dups)
ALLOC_GROW
(
commit_graft
,
commit_graft_nr
+
1
,
commit_graft_alloc
);
ALLOC_GROW
(
commit_graft
,
commit_graft_nr
+
1
,
commit_graft_alloc
);
commit_graft_nr
++
;
commit_graft_nr
++
;
if
(
pos
<
commit_graft_nr
)
if
(
pos
<
commit_graft_nr
)
memmove
(
commit_graft
+
pos
+
1
,
MOVE_ARRAY
(
commit_graft
+
pos
+
1
,
commit_graft
+
pos
,
commit_graft
+
pos
,
commit_graft_nr
-
pos
-
1
);
(
commit_graft_nr
-
pos
-
1
)
*
sizeof
(
*
commit_graft
));
commit_graft
[
pos
]
=
graft
;
commit_graft
[
pos
]
=
graft
;
return
0
;
return
0
;
}
}
...
...
diffcore-rename.c
浏览文件 @
cbf0240f
...
@@ -57,8 +57,8 @@ static int add_rename_dst(struct diff_filespec *two)
...
@@ -57,8 +57,8 @@ static int add_rename_dst(struct diff_filespec *two)
ALLOC_GROW
(
rename_dst
,
rename_dst_nr
+
1
,
rename_dst_alloc
);
ALLOC_GROW
(
rename_dst
,
rename_dst_nr
+
1
,
rename_dst_alloc
);
rename_dst_nr
++
;
rename_dst_nr
++
;
if
(
first
<
rename_dst_nr
)
if
(
first
<
rename_dst_nr
)
memmove
(
rename_dst
+
first
+
1
,
rename_dst
+
first
,
MOVE_ARRAY
(
rename_dst
+
first
+
1
,
rename_dst
+
first
,
(
rename_dst_nr
-
first
-
1
)
*
sizeof
(
*
rename_dst
)
);
rename_dst_nr
-
first
-
1
);
rename_dst
[
first
].
two
=
alloc_filespec
(
two
->
path
);
rename_dst
[
first
].
two
=
alloc_filespec
(
two
->
path
);
fill_filespec
(
rename_dst
[
first
].
two
,
&
two
->
oid
,
two
->
oid_valid
,
fill_filespec
(
rename_dst
[
first
].
two
,
&
two
->
oid
,
two
->
oid_valid
,
two
->
mode
);
two
->
mode
);
...
@@ -98,8 +98,8 @@ static struct diff_rename_src *register_rename_src(struct diff_filepair *p)
...
@@ -98,8 +98,8 @@ static struct diff_rename_src *register_rename_src(struct diff_filepair *p)
ALLOC_GROW
(
rename_src
,
rename_src_nr
+
1
,
rename_src_alloc
);
ALLOC_GROW
(
rename_src
,
rename_src_nr
+
1
,
rename_src_alloc
);
rename_src_nr
++
;
rename_src_nr
++
;
if
(
first
<
rename_src_nr
)
if
(
first
<
rename_src_nr
)
memmove
(
rename_src
+
first
+
1
,
rename_src
+
first
,
MOVE_ARRAY
(
rename_src
+
first
+
1
,
rename_src
+
first
,
(
rename_src_nr
-
first
-
1
)
*
sizeof
(
*
rename_src
)
);
rename_src_nr
-
first
-
1
);
rename_src
[
first
].
p
=
p
;
rename_src
[
first
].
p
=
p
;
rename_src
[
first
].
score
=
score
;
rename_src
[
first
].
score
=
score
;
return
&
(
rename_src
[
first
]);
return
&
(
rename_src
[
first
]);
...
...
dir.c
浏览文件 @
cbf0240f
...
@@ -747,8 +747,8 @@ static struct untracked_cache_dir *lookup_untracked(struct untracked_cache *uc,
...
@@ -747,8 +747,8 @@ static struct untracked_cache_dir *lookup_untracked(struct untracked_cache *uc,
FLEX_ALLOC_MEM
(
d
,
name
,
name
,
len
);
FLEX_ALLOC_MEM
(
d
,
name
,
name
,
len
);
ALLOC_GROW
(
dir
->
dirs
,
dir
->
dirs_nr
+
1
,
dir
->
dirs_alloc
);
ALLOC_GROW
(
dir
->
dirs
,
dir
->
dirs_nr
+
1
,
dir
->
dirs_alloc
);
memmove
(
dir
->
dirs
+
first
+
1
,
dir
->
dirs
+
first
,
MOVE_ARRAY
(
dir
->
dirs
+
first
+
1
,
dir
->
dirs
+
first
,
(
dir
->
dirs_nr
-
first
)
*
sizeof
(
*
dir
->
dirs
)
);
dir
->
dirs_nr
-
first
);
dir
->
dirs_nr
++
;
dir
->
dirs_nr
++
;
dir
->
dirs
[
first
]
=
d
;
dir
->
dirs
[
first
]
=
d
;
return
d
;
return
d
;
...
...
parse-options.c
浏览文件 @
cbf0240f
...
@@ -525,7 +525,7 @@ int parse_options_step(struct parse_opt_ctx_t *ctx,
...
@@ -525,7 +525,7 @@ int parse_options_step(struct parse_opt_ctx_t *ctx,
int
parse_options_end
(
struct
parse_opt_ctx_t
*
ctx
)
int
parse_options_end
(
struct
parse_opt_ctx_t
*
ctx
)
{
{
memmove
(
ctx
->
out
+
ctx
->
cpidx
,
ctx
->
argv
,
ctx
->
argc
*
sizeof
(
*
ctx
->
out
)
);
MOVE_ARRAY
(
ctx
->
out
+
ctx
->
cpidx
,
ctx
->
argv
,
ctx
->
argc
);
ctx
->
out
[
ctx
->
cpidx
+
ctx
->
argc
]
=
NULL
;
ctx
->
out
[
ctx
->
cpidx
+
ctx
->
argc
]
=
NULL
;
return
ctx
->
cpidx
+
ctx
->
argc
;
return
ctx
->
cpidx
+
ctx
->
argc
;
}
}
...
...
read-cache.c
浏览文件 @
cbf0240f
...
@@ -1217,9 +1217,8 @@ int add_index_entry(struct index_state *istate, struct cache_entry *ce, int opti
...
@@ -1217,9 +1217,8 @@ int add_index_entry(struct index_state *istate, struct cache_entry *ce, int opti
/* Add it in.. */
/* Add it in.. */
istate
->
cache_nr
++
;
istate
->
cache_nr
++
;
if
(
istate
->
cache_nr
>
pos
+
1
)
if
(
istate
->
cache_nr
>
pos
+
1
)
memmove
(
istate
->
cache
+
pos
+
1
,
MOVE_ARRAY
(
istate
->
cache
+
pos
+
1
,
istate
->
cache
+
pos
,
istate
->
cache
+
pos
,
istate
->
cache_nr
-
pos
-
1
);
(
istate
->
cache_nr
-
pos
-
1
)
*
sizeof
(
ce
));
set_index_entry
(
istate
,
pos
,
ce
);
set_index_entry
(
istate
,
pos
,
ce
);
istate
->
cache_changed
|=
CE_ENTRY_ADDED
;
istate
->
cache_changed
|=
CE_ENTRY_ADDED
;
return
0
;
return
0
;
...
...
refs/ref-cache.c
浏览文件 @
cbf0240f
...
@@ -238,10 +238,8 @@ int remove_entry_from_dir(struct ref_dir *dir, const char *refname)
...
@@ -238,10 +238,8 @@ int remove_entry_from_dir(struct ref_dir *dir, const char *refname)
return
-
1
;
return
-
1
;
entry
=
dir
->
entries
[
entry_index
];
entry
=
dir
->
entries
[
entry_index
];
memmove
(
&
dir
->
entries
[
entry_index
],
MOVE_ARRAY
(
&
dir
->
entries
[
entry_index
],
&
dir
->
entries
[
entry_index
+
1
],
&
dir
->
entries
[
entry_index
+
1
],
dir
->
nr
-
entry_index
-
1
);
(
dir
->
nr
-
entry_index
-
1
)
*
sizeof
(
*
dir
->
entries
)
);
dir
->
nr
--
;
dir
->
nr
--
;
if
(
dir
->
sorted
>
entry_index
)
if
(
dir
->
sorted
>
entry_index
)
dir
->
sorted
--
;
dir
->
sorted
--
;
...
...
replace_object.c
浏览文件 @
cbf0240f
...
@@ -44,10 +44,8 @@ static int register_replace_object(struct replace_object *replace,
...
@@ -44,10 +44,8 @@ static int register_replace_object(struct replace_object *replace,
ALLOC_GROW
(
replace_object
,
replace_object_nr
+
1
,
replace_object_alloc
);
ALLOC_GROW
(
replace_object
,
replace_object_nr
+
1
,
replace_object_alloc
);
replace_object_nr
++
;
replace_object_nr
++
;
if
(
pos
<
replace_object_nr
)
if
(
pos
<
replace_object_nr
)
memmove
(
replace_object
+
pos
+
1
,
MOVE_ARRAY
(
replace_object
+
pos
+
1
,
replace_object
+
pos
,
replace_object
+
pos
,
replace_object_nr
-
pos
-
1
);
(
replace_object_nr
-
pos
-
1
)
*
sizeof
(
*
replace_object
));
replace_object
[
pos
]
=
replace
;
replace_object
[
pos
]
=
replace
;
return
0
;
return
0
;
}
}
...
...
rerere.c
浏览文件 @
cbf0240f
...
@@ -159,8 +159,8 @@ static struct rerere_dir *find_rerere_dir(const char *hex)
...
@@ -159,8 +159,8 @@ static struct rerere_dir *find_rerere_dir(const char *hex)
ALLOC_GROW
(
rerere_dir
,
rerere_dir_nr
+
1
,
rerere_dir_alloc
);
ALLOC_GROW
(
rerere_dir
,
rerere_dir_nr
+
1
,
rerere_dir_alloc
);
/* ... and add it in. */
/* ... and add it in. */
rerere_dir_nr
++
;
rerere_dir_nr
++
;
memmove
(
rerere_dir
+
pos
+
1
,
rerere_dir
+
pos
,
MOVE_ARRAY
(
rerere_dir
+
pos
+
1
,
rerere_dir
+
pos
,
(
rerere_dir_nr
-
pos
-
1
)
*
sizeof
(
*
rerere_dir
)
);
rerere_dir_nr
-
pos
-
1
);
rerere_dir
[
pos
]
=
rr_dir
;
rerere_dir
[
pos
]
=
rr_dir
;
scan_rerere_dir
(
rr_dir
);
scan_rerere_dir
(
rr_dir
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录