cleanup: Use uint*_t instead of u_int*_t everythwere

Use the standard uint{8,16,32,64}_t everywhere instead of the
non-standard u_int{8,16,32,64}_t.

This changes the types in the public headers and removes the u_int*_t
defines. This may break things. However, indentifiers ending with _t are
reserved by POSIX[1]; defining those can lead to undefined behavior.

So if you rely on alsa-lib defining those for you, then you want the
compiler to error so things can be fixed properly.

[1]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_02_02

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Natanael Copa 2017-07-14 16:18:11 +02:00 committed by Takashi Iwai
parent 885c64bcc4
commit adab355f35
11 changed files with 146 additions and 156 deletions

View file

@ -102,7 +102,7 @@ static unsigned int iec958_parity(unsigned int data)
* 31 = parity
*/
static inline u_int32_t iec958_subframe(snd_pcm_iec958_t *iec, u_int32_t data, int channel)
static inline uint32_t iec958_subframe(snd_pcm_iec958_t *iec, uint32_t data, int channel)
{
unsigned int byte = iec->counter >> 3;
unsigned int mask = 1 << (iec->counter - (byte << 3));
@ -132,7 +132,7 @@ static inline u_int32_t iec958_subframe(snd_pcm_iec958_t *iec, u_int32_t data, i
return data;
}
static inline int32_t iec958_to_s32(snd_pcm_iec958_t *iec, u_int32_t data)
static inline int32_t iec958_to_s32(snd_pcm_iec958_t *iec, uint32_t data)
{
if (iec->byteswap)
data = bswap_32(data);
@ -155,7 +155,7 @@ static void snd_pcm_iec958_decode(snd_pcm_iec958_t *iec,
void *put = put32_labels[iec->getput_idx];
unsigned int channel;
for (channel = 0; channel < channels; ++channel) {
const u_int32_t *src;
const uint32_t *src;
char *dst;
int src_step, dst_step;
snd_pcm_uframes_t frames1;
@ -163,7 +163,7 @@ static void snd_pcm_iec958_decode(snd_pcm_iec958_t *iec,
const snd_pcm_channel_area_t *dst_area = &dst_areas[channel];
src = snd_pcm_channel_area_addr(src_area, src_offset);
dst = snd_pcm_channel_area_addr(dst_area, dst_offset);
src_step = snd_pcm_channel_area_step(src_area) / sizeof(u_int32_t);
src_step = snd_pcm_channel_area_step(src_area) / sizeof(uint32_t);
dst_step = snd_pcm_channel_area_step(dst_area);
frames1 = frames;
while (frames1-- > 0) {
@ -195,7 +195,7 @@ static void snd_pcm_iec958_encode(snd_pcm_iec958_t *iec,
int counter = iec->counter;
for (channel = 0; channel < channels; ++channel) {
const char *src;
u_int32_t *dst;
uint32_t *dst;
int src_step, dst_step;
snd_pcm_uframes_t frames1;
const snd_pcm_channel_area_t *src_area = &src_areas[channel];
@ -203,7 +203,7 @@ static void snd_pcm_iec958_encode(snd_pcm_iec958_t *iec,
src = snd_pcm_channel_area_addr(src_area, src_offset);
dst = snd_pcm_channel_area_addr(dst_area, dst_offset);
src_step = snd_pcm_channel_area_step(src_area);
dst_step = snd_pcm_channel_area_step(dst_area) / sizeof(u_int32_t);
dst_step = snd_pcm_channel_area_step(dst_area) / sizeof(uint32_t);
frames1 = frames;
iec->counter = counter;
while (frames1-- > 0) {