Skip to content

Commit

Permalink
Best arrangement of json_integer_value_pointer()
Browse files Browse the repository at this point in the history
  • Loading branch information
niyamaka committed Oct 6, 2023
1 parent dd99140 commit 7b57b1d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/jansson.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ size_t json_string_length(const json_t *string);
json_int_t json_integer_value(const json_t *integer);
double json_real_value(const json_t *real);
double json_number_value(const json_t *json);

json_int_t *json_integer_value_pointer(const json_t *integer);

int json_string_set(json_t *string, const char *value);
Expand Down
10 changes: 5 additions & 5 deletions src/value.c
Original file line number Diff line number Diff line change
Expand Up @@ -900,17 +900,17 @@ json_t *json_integer(json_int_t value) {
return &integer->json;
}

json_int_t *json_integer_value_pointer(const json_t *json) {
json_int_t json_integer_value(const json_t *json) {
if (!json_is_integer(json))
return 0;
return &(json_to_integer(json)->value);

return json_to_integer(json)->value;
}

json_int_t json_integer_value(const json_t *json) {
json_int_t *json_integer_value_pointer(const json_t *json) {
if (!json_is_integer(json))
return 0;

return json_to_integer(json)->value;
return &(json_to_integer(json)->value);
}

int json_integer_set(json_t *json, json_int_t value) {
Expand Down

0 comments on commit 7b57b1d

Please sign in to comment.