summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-04-16 10:44:03 -0400
committerStefan Schmidt <s.schmidt@samsung.com>2020-04-17 11:14:54 +0200
commitbc52776fd621e91fb013fbe31c0a5fdc0da3b20d (patch)
treef949c046b5c72fb3969140ab2d5b6a20ee416fdd
parentb746e82b07000c5a708b9f7eb3790271d3be6641 (diff)
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
-rw-r--r--src/lib/eina/eina_value.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/eina/eina_value.c b/src/lib/eina/eina_value.c
index c18f369006..b71fa7da96 100644
--- a/src/lib/eina/eina_value.c
+++ b/src/lib/eina/eina_value.c
@@ -3567,11 +3567,14 @@ _eina_value_type_tm_compare(const Eina_Value_Type *type, const void *a, const vo
3567 struct tm tma = *(struct tm*)a; 3567 struct tm tma = *(struct tm*)a;
3568 struct tm tmb = *(struct tm*)b; 3568 struct tm tmb = *(struct tm*)b;
3569 time_t ta, tb; 3569 time_t ta, tb;
3570 struct timeval tva = {0}, tvb = {0};
3570 3571
3571 ta = mktime(&tma); 3572 ta = mktime(&tma);
3572 tb = mktime(&tmb); 3573 tb = mktime(&tmb);
3574 tva.tv_sec = ta;
3575 tvb.tv_sec = tb;
3573 3576
3574 return _eina_value_type_timeval_compare(type, &ta, &tb); 3577 return _eina_value_type_timeval_compare(type, &tva, &tvb);
3575} 3578}
3576 3579
3577static Eina_Bool 3580static Eina_Bool