Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
jansson
提交
cc318fc0
J
jansson
项目概览
btwise
/
jansson
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jansson
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
cc318fc0
编写于
11月 15, 2020
作者:
P
Petri Lehtinen
提交者:
GitHub
11月 15, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #555 from kiyolee/size_t-warnings
Fix size_t related MSVC compiler warnings
上级
a740f15c
638449c4
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
6 addition
and
6 deletion
+6
-6
examples/simple_parse.c
examples/simple_parse.c
+4
-4
src/lookup3.h
src/lookup3.h
+1
-1
test/bin/json_process.c
test/bin/json_process.c
+1
-1
未找到文件。
examples/simple_parse.c
浏览文件 @
cc318fc0
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
void
print_json
(
json_t
*
root
);
void
print_json
(
json_t
*
root
);
void
print_json_aux
(
json_t
*
element
,
int
indent
);
void
print_json_aux
(
json_t
*
element
,
int
indent
);
void
print_json_indent
(
int
indent
);
void
print_json_indent
(
int
indent
);
const
char
*
json_plural
(
in
t
count
);
const
char
*
json_plural
(
size_
t
count
);
void
print_json_object
(
json_t
*
element
,
int
indent
);
void
print_json_object
(
json_t
*
element
,
int
indent
);
void
print_json_array
(
json_t
*
element
,
int
indent
);
void
print_json_array
(
json_t
*
element
,
int
indent
);
void
print_json_string
(
json_t
*
element
,
int
indent
);
void
print_json_string
(
json_t
*
element
,
int
indent
);
...
@@ -80,7 +80,7 @@ void print_json_indent(int indent) {
...
@@ -80,7 +80,7 @@ void print_json_indent(int indent) {
}
}
}
}
const
char
*
json_plural
(
in
t
count
)
{
return
count
==
1
?
""
:
"s"
;
}
const
char
*
json_plural
(
size_
t
count
)
{
return
count
==
1
?
""
:
"s"
;
}
void
print_json_object
(
json_t
*
element
,
int
indent
)
{
void
print_json_object
(
json_t
*
element
,
int
indent
)
{
size_t
size
;
size_t
size
;
...
@@ -90,7 +90,7 @@ void print_json_object(json_t *element, int indent) {
...
@@ -90,7 +90,7 @@ void print_json_object(json_t *element, int indent) {
print_json_indent
(
indent
);
print_json_indent
(
indent
);
size
=
json_object_size
(
element
);
size
=
json_object_size
(
element
);
printf
(
"JSON Object of %l
d pair%s:
\n
"
,
size
,
json_plural
(
size
));
printf
(
"JSON Object of %l
ld pair%s:
\n
"
,
(
long
long
)
size
,
json_plural
(
size
));
json_object_foreach
(
element
,
key
,
value
)
{
json_object_foreach
(
element
,
key
,
value
)
{
print_json_indent
(
indent
+
2
);
print_json_indent
(
indent
+
2
);
printf
(
"JSON Key:
\"
%s
\"\n
"
,
key
);
printf
(
"JSON Key:
\"
%s
\"\n
"
,
key
);
...
@@ -103,7 +103,7 @@ void print_json_array(json_t *element, int indent) {
...
@@ -103,7 +103,7 @@ void print_json_array(json_t *element, int indent) {
size_t
size
=
json_array_size
(
element
);
size_t
size
=
json_array_size
(
element
);
print_json_indent
(
indent
);
print_json_indent
(
indent
);
printf
(
"JSON Array of %l
d element%s:
\n
"
,
size
,
json_plural
(
size
));
printf
(
"JSON Array of %l
ld element%s:
\n
"
,
(
long
long
)
size
,
json_plural
(
size
));
for
(
i
=
0
;
i
<
size
;
i
++
)
{
for
(
i
=
0
;
i
<
size
;
i
++
)
{
print_json_aux
(
json_array_get
(
element
,
i
),
indent
+
2
);
print_json_aux
(
json_array_get
(
element
,
i
),
indent
+
2
);
}
}
...
...
src/lookup3.h
浏览文件 @
cc318fc0
...
@@ -73,7 +73,7 @@ on 1 byte), but shoehorning those bytes into integers efficiently is messy.
...
@@ -73,7 +73,7 @@ on 1 byte), but shoehorning those bytes into integers efficiently is messy.
# define HASH_BIG_ENDIAN 0
# define HASH_BIG_ENDIAN 0
#endif
#endif
#define hashsize(n) ((
uint32
_t)1<<(n))
#define hashsize(n) ((
size
_t)1<<(n))
#define hashmask(n) (hashsize(n)-1)
#define hashmask(n) (hashsize(n)-1)
#define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k))))
#define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k))))
...
...
test/bin/json_process.c
浏览文件 @
cc318fc0
...
@@ -63,7 +63,7 @@ static const char *strip(char *str) {
...
@@ -63,7 +63,7 @@ static const char *strip(char *str) {
}
}
static
char
*
loadfile
(
FILE
*
file
)
{
static
char
*
loadfile
(
FILE
*
file
)
{
long
fsize
,
ret
;
size_t
fsize
,
ret
;
char
*
buf
;
char
*
buf
;
fseek
(
file
,
0
,
SEEK_END
);
fseek
(
file
,
0
,
SEEK_END
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录