Changed bool 'is_modified' field to int 'flag' field

Changed bool 'is_modified' field to int 'flag' field
This commit is contained in:
Michael Chen 2015-07-06 11:57:55 -04:00
parent 7e60fbe049
commit 31a17a614e
2 changed files with 4 additions and 5 deletions

View File

@ -50,7 +50,7 @@ typedef enum {
typedef struct json_t {
json_type type;
size_t refcount;
boolean is_modified;
int32_t flag;
} json_t;
#ifndef JANSSON_USING_CMAKE /* disabled if using cmake */
@ -79,7 +79,6 @@ typedef long json_int_t;
#define json_boolean_value json_is_true
#define json_is_boolean(json) (json_is_true(json) || json_is_false(json))
#define json_is_null(json) ((json) && json_typeof(json) == JSON_NULL)
#define json_is_modified(json) ((json)->is_modified)
/* construction, destruction, reference counting */
@ -131,7 +130,7 @@ typedef struct {
/* getters, setters, manipulation */
int json_set_modified(json_t *json_object, bool input);
int json_set_flag(json_t *json, int32_t input);
void json_object_seed(size_t seed);
size_t json_object_size(const json_t *object);

View File

@ -44,9 +44,9 @@ static JSON_INLINE void json_init(json_t *json, json_type type)
}
int json_set_modified(json_t *json_object, bool input)
int json_set_flag(json_t *json, int32_t input)
{
json_object->is_modified = input;
json->flag = input;
}
/*** object ***/