|
|
|
@ -30,8 +30,8 @@ __jsonConst(struct BIGPOINT_DYNTYPE * _this, struct json_object * json) |
|
|
|
switch (json_object_get_type(json)) { |
|
|
|
case json_type_int: |
|
|
|
_this->type = BIGPOINT_DYNTYPE_INT; |
|
|
|
_this->size = sizeof(long); |
|
|
|
(_this->data)._int = (long)json_object_get_int(json); |
|
|
|
_this->size = sizeof(int); |
|
|
|
(_this->data)._int = (int)json_object_get_int(json); |
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
@ -56,10 +56,15 @@ __toJson(struct BIGPOINT_DYNTYPE * _this) |
|
|
|
{ |
|
|
|
struct json_object * json = NULL; |
|
|
|
|
|
|
|
/** |
|
|
|
* @TODO: make a smart implementation here base on the type of the |
|
|
|
* actual object. |
|
|
|
*/ |
|
|
|
switch(_this->type) { |
|
|
|
case BIGPOINT_DYNTYPE_INT: |
|
|
|
json = json_object_new_int((_this->data)._int); |
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
json = NULL; |
|
|
|
} |
|
|
|
|
|
|
|
return json; |
|
|
|
} |
|
|
|
|
|
|
|
|