Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
json: add get_object API and fix str init
- Loading branch information
Emmanuel Schmidbauer
committed
Jan 29, 2018
1 parent
d40c65a
commit 5fe8618
Showing
2 changed files
with
6 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5fe8618
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the code I think it is better to change the prototype of:
to:
Now it returns a variable declared on the stack, which could work with recent compilers, being returned by value.
str
itself is not a large structure, but returning structure values is not recommended in C, code analyzers complain about (same for passing a structure value as parameter -- it is recommended to use pointers).5fe8618
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 im on it