(4) It's dangerous to assume mir_pixel_format_invalid has a lower integer value than the valid pixel formats:
mir_pixel_format_invalid < format
unless the order is somehow guaranteed by the name. The same is possibly also true about "mir_pixel_formats" if and when we choose to encode more information into the mir_pixel_format_ values.
You can make such assumptions more safely if it's defined as a macro adjacent to the definition of MirPixelFormat. Then you can see both definitions side-by-side and the risk of one regressing independently of the other is much lower.
(4) It's dangerous to assume mir_pixel_ format_ invalid has a lower integer value than the valid pixel formats: pixel_format_ invalid < format
mir_
unless the order is somehow guaranteed by the name. The same is possibly also true about "mir_pixel_formats" if and when we choose to encode more information into the mir_pixel_format_ values.
You can make such assumptions more safely if it's defined as a macro adjacent to the definition of MirPixelFormat. Then you can see both definitions side-by-side and the risk of one regressing independently of the other is much lower.