vc4: use intmax_t for formatted output of timespec members

32bit architectures which have 64bit time_t does not fit the assumption
of time_t being same as system long int

Fixes
error: format specifies type 'long' but the argument has type 'time_t' (aka 'long long') [-Werror,-Wformat]
                        time.tv_sec);
                        ^~~~~~~~~~~

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2966>
This commit is contained in:
Khem Raj
2019-12-04 14:15:28 -08:00
committed by Marge Bot
parent c8630fd114
commit e331fd7fc4
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -72,8 +72,8 @@ v3d_bo_dump_stats(struct v3d_screen *screen)
struct timespec time;
clock_gettime(CLOCK_MONOTONIC, &time);
fprintf(stderr, " now: %ld\n",
(long)time.tv_sec);
fprintf(stderr, " now: %jd\n",
(intmax_t)time.tv_sec);
}
}
+2 -2
View File
@@ -99,8 +99,8 @@ vc4_bo_dump_stats(struct vc4_screen *screen)
struct timespec time;
clock_gettime(CLOCK_MONOTONIC, &time);
fprintf(stderr, " now: %ld\n",
(long)time.tv_sec);
fprintf(stderr, " now: %jd\n",
(intmax_t)time.tv_sec);
}
}