pco: fix x86 build

Use inttypes.h when printing variables whose format specifier changes
across different archs.

Fixes: 37d47913
Fixes: e67e4452
Closes: #12238
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Tested-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32492>
This commit is contained in:
Simon Perretta
2024-12-04 23:14:44 +00:00
committed by Marge Bot
parent 43bdc84831
commit e26a383ee8
2 changed files with 5 additions and 3 deletions
+2 -1
View File
@@ -22,6 +22,7 @@
#include "util/u_dynarray.h"
#include <assert.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdint.h>
@@ -240,7 +241,7 @@ static bool pco_ra_func(pco_func *func,
printf("RA overrides:\n");
hash_table_u64_foreach (overrides, entry) {
struct vec_override *override = entry.data;
printf(" %%%lu: ref = ", entry.key);
printf(" %%%" PRIu64 ": ref = ", entry.key);
pco_print_ref(func->parent_shader, override->ref);
printf(", offset = %u\n", override->offset);
}
+3 -2
View File
@@ -16,6 +16,7 @@
#include "util/macros.h"
#include "util/ralloc.h"
#include <inttypes.h>
#include <stdio.h>
enum ref_cursor {
@@ -69,11 +70,11 @@ static void pco_assert(struct val_state *state,
if (state->ref_cursor != REF_CURSOR_NONE) {
switch (state->ref_cursor) {
case REF_CURSOR_INSTR_DEST:
printf(" instr dest #%lu", state->ref - state->instr->dest);
printf(" instr dest #%" PRIuPTR, state->ref - state->instr->dest);
break;
case REF_CURSOR_INSTR_SRC:
printf(" instr src #%lu", state->ref - state->instr->src);
printf(" instr src #%" PRIuPTR, state->ref - state->instr->src);
break;
default: