I am trying to set a color to either foreground or background (fg / bg) according to a mask.
uint8_t bitmap, mask, bg, fg = <whatever>;
This code works:
uint8_t color = bg;
if (bitmap & mask)
{
color = fg;
}
This code works too but throws a warning: (373) implicit signed to unsigned conversion
uint8_t color = (bitmap & mask) ? fg : bg;
Can anyone explain why? I am using Microchip XC8 2.30.