-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add yajl dependency, bt_value_from_json(), and tests #2
Open
eepp
wants to merge
101
commits into
jgalar:plugin_system
Choose a base branch
from
eepp:yajl
base: plugin_system
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
This new header wraps yajl so that Babeltrace code can use yajl 1.x or yajl 2.x transparently. Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
9876044
to
87889f2
Compare
35b873e
to
c853833
Compare
jgalar
pushed a commit
that referenced
this pull request
Aug 29, 2017
Found by Coverity: CID 1376200 (#2 of 2): Inferred misuse of enum (MIXED_ENUMS) mixed_enums: Mixing enum types enum bt_ctf_field_type_id and enum ctf_type_id for ctx_cur_field_type_id. (audited whole file for similar pattern) Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This one adds a dependency on yajl, either 1.x or 2.x (2.x is preferred). The
m4/ax_check_yajl.m4
macro is responsible for checking the available yajl versions.A shim is added (
include/babeltrace/yajl.h
) to support both yajl 1.x and 2.x. There are minor differences between the two versions, in particular some integer types and some function names and parameters. All yajl functions should be used in thebt_
namespace.This shim is used by the new
lib/values-json.c
to implementbt_value_from_json()
, a function which converts a JSON string to a value object using yajl. Signed 64-bit integers are supported thanks to usingsscanf()
instead of using the yajl's integer callback, because the 1.x callback has along
parameter, which would be 32-bit on a 32-bit build.sscanf()
is also used to parse double precision floating point numbers.bt_value_from_json()
is thoroughly tested (61 new tests) intests/lib/test_bt_values.c
.I built Babeltrace and ran the tests successfully, including a Valgrind memcheck, with the following configurations: