i965: Move next_offset() to brw_eu.h for use elsewhere.
authorMatt Turner <mattst88@gmail.com>
Sat, 17 May 2014 20:00:12 +0000 (13:00 -0700)
committerMatt Turner <mattst88@gmail.com>
Sun, 25 May 2014 06:03:23 +0000 (23:03 -0700)
Also perform arithmetic on char* rather than void* since the latter is a
GNU C extension not available in C++.

Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_eu.h
src/mesa/drivers/dri/i965/brw_eu_emit.c

index 8ce31a1d3b97ed27817a79399ac43bbf684825b1..3c89365e3a4a72a60cf8a3cd1d60b38355e6df05 100644 (file)
@@ -424,6 +424,18 @@ void brw_debug_compact_uncompact(struct brw_context *brw,
                                 struct brw_instruction *orig,
                                 struct brw_instruction *uncompacted);
 
+static inline int
+next_offset(void *store, int offset)
+{
+   struct brw_instruction *insn =
+      (struct brw_instruction *)((char *)store + offset);
+
+   if (insn->header.cmpt_control)
+      return offset + 8;
+   else
+      return offset + 16;
+}
+
 #ifdef __cplusplus
 }
 #endif
index a357d5d6aab212fb2dbb565cdc2813940233407a..38d327afc720f0cb7a952dd77a788d093cb5dde8 100644 (file)
@@ -2382,17 +2382,6 @@ void brw_urb_WRITE(struct brw_compile *p,
                       swizzle);
 }
 
-static int
-next_offset(void *store, int offset)
-{
-   struct brw_instruction *insn = (void *)store + offset;
-
-   if (insn->header.cmpt_control)
-      return offset + 8;
-   else
-      return offset + 16;
-}
-
 static int
 brw_find_next_block_end(struct brw_compile *p, int start_offset)
 {