]> git.alsa-project.org Git - alsa-utils.git/commitdiff
Fix compile warnings
authorTakashi Iwai <tiwai@suse.de>
Fri, 16 Dec 2005 18:44:14 +0000 (18:44 +0000)
committerTakashi Iwai <tiwai@suse.de>
Fri, 16 Dec 2005 18:44:14 +0000 (18:44 +0000)
Fix trivial compile warnings.

alsamixer/alsamixer.c
aplay/aplay.c
seq/aseqnet/aseqnet.c

index 3f34fdd5371272b8cc5e2f39ebbd09387c640ca1..e2819230504407767fc1fec79311bc6148be5efc 100644 (file)
@@ -538,13 +538,13 @@ mixer_convert_volume(snd_mixer_elem_t *elem,
 /* 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)
@@ -800,7 +800,7 @@ static void display_enum_list(snd_mixer_elem_t *elem, int y, int x)
   
   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)
index 1818d4363b662ee1d066b93827940e2e2118ca7e..b6dcc093e9513274edbe9a5926dd506e6dd37b7d 100644 (file)
@@ -86,7 +86,7 @@ static snd_pcm_stream_t stream = SND_PCM_STREAM_PLAYBACK;
 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;
@@ -564,7 +564,7 @@ int main(int argc, char *argv[])
        chunk_size = 1024;
        hwparams = rhwparams;
 
-       audiobuf = (char *)malloc(1024);
+       audiobuf = (u_char *)malloc(1024);
        if (audiobuf == NULL) {
                error(_("not enough memory"));
                return 1;
@@ -657,7 +657,7 @@ static int test_vocfile(void *buffer)
  * 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;
@@ -682,10 +682,10 @@ size_t test_wavefile_read(int fd, char *buffer, size_t *size, size_t reqsize, in
  *                            == 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;
@@ -1418,9 +1418,9 @@ static ssize_t voc_pcm_write(u_char *data, size_t count)
 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 */
index 9cb61c269f18e63a61504484ecc06461c50c6c07..38de3d992218010b3e4b165bbdef770b990e053f 100644 (file)
@@ -366,7 +366,7 @@ static void start_connection(void)
 {
        struct sockaddr_in addr;
        int i;
-       int addr_len;
+       socklen_t addr_len;
 
        for (i = 0; i < max_connection; i++) {
                if (netfd[i] < 0)