HomeFreeBSD

zio: use unsigned values for enum

Description

zio: use unsigned values for enum

cppcheck complains about the use of 1 << 31, because enums are signed
ints which cannot represent this. As discussed in issue #12611, it
appears that with C99, we can use an unsiged int for the enum, on most
platforms.

I've crafted this commit for just the include/sys/zio.h header, as it's
the only one with a shift of 31. If this is something we want to adopt
in the rest of the project, I will go through and apply it to the rest
of the project.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Jorgen Lundman <lundman@lundman.net>
Signed-off-by: Teodor Spæren <teodor@sparen.no>
Closes #12611
Closes #12615

Details

Provenance
Teodor Spæren <teodor_spaeren@riseup.net>Authored on Oct 11 2021, 5:58 PM
GitHub <noreply@github.com>Committed on Oct 11 2021, 5:58 PM
Parents
rG280d0f0ce45a: Export minimal zfs_refcount interfaces
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rGd785245857b8: zio: use unsigned values for enum (authored by Teodor Spæren <teodor_spaeren@riseup.net>).Oct 11 2021, 5:58 PM