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:
Mike Blumenkrantz 2020-04-16 10:44:03 -04:00 committed by Stefan Schmidt
parent b746e82b07
commit bc52776fd6
1 changed files with 4 additions and 1 deletions

View File

@ -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 tmb = *(struct tm*)b;
time_t ta, tb;
struct timeval tva = {0}, tvb = {0};
ta = mktime(&tma);
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