cups icon indicating copy to clipboard operation
cups copied to clipboard

Change options to be an unsigned integer instead of casting to one

Open AZero13 opened this issue 3 years ago • 3 comments

The function that takes options expects an unsigned integer, so marking options as such is a safe bet

AZero13 avatar Sep 12 '22 15:09 AZero13

Need to look at this more closely, but given that only 3 bits are currently used this change is unnecessary.

michaelrsweet avatar Sep 12 '22 16:09 michaelrsweet

It is best for portability though. Especially when the C standard guarantees bitwise operations on unsigned integers to have the expected behavior.

AZero13 avatar Sep 12 '22 16:09 AZero13

Technically, conversion between int and unsigned int can be undefined, even if it won't happen here.

AZero13 avatar Sep 12 '22 16:09 AZero13