Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-alsa-utils: Commit

external/alsa-utils


Commit MetaInfo

Revisión80fd81f4a8647fe2b62a02db9a497d2a7639d9e3 (tree)
Tiempo2019-11-21 03:46:17
AutorRosen Penev <rosenp@gmai...>
CommiterTakashi Iwai

Log Message

treewide: Fix printf formats

Found with cppcheck

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

Cambiar Resumen

Diferencia

--- a/alsactl/init_parse.c
+++ b/alsactl/init_parse.c
@@ -187,7 +187,7 @@ static int init_space(struct space **space, int card)
187187 return -ENOMEM;
188188 res->ctl_id_changed = ~0;
189189 res->linenum = -1;
190- sprintf(device, "hw:%u", card);
190+ sprintf(device, "hw:%d", card);
191191 err = snd_hctl_open(&res->ctl_handle, device, 0);
192192 if (err < 0)
193193 goto error;
@@ -734,7 +734,7 @@ dbvalue:
734734 elem = snd_hctl_elem_next(elem);
735735 }
736736 snd_ctl_elem_id_free(id);
737- sprintf(res, "%u", index);
737+ sprintf(res, "%d", index);
738738 dbg("do_ctl_count found %s controls", res);
739739 return res;
740740 }
--- a/alsaloop/pcmjob.c
+++ b/alsaloop/pcmjob.c
@@ -120,7 +120,7 @@ static int setparams_stream(struct loopback_handle *lhandle,
120120 }
121121 err = snd_pcm_hw_params_set_rate_resample(handle, params, lhandle->resample);
122122 if (err < 0) {
123- logit(LOG_CRIT, "Resample setup failed for %s (val %i): %s\n", lhandle->id, lhandle->resample, snd_strerror(err));
123+ logit(LOG_CRIT, "Resample setup failed for %s (val %u): %s\n", lhandle->id, lhandle->resample, snd_strerror(err));
124124 return err;
125125 }
126126 err = snd_pcm_hw_params_set_access(handle, params, lhandle->access);
@@ -135,13 +135,13 @@ static int setparams_stream(struct loopback_handle *lhandle,
135135 }
136136 err = snd_pcm_hw_params_set_channels(handle, params, lhandle->channels);
137137 if (err < 0) {
138- logit(LOG_CRIT, "Channels count (%i) not available for %s: %s\n", lhandle->channels, lhandle->id, snd_strerror(err));
138+ logit(LOG_CRIT, "Channels count (%u) not available for %s: %s\n", lhandle->channels, lhandle->id, snd_strerror(err));
139139 return err;
140140 }
141141 rrate = lhandle->rate_req;
142142 err = snd_pcm_hw_params_set_rate_near(handle, params, &rrate, 0);
143143 if (err < 0) {
144- logit(LOG_CRIT, "Rate %iHz not available for %s: %s\n", lhandle->rate_req, lhandle->id, snd_strerror(err));
144+ logit(LOG_CRIT, "Rate %uHz not available for %s: %s\n", lhandle->rate_req, lhandle->id, snd_strerror(err));
145145 return err;
146146 }
147147 rrate = 0;
@@ -152,7 +152,7 @@ static int setparams_stream(struct loopback_handle *lhandle,
152152 !lhandle->loopback->src_enable &&
153153 #endif
154154 (int)rrate != lhandle->rate) {
155- logit(LOG_CRIT, "Rate does not match (requested %iHz, got %iHz, resample %i)\n", lhandle->rate, rrate, lhandle->resample);
155+ logit(LOG_CRIT, "Rate does not match (requested %uHz, got %uHz, resample %u)\n", lhandle->rate, rrate, lhandle->resample);
156156 return -EINVAL;
157157 }
158158 lhandle->pitch = (double)lhandle->rate_req / (double)lhandle->rate;
@@ -1613,7 +1613,7 @@ __again:
16131613 if (count > loop->play->buffer_size)
16141614 count = loop->play->buffer_size;
16151615 if (err != count) {
1616- logit(LOG_CRIT, "%s: initial playback fill error (%i/%i/%i)\n", loop->id, err, (int)count, loop->play->buffer_size);
1616+ logit(LOG_CRIT, "%s: initial playback fill error (%i/%i/%u)\n", loop->id, err, (int)count, loop->play->buffer_size);
16171617 err = -EIO;
16181618 goto __error;
16191619 }
--- a/amixer/amixer.c
+++ b/amixer/amixer.c
@@ -465,7 +465,7 @@ static void decode_tlv(unsigned int spaces, unsigned int *tlv, unsigned int tlv_
465465 size = tlv[idx++];
466466 tlv_size -= 2 * sizeof(unsigned int);
467467 if (size > tlv_size) {
468- printf("TLV size error (%i, %i, %i)!\n", type, size, tlv_size);
468+ printf("TLV size error (%u, %u, %u)!\n", type, size, tlv_size);
469469 return;
470470 }
471471 switch (type) {
@@ -576,7 +576,7 @@ static void decode_tlv(unsigned int spaces, unsigned int *tlv, unsigned int tlv_
576576 break;
577577 #endif
578578 default:
579- printf("unk-%i-", type);
579+ printf("unk-%u-", type);
580580 while (size > 0) {
581581 printf("0x%08x,", tlv[idx++]);
582582 size -= sizeof(unsigned int);
@@ -611,7 +611,7 @@ static int show_control(const char *space, snd_hctl_elem_t *elem,
611611 }
612612 count = snd_ctl_elem_info_get_count(info);
613613 type = snd_ctl_elem_info_get_type(info);
614- printf("%s; type=%s,access=%s,values=%i", space, control_type(info), control_access(info), count);
614+ printf("%s; type=%s,access=%s,values=%u", space, control_type(info), control_access(info), count);
615615 switch (type) {
616616 case SND_CTL_ELEM_TYPE_INTEGER:
617617 printf(",min=%li,max=%li,step=%li\n",
--- a/aplay/aplay.c
+++ b/aplay/aplay.c
@@ -3346,7 +3346,7 @@ static void playbackv(char **names, unsigned int count)
33463346 }
33473347 alloced = 1;
33483348 } else if (count != channels) {
3349- error(_("You need to specify %d files"), channels);
3349+ error(_("You need to specify %u files"), channels);
33503350 prg_exit(EXIT_FAILURE);
33513351 }
33523352
--- a/axfer/subcmd-list.c
+++ b/axfer/subcmd-list.c
@@ -31,7 +31,7 @@ static int dump_device(snd_ctl_t *handle, const char *id, const char *name,
3131 snd_pcm_info_get_name(info));
3232
3333 count = snd_pcm_info_get_subdevices_count(info);
34- printf(" Subdevices: %i/%i\n",
34+ printf(" Subdevices: %i/%u\n",
3535 snd_pcm_info_get_subdevices_avail(info), count);
3636
3737 for (i = 0; i < count; ++i) {
--- a/axfer/xfer-libffado.c
+++ b/axfer/xfer-libffado.c
@@ -440,7 +440,7 @@ static int xfer_libffado_pre_process(struct xfer_context *xfer,
440440 }
441441 if (*samples_per_frame != channels) {
442442 fprintf(stderr,
443- "The number of samples per frame should be %i.\n",
443+ "The number of samples per frame should be %u.\n",
444444 channels);
445445 return -EINVAL;
446446 }
--- a/axfer/xfer-options.c
+++ b/axfer/xfer-options.c
@@ -238,7 +238,7 @@ static int validate_options(struct xfer_context *xfer)
238238 xfer->frames_per_second *= 1000;
239239 if (xfer->frames_per_second < 2000 ||
240240 xfer->frames_per_second > 192000) {
241- fprintf(stderr, "bad speed value '%i'\n", val);
241+ fprintf(stderr, "bad speed value '%u'\n", val);
242242 return -EINVAL;
243243 }
244244
Show on old repository browser