Andrew Geissler | 706d5aa | 2021-02-12 15:55:30 -0600 | [diff] [blame^] | 1 | From 281a636353666bfdd373c62591e744087e750e89 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Wed, 4 Dec 2019 14:15:28 -0800 |
| 4 | Subject: [PATCH] vc4: use intmax_t for formatted output of timespec members |
| 5 | |
| 6 | 32bit architectures which have 64bit time_t does not fit the assumption |
| 7 | of time_t being same as system long int |
| 8 | |
| 9 | Fixes |
| 10 | error: format specifies type 'long' but the argument has type 'time_t' (aka 'long long') [-Werror,-Wformat] |
| 11 | time.tv_sec); |
| 12 | ^~~~~~~~~~~ |
| 13 | |
| 14 | Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2966] |
| 15 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 16 | |
| 17 | --- |
| 18 | src/gallium/drivers/v3d/v3d_bufmgr.c | 4 ++-- |
| 19 | src/gallium/drivers/vc4/vc4_bufmgr.c | 4 ++-- |
| 20 | 2 files changed, 4 insertions(+), 4 deletions(-) |
| 21 | |
| 22 | diff --git a/src/gallium/drivers/v3d/v3d_bufmgr.c b/src/gallium/drivers/v3d/v3d_bufmgr.c |
| 23 | index 31a0803..cc2e2af 100644 |
| 24 | --- a/src/gallium/drivers/v3d/v3d_bufmgr.c |
| 25 | +++ b/src/gallium/drivers/v3d/v3d_bufmgr.c |
| 26 | @@ -80,8 +80,8 @@ v3d_bo_dump_stats(struct v3d_screen *screen) |
| 27 | |
| 28 | struct timespec time; |
| 29 | clock_gettime(CLOCK_MONOTONIC, &time); |
| 30 | - fprintf(stderr, " now: %ld\n", |
| 31 | - (long)time.tv_sec); |
| 32 | + fprintf(stderr, " now: %jd\n", |
| 33 | + (intmax_t)time.tv_sec); |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | diff --git a/src/gallium/drivers/vc4/vc4_bufmgr.c b/src/gallium/drivers/vc4/vc4_bufmgr.c |
| 38 | index a786e8e..975d49e 100644 |
| 39 | --- a/src/gallium/drivers/vc4/vc4_bufmgr.c |
| 40 | +++ b/src/gallium/drivers/vc4/vc4_bufmgr.c |
| 41 | @@ -99,8 +99,8 @@ vc4_bo_dump_stats(struct vc4_screen *screen) |
| 42 | |
| 43 | struct timespec time; |
| 44 | clock_gettime(CLOCK_MONOTONIC, &time); |
| 45 | - fprintf(stderr, " now: %ld\n", |
| 46 | - (long)time.tv_sec); |
| 47 | + fprintf(stderr, " now: %jd\n", |
| 48 | + (intmax_t)time.tv_sec); |
| 49 | } |
| 50 | } |
| 51 | |