[print-forces.c:316] -> [print-forces.c:323]: (warning) Shifting 32-bit
value by 32767 bits is undefined behaviour. See condition at line 323.
[print-forces.c:316]: (error) Shifting by a negative value is undefined
behaviour
static inline int op_valid(uint16_t op, uint16_t mask)
{
- int opb = 1 << (op - 1);
-
if (op == 0)
return 0;
- if (opb & mask)
- return 1;
+ if (op <= F_OP_MAX)
+ return (1 << (op - 1)) & mask; /* works only for 0x0001 through 0x0010 */
/* I guess we should allow vendor operations? */
if (op >= 0x8000)
return 1;