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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user