SCP: Add parenthesis to avoid potential compiler warnings

This commit is contained in:
Ken Rector 2022-07-01 07:13:22 -10:00 committed by Mark Pizzolato
parent 254057289f
commit 755cb9ccff

8
scp.c
View file

@ -9979,21 +9979,21 @@ ptr = ((char *) rptr->loc) + (idx * rptr->stride); /* point at the starting
if (rptr->size == sizeof (uint8)) /* store the value */ if (rptr->size == sizeof (uint8)) /* store the value */
*((uint8 *) ptr) = /* using a size */ *((uint8 *) ptr) = /* using a size */
(uint8) (*((uint8 *) ptr) & mask | val); /* appropriate to */ ((uint8) (*((uint8 *) ptr) & mask) | val); /* appropriate to */
/* the size of */ /* the size of */
else else
if (rptr->size == sizeof (uint16)) /* the underlying type */ if (rptr->size == sizeof (uint16)) /* the underlying type */
*((uint16 *) ptr) = *((uint16 *) ptr) =
(uint16) (*((uint16 *) ptr) & mask | val); ((uint16) (*((uint16 *) ptr) & mask) | val);
else else
if (rptr->size == sizeof (uint32)) if (rptr->size == sizeof (uint32))
*((uint32 *) ptr) = *((uint32 *) ptr) =
(uint32) (*((uint32 *) ptr) & mask | val); ((uint32) (*((uint32 *) ptr) & mask) | val);
else /* if the element size is non-standard */ else /* if the element size is non-standard */
*((t_value *) ptr) = /* then access using the largest size permitted */ *((t_value *) ptr) = /* then access using the largest size permitted */
*((t_value *) ptr) & mask | val; (*((t_value *) ptr) & mask) | val;
if ((!(sim_switches & SWMASK ('Z'))) && if ((!(sim_switches & SWMASK ('Z'))) &&
(rptr->flags & REG_DEPOSIT) && sim_vm_reg_update) (rptr->flags & REG_DEPOSIT) && sim_vm_reg_update)