Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
json-editor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IOPSYS
json-editor
Commits
fe08bb9d
Commit
fe08bb9d
authored
5 years ago
by
Jakob Olsson
Browse files
Options
Downloads
Patches
Plain Diff
resolve a few compile warnings
parent
115d4ee5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/json-editor.c
+5
-4
5 additions, 4 deletions
src/json-editor.c
with
5 additions
and
4 deletions
src/json-editor.c
+
5
−
4
View file @
fe08bb9d
...
@@ -14,7 +14,8 @@
...
@@ -14,7 +14,8 @@
static
char
*
get_file
(
const
char
*
path
)
static
char
*
get_file
(
const
char
*
path
)
{
{
FILE
*
f
;
FILE
*
f
;
size_t
len
,
nread
;
size_t
nread
;
long
int
len
;
char
*
buffer
;
char
*
buffer
;
f
=
fopen
(
path
,
"r"
);
f
=
fopen
(
path
,
"r"
);
...
@@ -175,7 +176,7 @@ static struct json_object *dummy_val(char *val, enum json_type type)
...
@@ -175,7 +176,7 @@ static struct json_object *dummy_val(char *val, enum json_type type)
* Should the key not be an array, it will be converted to an array and appropriate indexes will be prepared.
* Should the key not be an array, it will be converted to an array and appropriate indexes will be prepared.
*
*
*/
*/
static
int
iterate_array
(
struct
json_object
*
src
,
int
*
idx
,
int
len
,
struct
json_object
*
j_val
,
enum
json_type
type
,
char
*
key
)
static
int
iterate_array
(
struct
json_object
*
src
,
int
*
idx
,
int
len
,
struct
json_object
*
j_val
,
char
*
key
)
{
{
struct
json_object
*
val
;
struct
json_object
*
val
;
...
@@ -267,7 +268,7 @@ static int add_val(struct json_object *src, char *key, char *val, enum json_type
...
@@ -267,7 +268,7 @@ static int add_val(struct json_object *src, char *key, char *val, enum json_type
copy_object_into_object
(
j_val
,
src
);
copy_object_into_object
(
j_val
,
src
);
}
else
}
else
iterate_array
(
src
,
idx
,
len
,
j_val
,
type
,
parsed_key
);
iterate_array
(
src
,
idx
,
len
,
j_val
,
parsed_key
);
goto
out
;
goto
out
;
}
}
...
@@ -276,7 +277,7 @@ static int add_val(struct json_object *src, char *key, char *val, enum json_type
...
@@ -276,7 +277,7 @@ static int add_val(struct json_object *src, char *key, char *val, enum json_type
if
(
len
<
1
||
type
==
json_type_array
)
if
(
len
<
1
||
type
==
json_type_array
)
json_object_object_add
(
src
,
parsed_key
,
j_val
);
json_object_object_add
(
src
,
parsed_key
,
j_val
);
else
{
else
{
iterate_array
(
src
,
idx
,
len
,
j_val
,
type
,
parsed_key
);
iterate_array
(
src
,
idx
,
len
,
j_val
,
parsed_key
);
}
}
out:
out:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment