It seemed to me that when using our own scalar types (integer, short, char) or those provided by stdint, there is no consistency and best practice: uint32_t uint16_t uint8_t.
It really beats me up, because drivers are an integral part of the kernel, which should be stable, consistent, stable and good.
Here is an example illustration in gcc (used for the hobby project for raspberries pi):
struct fbinfo {
unsigned width, height;
unsigned vwidth, vheight;
unsigned pitch, bits;
int x, y;
void *ptr;
unsigned size;
} __attribute__((aligned(16)));
struct fbinfo {
uint32_t width, height;
uint32_t vwidth, vheight;
uint32_t pitch, bits;
int32_t x, y;
uint32_t ptr;
uint32_t size;
} __attribute__((aligned(16)));
For me, the first example seems more logical, because this piece of code is intended only for working on raspberry pi. It would be pointless to run this on other equipment.
,
, C .
16 - . uint32_t, uint_fast32_t : . X .
stdint, linux : u32, __u32 endian, , __le32.
typedef'd? stdint.h?