Fix SHADER_OFFSET_CONT undefined shift

0x1 << 31 is undefined behavior based on C99 rules. (see ...)
Use unsigned syntax as an alternative to disable the warning.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
macos/master
Po-Hsien Wang 6 years ago committed by Dave Airlie
parent 172c9679b4
commit f500a29ae1
  1. 2
      src/virgl_protocol.h

@ -228,7 +228,7 @@ enum virgl_context_cmd {
#define VIRGL_OBJ_SHADER_OFFSET_VAL(x) (((x) & 0x7fffffff) << 0) #define VIRGL_OBJ_SHADER_OFFSET_VAL(x) (((x) & 0x7fffffff) << 0)
/* start contains full length in VAL - also implies continuations */ /* start contains full length in VAL - also implies continuations */
/* continuation contains offset in VAL */ /* continuation contains offset in VAL */
#define VIRGL_OBJ_SHADER_OFFSET_CONT (0x1 << 31) #define VIRGL_OBJ_SHADER_OFFSET_CONT (0x1u << 31)
#define VIRGL_OBJ_SHADER_NUM_TOKENS 4 #define VIRGL_OBJ_SHADER_NUM_TOKENS 4
#define VIRGL_OBJ_SHADER_SO_NUM_OUTPUTS 5 #define VIRGL_OBJ_SHADER_SO_NUM_OUTPUTS 5
#define VIRGL_OBJ_SHADER_SO_STRIDE(x) (6 + (x)) #define VIRGL_OBJ_SHADER_SO_STRIDE(x) (6 + (x))

Loading…
Cancel
Save