From 1deee4c8024bede820120d9151010769a6814e9f Mon Sep 17 00:00:00 2001 From: lixianjing Date: Sun, 10 Jan 2021 22:57:11 +0800 Subject: [PATCH] fix warnings --- src/tkc/date_time.c | 6 +++--- src/tkc/object_array.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tkc/date_time.c b/src/tkc/date_time.c index fafa3067b..b285a358e 100644 --- a/src/tkc/date_time.c +++ b/src/tkc/date_time.c @@ -197,7 +197,7 @@ ret_t date_time_set_day(date_time_t* dt, uint32_t day) { ret_t date_time_set_hour(date_time_t* dt, uint32_t hour) { return_value_if_fail(dt != NULL, RET_BAD_PARAMS); - return_value_if_fail(hour >=0 && hour < 24, RET_BAD_PARAMS); + return_value_if_fail(hour < 24, RET_BAD_PARAMS); dt->hour = hour; @@ -206,7 +206,7 @@ ret_t date_time_set_hour(date_time_t* dt, uint32_t hour) { ret_t date_time_set_minute(date_time_t* dt, uint32_t minute) { return_value_if_fail(dt != NULL, RET_BAD_PARAMS); - return_value_if_fail(minute >=0 && minute < 60, RET_BAD_PARAMS); + return_value_if_fail(minute < 60, RET_BAD_PARAMS); dt->minute = minute; @@ -215,7 +215,7 @@ ret_t date_time_set_minute(date_time_t* dt, uint32_t minute) { ret_t date_time_set_second(date_time_t* dt, uint32_t second) { return_value_if_fail(dt != NULL, RET_BAD_PARAMS); - return_value_if_fail(second >=0 && second < 60, RET_BAD_PARAMS); + return_value_if_fail(second < 60, RET_BAD_PARAMS); dt->second = second; diff --git a/src/tkc/object_array.c b/src/tkc/object_array.c index 7ccf1f679..004abae26 100644 --- a/src/tkc/object_array.c +++ b/src/tkc/object_array.c @@ -1,4 +1,4 @@ -/** +/** * File: object_array.c * Author: AWTK Develop Team * Brief: object array @@ -146,7 +146,7 @@ ret_t object_array_remove(object_t* obj, uint32_t index) { ret_t ret = RET_NOT_FOUND; object_array_t* o = OBJECT_ARRAY(obj); return_value_if_fail(o != NULL, RET_BAD_PARAMS); - if (index >= 0 && index < o->size) { + if (index < o->size) { value_t* iter = o->props + index; value_reset(iter); ret = object_array_clean_invalid_props(obj); @@ -182,7 +182,7 @@ ret_t object_array_set(object_t* obj, uint32_t index, const value_t* v) { value_t* iter = o->props + index; value_reset(iter); ret = value_deep_copy(iter, v); - } else if (index == -1) { + } else if (index == 0xffffffff) { ret = object_array_push(obj, v); } else { ret = RET_BAD_PARAMS;