summaryrefslogtreecommitdiffstats
path: root/src/steering_wheel_json.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/steering_wheel_json.c')
-rw-r--r--src/steering_wheel_json.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/steering_wheel_json.c b/src/steering_wheel_json.c
index 4377a72..9c7145b 100644
--- a/src/steering_wheel_json.c
+++ b/src/steering_wheel_json.c
@@ -76,7 +76,7 @@ static int parse_propertys(json_object *obj_propertys)
enum json_type type = json_object_get_type(obj_propertys);
if (type == json_type_array)
{
- int array_len = json_object_array_length(obj_propertys);
+ int array_len = (int)json_object_array_length(obj_propertys);
if(array_len > DEFAULT_PROP_CNT)
{
wheel_info = realloc(wheel_info, sizeof(struct wheel_info_t) + ((size_t)array_len * sizeof(struct prop_info_t)));
@@ -91,7 +91,7 @@ static int parse_propertys(json_object *obj_propertys)
for (int i = 0; i < array_len; i++)
{
- obj_property = json_object_array_get_idx(obj_propertys, i);
+ obj_property = json_object_array_get_idx(obj_propertys, (size_t)i);
err = parse_property(wheel_info, i, obj_property);
}
@@ -182,11 +182,11 @@ static int parse_gear_para_json(json_object *obj)
enum json_type type = json_object_get_type(val);
if (type == json_type_array)
{
- int array_len = json_object_array_length(val);
+ int array_len = (int)json_object_array_length(val);
NOTICEMSG("array_len:%d!", array_len);
for (int i = 0; i < array_len; i++)
{
- obj_speed_para = json_object_array_get_idx(val, i);
+ obj_speed_para = json_object_array_get_idx(val, (size_t)i);
if(obj_speed_para)
{
json_object_object_foreach(obj_speed_para, key, val)