/* update enum list */
static void update_enum_list(snd_mixer_elem_t *elem, int chn, int delta)
{
- int eidx;
+ unsigned int eidx;
if (snd_mixer_selem_get_enum_item(elem, chn, &eidx) < 0)
return;
if (delta < 0) {
- eidx--;
- if (eidx < 0)
+ if (eidx == 0)
return;
+ eidx--;
} else {
int items = snd_mixer_selem_get_enum_items(elem);
if (items < 0)
cury = y - 4;
for (ch = 0; ch < 2; ch++) {
- int eidx, ofs;
+ unsigned int eidx, ofs;
char tmp[9];
err = snd_mixer_selem_get_enum_item(elem, ch, &eidx);
if (err < 0)
static int mmap_flag = 0;
static int interleaved = 1;
static int nonblock = 0;
-static char *audiobuf = NULL;
+static u_char *audiobuf = NULL;
static snd_pcm_uframes_t chunk_size = 0;
static unsigned period_time = 0;
static unsigned buffer_time = 0;
chunk_size = 1024;
hwparams = rhwparams;
- audiobuf = (char *)malloc(1024);
+ audiobuf = (u_char *)malloc(1024);
if (audiobuf == NULL) {
error(_("not enough memory"));
return 1;
* helper for test_wavefile
*/
-size_t test_wavefile_read(int fd, char *buffer, size_t *size, size_t reqsize, int line)
+size_t test_wavefile_read(int fd, u_char *buffer, size_t *size, size_t reqsize, int line)
{
if (*size >= reqsize)
return *size;
* == 0 if not
* Value returned is bytes to be discarded.
*/
-static ssize_t test_wavefile(int fd, char *_buffer, size_t size)
+static ssize_t test_wavefile(int fd, u_char *_buffer, size_t size)
{
WaveHeader *h = (WaveHeader *)_buffer;
- char *buffer = NULL;
+ u_char *buffer = NULL;
size_t blimit = 0;
WaveFmtBody *f;
WaveChunkHeader *c;
static void voc_write_silence(unsigned x)
{
unsigned l;
- char *buf;
+ u_char *buf;
- buf = (char *) malloc(chunk_bytes);
+ buf = (u_char *) malloc(chunk_bytes);
if (buf == NULL) {
error(_("can't allocate buffer for silence"));
return; /* not fatal error */