Commit 00c2ff8d authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Remove fixed-size clzXX()

parent 4f58c049
......@@ -485,10 +485,6 @@ VLC_USED static inline int clzbits(unsigned long long x, int maxbits)
# endif
#endif
#define clz8(x) clz((uint8_t)(x))
#define clz16(x) clz((uint16_t)(x))
#define clz32(x) clz((uint32_t)(x))
/** Count trailing zeroes */
VLC_USED
static inline unsigned (ctz)(unsigned x)
......
......@@ -219,7 +219,7 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
aout_FormatPrepare (fmt);
/* Select timing */
unsigned bytes;
uint32_t bytes;
if (spdif)
bytes = AOUT_SPDIF_SIZE;
else
......@@ -229,7 +229,7 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
bytes = 16;
int frag = (AOUT_MAX_ADVANCE_TIME / AOUT_MIN_PREPARE_TIME) << 16
| (32 - clz32(bytes - 1));
| (32 - clz(bytes - 1));
if (ioctl (fd, SNDCTL_DSP_SETFRAGMENT, &frag) < 0)
msg_Err (aout, "cannot set 0x%08x fragment: %s", frag,
vlc_strerror_c(errno));
......
......@@ -121,7 +121,7 @@ size_t vlc_towc (const char *str, uint32_t *restrict pwc)
if (unlikely(c > 0xF4))
return -1;
int charlen = clz8 (c ^ 0xFF);
int charlen = clz((unsigned char)(c ^ 0xFF));
switch (charlen)
{
case 0: // 7-bit ASCII character -> short cut
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment