forked from enlightenment/efl
eina/value: use correct time types when comparing time types
these functions all expect struct timeval, as the name implies ../src/lib/eina/eina_value.c: In function ‘_eina_value_type_tm_compare’: ../src/lib/eina/eina_value.c:3358:19: warning: array subscript 1 is outside array bounds of ‘time_t[1]’ {aka ‘long int[1]’} [-Warray-bounds] 3358 | struct timeval ret = *input; | ^~~ ../src/lib/eina/eina_value.c:3569:11: note: while referencing ‘ta’ 3569 | time_t ta, tb; | ^~ ../src/lib/eina/eina_value.c:3358:19: warning: array subscript 1 is outside array bounds of ‘time_t[1]’ {aka ‘long int[1]’} [-Warray-bounds] 3358 | struct timeval ret = *input; | ^~~ ../src/lib/eina/eina_value.c:3569:15: note: while referencing ‘tb’ 3569 | time_t ta, tb; Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org> Differential Revision: https://phab.enlightenment.org/D11715
This commit is contained in:
parent
b746e82b07
commit
bc52776fd6
|
@ -3567,11 +3567,14 @@ _eina_value_type_tm_compare(const Eina_Value_Type *type, const void *a, const vo
|
||||||
struct tm tma = *(struct tm*)a;
|
struct tm tma = *(struct tm*)a;
|
||||||
struct tm tmb = *(struct tm*)b;
|
struct tm tmb = *(struct tm*)b;
|
||||||
time_t ta, tb;
|
time_t ta, tb;
|
||||||
|
struct timeval tva = {0}, tvb = {0};
|
||||||
|
|
||||||
ta = mktime(&tma);
|
ta = mktime(&tma);
|
||||||
tb = mktime(&tmb);
|
tb = mktime(&tmb);
|
||||||
|
tva.tv_sec = ta;
|
||||||
|
tvb.tv_sec = tb;
|
||||||
|
|
||||||
return _eina_value_type_timeval_compare(type, &ta, &tb);
|
return _eina_value_type_timeval_compare(type, &tva, &tvb);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
|
|
Loading…
Reference in New Issue