summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-08-05 17:18:54 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-08-05 17:18:54 +0100
commitd8f7f933bc2d30e529730521d5628c10df0361de (patch)
treeec9a7c42b06af569145e89fc9269b4c7c1e3fd9c
parent4d0a259988f67f5c569c5d8000c010a7b662efd3 (diff)
sna: Format markup to suppress compiler warning
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/brw/brw_disasm.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/sna/brw/brw_disasm.c b/src/sna/brw/brw_disasm.c
index 106eed33..e6da1745 100644
--- a/src/sna/brw/brw_disasm.c
+++ b/src/sna/brw/brw_disasm.c
@@ -415,6 +415,9 @@ static int string(FILE *file, const char *str)
return 0;
}
+#if defined(__GNUC__) && (__GNUC__ > 2)
+__attribute__((format(printf, 2, 3)))
+#endif
static int format(FILE *f, const char *fmt, ...)
{
char buf[1024];
@@ -833,10 +836,10 @@ void brw_disasm(FILE *file, const struct brw_instruction *inst, int gen)
int space = 0;
format(file, "%08x %08x %08x %08x\n",
- ((uint32_t*)inst)[0],
- ((uint32_t*)inst)[1],
- ((uint32_t*)inst)[2],
- ((uint32_t*)inst)[3]);
+ ((const uint32_t*)inst)[0],
+ ((const uint32_t*)inst)[1],
+ ((const uint32_t*)inst)[2],
+ ((const uint32_t*)inst)[3]);
if (inst->header.predicate_control) {
string(file, "(");