change pa_log() and friends to not require a trailing \n on all logged strings

git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@574 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2006-02-23 02:27:19 +00:00
parent cb59817b4a
commit 4a64b0d116
74 changed files with 558 additions and 532 deletions

View file

@ -51,7 +51,7 @@ int pa_oss_open(const char *device, int *mode, int* pcaps) {
tcaps = pcaps ? pcaps : &dcaps;
if (ioctl(fd, SNDCTL_DSP_GETCAPS, tcaps) < 0) {
pa_log(__FILE__": SNDCTL_DSP_GETCAPS: %s\n", strerror(errno));
pa_log(__FILE__": SNDCTL_DSP_GETCAPS: %s", strerror(errno));
goto fail;
}
@ -63,20 +63,20 @@ int pa_oss_open(const char *device, int *mode, int* pcaps) {
if ((fd = open(device, (*mode = O_WRONLY)|O_NDELAY)) < 0) {
if ((fd = open(device, (*mode = O_RDONLY)|O_NDELAY)) < 0) {
pa_log(__FILE__": open('%s'): %s\n", device, strerror(errno));
pa_log(__FILE__": open('%s'): %s", device, strerror(errno));
goto fail;
}
}
} else {
if ((fd = open(device, *mode|O_NDELAY)) < 0) {
pa_log(__FILE__": open('%s'): %s\n", device, strerror(errno));
pa_log(__FILE__": open('%s'): %s", device, strerror(errno));
goto fail;
}
}
if (pcaps) {
if (ioctl(fd, SNDCTL_DSP_GETCAPS, pcaps) < 0) {
pa_log(__FILE__": SNDCTL_DSP_GETCAPS: %s\n", strerror(errno));
pa_log(__FILE__": SNDCTL_DSP_GETCAPS: %s", strerror(errno));
goto fail;
}
}
@ -114,7 +114,7 @@ int pa_oss_auto_format(int fd, pa_sample_spec *ss) {
if (ioctl(fd, SNDCTL_DSP_SETFMT, &format) < 0 || format != f) {
format = AFMT_U8;
if (ioctl(fd, SNDCTL_DSP_SETFMT, &format) < 0 || format != AFMT_U8) {
pa_log(__FILE__": SNDCTL_DSP_SETFMT: %s\n", format != AFMT_U8 ? "No supported sample format" : strerror(errno));
pa_log(__FILE__": SNDCTL_DSP_SETFMT: %s", format != AFMT_U8 ? "No supported sample format" : strerror(errno));
return -1;
} else
ss->format = PA_SAMPLE_U8;
@ -126,7 +126,7 @@ int pa_oss_auto_format(int fd, pa_sample_spec *ss) {
channels = ss->channels;
if (ioctl(fd, SNDCTL_DSP_CHANNELS, &channels) < 0) {
pa_log(__FILE__": SNDCTL_DSP_CHANNELS: %s\n", strerror(errno));
pa_log(__FILE__": SNDCTL_DSP_CHANNELS: %s", strerror(errno));
return -1;
}
assert(channels);
@ -134,7 +134,7 @@ int pa_oss_auto_format(int fd, pa_sample_spec *ss) {
speed = ss->rate;
if (ioctl(fd, SNDCTL_DSP_SPEED, &speed) < 0) {
pa_log(__FILE__": SNDCTL_DSP_SPEED: %s\n", strerror(errno));
pa_log(__FILE__": SNDCTL_DSP_SPEED: %s", strerror(errno));
return -1;
}
assert(speed);
@ -160,7 +160,7 @@ int pa_oss_set_fragments(int fd, int nfrags, int frag_size) {
arg = ((int) nfrags << 16) | simple_log2(frag_size);
if (ioctl(fd, SNDCTL_DSP_SETFRAGMENT, &arg) < 0) {
pa_log(__FILE__": SNDCTL_DSP_SETFRAGMENT: %s\n", strerror(errno));
pa_log(__FILE__": SNDCTL_DSP_SETFRAGMENT: %s", strerror(errno));
return -1;
}
@ -183,7 +183,7 @@ int pa_oss_get_volume(int fd, const pa_sample_spec *ss, pa_cvolume *volume) {
if ((volume->channels = ss->channels) >= 2)
volume->values[1] = (((vol >> 8) & 0xFF) * PA_VOLUME_NORM) / 100;
pa_log_debug(__FILE__": Read mixer settings: %s\n", pa_cvolume_snprint(cv, sizeof(cv), volume));
pa_log_debug(__FILE__": Read mixer settings: %s", pa_cvolume_snprint(cv, sizeof(cv), volume));
return 0;
}
@ -199,7 +199,7 @@ int pa_oss_set_volume(int fd, const pa_sample_spec *ss, const pa_cvolume *volume
if (ioctl(fd, SOUND_MIXER_WRITE_PCM, &vol) < 0)
return -1;
pa_log_debug(__FILE__": Wrote mixer settings: %s\n", pa_cvolume_snprint(cv, sizeof(cv), volume));
pa_log_debug(__FILE__": Wrote mixer settings: %s", pa_cvolume_snprint(cv, sizeof(cv), volume));
return 0;
}
@ -228,7 +228,7 @@ int pa_oss_get_hw_description(const char *dev, char *name, size_t l) {
!(f = fopen("/proc/asound/oss/sndstat", "r"))) {
if (errno != ENOENT)
pa_log_warn(__FILE__": failed to open OSS sndstat device: %s\n", strerror(errno));
pa_log_warn(__FILE__": failed to open OSS sndstat device: %s", strerror(errno));
return -1;
}