Travis reports that Clang objects to integer truncation during assignments to
a bitfield:
./x86_emulate/x86_emulate.c:6150:19: error: implicit truncation from 'int'
to bitfield changes value from -1 to 15 [-Werror,-Wbitfield-constant-conversion]
pxop->reg = ~0; /* rAX */
^ ~~
Use 0xf instead.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
*pvex = vex;
pvex->b = 1;
pvex->r = 1;
- pvex->reg = ~0; /* rAX */
+ pvex->reg = 0xf; /* rAX */
buf[3] = b;
buf[4] = 0x09; /* reg=rCX r/m=(%rCX) */
buf[5] = 0xc3;
*pvex = vex;
pvex->b = 1;
pvex->r = 1;
- pvex->reg = ~0; /* rAX */
+ pvex->reg = 0xf; /* rAX */
buf[3] = b;
buf[4] = (modrm & 0x38) | 0x01; /* r/m=(%rCX) */
buf[5] = 0xc3;
*pxop = vex;
pxop->b = 1;
pxop->r = 1;
- pxop->reg = ~0; /* rAX */
+ pxop->reg = 0xf; /* rAX */
buf[3] = b;
buf[4] = (modrm & 0x38) | 0x01; /* r/m=(%rCX) */
buf[5] = 0xc3;