[pulseaudio-discuss] [PATCH 1/3] Remove newline at end of log messages

Peter Meerwald-Stadler pmeerw at pmeerw.net
Tue Aug 16 05:47:43 UTC 2016


Signed-off-by: Peter Meerwald-Stadler <pmeerw at pmeerw.net>
---
 src/daemon/main.c                            | 14 +++++++-------
 src/modules/alsa/alsa-util.c                 | 16 ++++++++--------
 src/modules/bluetooth/backend-native.c       |  2 +-
 src/modules/bluetooth/bluez4-util.c          |  2 +-
 src/modules/bluetooth/module-bluez4-device.c |  2 +-
 src/modules/xen/module-xenpv-sink.c          | 28 ++++++++++++++--------------
 src/pulsecore/core-util.c                    |  6 +++---
 src/pulsecore/macro.h                        |  4 ++--
 src/pulsecore/shm.c                          |  2 +-
 src/tests/cpu-mix-test.c                     |  2 +-
 src/tests/cpu-remap-test.c                   |  4 ++--
 src/tests/cpu-volume-test.c                  |  2 +-
 src/tests/interpol-test.c                    |  2 +-
 src/tests/lfe-filter-test.c                  |  4 ++--
 src/tests/lo-test-util.c                     | 20 ++++++++++----------
 src/tests/mix-test.c                         |  2 +-
 src/tests/remix-test.c                       |  2 +-
 src/tests/utf8-test.c                        |  6 +++---
 18 files changed, 60 insertions(+), 60 deletions(-)

diff --git a/src/daemon/main.c b/src/daemon/main.c
index 28bbf52..a313dc5 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -550,7 +550,7 @@ int main(int argc, char *argv[]) {
         case PA_CMD_DUMP_CONF: {
 
             if (d < argc) {
-                pa_log("Too many arguments.\n");
+                pa_log("Too many arguments.");
                 goto finish;
             }
 
@@ -565,7 +565,7 @@ int main(int argc, char *argv[]) {
             int i;
 
             if (d < argc) {
-                pa_log("Too many arguments.\n");
+                pa_log("Too many arguments.");
                 goto finish;
             }
 
@@ -585,7 +585,7 @@ int main(int argc, char *argv[]) {
         case PA_CMD_VERSION :
 
             if (d < argc) {
-                pa_log("Too many arguments.\n");
+                pa_log("Too many arguments.");
                 goto finish;
             }
 
@@ -597,7 +597,7 @@ int main(int argc, char *argv[]) {
             pid_t pid;
 
             if (d < argc) {
-                pa_log("Too many arguments.\n");
+                pa_log("Too many arguments.");
                 goto finish;
             }
 
@@ -614,7 +614,7 @@ int main(int argc, char *argv[]) {
         case PA_CMD_KILL:
 
             if (d < argc) {
-                pa_log("Too many arguments.\n");
+                pa_log("Too many arguments.");
                 goto finish;
             }
 
@@ -628,7 +628,7 @@ int main(int argc, char *argv[]) {
         case PA_CMD_CLEANUP_SHM:
 
             if (d < argc) {
-                pa_log("Too many arguments.\n");
+                pa_log("Too many arguments.");
                 goto finish;
             }
 
@@ -642,7 +642,7 @@ int main(int argc, char *argv[]) {
     }
 
     if (d < argc) {
-        pa_log("Too many arguments.\n");
+        pa_log("Too many arguments.");
         goto finish;
     }
 
diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c
index a4bb449..dfb2aa7 100644
--- a/src/modules/alsa/alsa-util.c
+++ b/src/modules/alsa/alsa-util.c
@@ -474,32 +474,32 @@ int pa_alsa_set_sw_params(snd_pcm_t *pcm, snd_pcm_uframes_t avail_min, bool peri
     snd_pcm_sw_params_alloca(&swparams);
 
     if ((err = snd_pcm_sw_params_current(pcm, swparams)) < 0) {
-        pa_log_warn("Unable to determine current swparams: %s\n", pa_alsa_strerror(err));
+        pa_log_warn("Unable to determine current swparams: %s", pa_alsa_strerror(err));
         return err;
     }
 
     if ((err = snd_pcm_sw_params_set_period_event(pcm, swparams, period_event)) < 0) {
-        pa_log_warn("Unable to disable period event: %s\n", pa_alsa_strerror(err));
+        pa_log_warn("Unable to disable period event: %s", pa_alsa_strerror(err));
         return err;
     }
 
     if ((err = snd_pcm_sw_params_set_tstamp_mode(pcm, swparams, SND_PCM_TSTAMP_ENABLE)) < 0) {
-        pa_log_warn("Unable to enable time stamping: %s\n", pa_alsa_strerror(err));
+        pa_log_warn("Unable to enable time stamping: %s", pa_alsa_strerror(err));
         return err;
     }
 
     if ((err = snd_pcm_sw_params_get_boundary(swparams, &boundary)) < 0) {
-        pa_log_warn("Unable to get boundary: %s\n", pa_alsa_strerror(err));
+        pa_log_warn("Unable to get boundary: %s", pa_alsa_strerror(err));
         return err;
     }
 
     if ((err = snd_pcm_sw_params_set_stop_threshold(pcm, swparams, boundary)) < 0) {
-        pa_log_warn("Unable to set stop threshold: %s\n", pa_alsa_strerror(err));
+        pa_log_warn("Unable to set stop threshold: %s", pa_alsa_strerror(err));
         return err;
     }
 
     if ((err = snd_pcm_sw_params_set_start_threshold(pcm, swparams, (snd_pcm_uframes_t) -1)) < 0) {
-        pa_log_warn("Unable to set start threshold: %s\n", pa_alsa_strerror(err));
+        pa_log_warn("Unable to set start threshold: %s", pa_alsa_strerror(err));
         return err;
     }
 
@@ -509,7 +509,7 @@ int pa_alsa_set_sw_params(snd_pcm_t *pcm, snd_pcm_uframes_t avail_min, bool peri
     }
 
     if ((err = snd_pcm_sw_params(pcm, swparams)) < 0) {
-        pa_log_warn("Unable to set sw params: %s\n", pa_alsa_strerror(err));
+        pa_log_warn("Unable to set sw params: %s", pa_alsa_strerror(err));
         return err;
     }
 
@@ -1546,7 +1546,7 @@ static int mixer_class_event(snd_mixer_class_t *class, unsigned int mask,
         return 0;
     }
     else
-        pa_log_info("Got an unknown mixer class event for %s: mask 0x%x\n", name, mask);
+        pa_log_info("Got an unknown mixer class event for %s: mask 0x%x", name, mask);
 
     return 0;
 }
diff --git a/src/modules/bluetooth/backend-native.c b/src/modules/bluetooth/backend-native.c
index 222e33b..86376c0 100644
--- a/src/modules/bluetooth/backend-native.c
+++ b/src/modules/bluetooth/backend-native.c
@@ -137,7 +137,7 @@ static int bluez5_sco_acquire_cb(pa_bluetooth_transport *t, bool optional, size_
     addr.sco_family = AF_BLUETOOTH;
     bacpy(&addr.sco_bdaddr, &dst);
 
-    pa_log_info ("doing connect\n");
+    pa_log_info("doing connect");
     err = connect(sock, (struct sockaddr *) &addr, sizeof(addr));
     if (err < 0 && !(errno == EAGAIN || errno == EINPROGRESS)) {
         pa_log_error("connect(): %s", pa_cstrerror(errno));
diff --git a/src/modules/bluetooth/bluez4-util.c b/src/modules/bluetooth/bluez4-util.c
index 90b1563..3793898 100644
--- a/src/modules/bluetooth/bluez4-util.c
+++ b/src/modules/bluetooth/bluez4-util.c
@@ -888,7 +888,7 @@ static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *m, void *us
 
     dbus_error_init(&err);
 
-    pa_log_debug("dbus: interface=%s, path=%s, member=%s\n",
+    pa_log_debug("dbus: interface=%s, path=%s, member=%s",
             dbus_message_get_interface(m),
             dbus_message_get_path(m),
             dbus_message_get_member(m));
diff --git a/src/modules/bluetooth/module-bluez4-device.c b/src/modules/bluetooth/module-bluez4-device.c
index 0de8ecb..7f9335b 100644
--- a/src/modules/bluetooth/module-bluez4-device.c
+++ b/src/modules/bluetooth/module-bluez4-device.c
@@ -1798,7 +1798,7 @@ static void bt_transport_config_a2dp(struct userdata *u) {
     a2dp->codesize = sbc_get_codesize(&a2dp->sbc);
     a2dp->frame_length = sbc_get_frame_length(&a2dp->sbc);
 
-    pa_log_info("SBC parameters:\n\tallocation=%u\n\tsubbands=%u\n\tblocks=%u\n\tbitpool=%u\n",
+    pa_log_info("SBC parameters:\n\tallocation=%u\n\tsubbands=%u\n\tblocks=%u\n\tbitpool=%u",
                 a2dp->sbc.allocation, a2dp->sbc.subbands, a2dp->sbc.blocks, a2dp->sbc.bitpool);
 }
 
diff --git a/src/modules/xen/module-xenpv-sink.c b/src/modules/xen/module-xenpv-sink.c
index 4813f10..2612ec9 100644
--- a/src/modules/xen/module-xenpv-sink.c
+++ b/src/modules/xen/module-xenpv-sink.c
@@ -155,7 +155,7 @@ static char* read_param(const char *paramname);
 
 static int set_state(int state) {
     static int current_state = 0;
-    pa_log_debug("State transition %s->%s\n",
+    pa_log_debug("State transition %s->%s",
             xenbus_names[current_state], xenbus_names[state]);
 
     publish_param_int("state", state);
@@ -167,25 +167,25 @@ static int set_state(int state) {
 
 /* negotiation callbacks */
 static int state_unknown_cb() {
-    pa_log_debug("Xen audio sink: Backend state was XenbusStateUnknown\n");
+    pa_log_debug("Xen audio sink: Backend state was XenbusStateUnknown");
     set_state(XenbusStateInitialising);
 
     return 0;
 }
 
 static int state_initialising_cb() {
-    pa_log_debug("Xen audio sink: Backend state was XenbusStateInitialising\n");
+    pa_log_debug("Xen audio sink: Backend state was XenbusStateInitialising");
     set_state(XenbusStateInitialised);
     return 0;
 }
 
 static int state_initwait_cb() {
-    pa_log_debug("Xen audio sink: Backend state was XenbusStateInitWait\n");
+    pa_log_debug("Xen audio sink: Backend state was XenbusStateInitWait");
     return 0;
 }
 
 static int state_initialised_cb() {
-    pa_log_debug("Xen audio sink: Backend state was XenbusStateInitialised\n");
+    pa_log_debug("Xen audio sink: Backend state was XenbusStateInitialised");
     /*Remind the backend we are ready*/
     set_state(XenbusStateInitialised);
     return 0;
@@ -194,23 +194,23 @@ static int state_initialised_cb() {
 static int state_connected_cb() {
     /* The backend accepted our parameters, sweet! */
     set_state(XenbusStateConnected);
-    pa_log_debug("Xen audio sink: Backend state was XenbusStateConnected\n");
+    pa_log_debug("Xen audio sink: Backend state was XenbusStateConnected");
     return NEGOTIATION_OK;
 }
 
 static int state_closing_cb() {
-    pa_log_debug("Xen audio sink: Backend state was XenbusStateClosing\n");
+    pa_log_debug("Xen audio sink: Backend state was XenbusStateClosing");
     return 0;
 }
 
 static int state_closed_cb() {
-    pa_log_debug("Xen audio sink: Backend state was XenbusStateClosed\n");
+    pa_log_debug("Xen audio sink: Backend state was XenbusStateClosed");
     return 0;
 }
 
 static int state_reconfiguring_cb() {
     /* The backend rejected our sample spec */
-    pa_log_debug("Xen audio sink: Backend state was XenbusStateReconfiguring\n");
+    pa_log_debug("Xen audio sink: Backend state was XenbusStateReconfiguring");
     /* fall back to the backend's default parameters*/
     read_backend_default_spec(&ss);
     /* backend should accept these now */
@@ -220,7 +220,7 @@ static int state_reconfiguring_cb() {
 }
 
 static int state_reconfigured_cb() {
-    pa_log_debug("Xen audio sink: Backend state was XenbusStateReconfigured\n");
+    pa_log_debug("Xen audio sink: Backend state was XenbusStateReconfigured");
     return 0;
 }
 
@@ -602,7 +602,7 @@ static int alloc_gref(struct ioctl_gntalloc_alloc_gref *gref_, void **addr) {
 
     rv = ioctl(alloc_fd, IOCTL_GNTALLOC_ALLOC_GREF, gref_);
     if (rv) {
-        pa_log_debug("Xen audio sink: src-add error: %s (rv=%d)\n", strerror(errno), rv);
+        pa_log_debug("Xen audio sink: src-add error: %s (rv=%d)", strerror(errno), rv);
         goto finish;
     }
 
@@ -610,11 +610,11 @@ static int alloc_gref(struct ioctl_gntalloc_alloc_gref *gref_, void **addr) {
     *addr = mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, alloc_fd, gref_->index);
     if (*addr == MAP_FAILED) {
         *addr = 0;
-        pa_log_debug("Xen audio sink: mmap'ing shared page failed\n");
+        pa_log_debug("Xen audio sink: mmap'ing shared page failed");
         goto finish;
     }
 
-    pa_log_debug("Xen audio sink: Got grant #%d. Mapped locally at %Ld=%p\n",
+    pa_log_debug("Xen audio sink: Got grant #%d. Mapped locally at %Ld=%p",
             gref_->gref_ids[0], (long long)gref_->index, *addr);
 
     /* skip this for now
@@ -625,7 +625,7 @@ static int alloc_gref(struct ioctl_gntalloc_alloc_gref *gref_, void **addr) {
 
        rv = ioctl(a_fd, IOCTL_GNTALLOC_SET_UNMAP_NOTIFY, &uarg);
        if (rv)
-       pa_log_debug("gntalloc unmap notify error: %s (rv=%d)\n", strerror(errno), rv);
+       pa_log_debug("gntalloc unmap notify error: %s (rv=%d)", strerror(errno), rv);
        */
 finish:
     close(alloc_fd);
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index f648af8..da1b0c8 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -729,7 +729,7 @@ static int set_scheduler(int rtprio) {
     /* Try to talk to RealtimeKit */
 
     if (!(bus = dbus_bus_get_private(DBUS_BUS_SYSTEM, &error))) {
-        pa_log("Failed to connect to system bus: %s\n", error.message);
+        pa_log("Failed to connect to system bus: %s", error.message);
         dbus_error_free(&error);
         errno = -EIO;
         return -1;
@@ -746,7 +746,7 @@ static int set_scheduler(int rtprio) {
         r = getrlimit(RLIMIT_RTTIME, &rl);
 
         if (r >= 0 && (long long) rl.rlim_max > rttime) {
-            pa_log_info("Clamping rlimit-rttime to %lld for RealtimeKit\n", rttime);
+            pa_log_info("Clamping rlimit-rttime to %lld for RealtimeKit", rttime);
             rl.rlim_cur = rl.rlim_max = rttime;
             r = setrlimit(RLIMIT_RTTIME, &rl);
 
@@ -866,7 +866,7 @@ static int set_nice(int nice_level) {
     /* Try to talk to RealtimeKit */
 
     if (!(bus = dbus_bus_get_private(DBUS_BUS_SYSTEM, &error))) {
-        pa_log("Failed to connect to system bus: %s\n", error.message);
+        pa_log("Failed to connect to system bus: %s", error.message);
         dbus_error_free(&error);
         errno = -EIO;
         return -1;
diff --git a/src/pulsecore/macro.h b/src/pulsecore/macro.h
index 1e15f4f..f80b43c 100644
--- a/src/pulsecore/macro.h
+++ b/src/pulsecore/macro.h
@@ -190,7 +190,7 @@ static inline size_t PA_PAGE_ALIGN(size_t l) {
 #define pa_return_if_fail(expr)                                         \
     do {                                                                \
         if (PA_UNLIKELY(!(expr))) {                                     \
-            pa_log_debug("Assertion '%s' failed at %s:%u, function %s.\n", #expr , __FILE__, __LINE__, PA_PRETTY_FUNCTION); \
+            pa_log_debug("Assertion '%s' failed at %s:%u, function %s.", #expr , __FILE__, __LINE__, PA_PRETTY_FUNCTION); \
             return;                                                     \
         }                                                               \
     } while(false)
@@ -198,7 +198,7 @@ static inline size_t PA_PAGE_ALIGN(size_t l) {
 #define pa_return_val_if_fail(expr, val)                                \
     do {                                                                \
         if (PA_UNLIKELY(!(expr))) {                                     \
-            pa_log_debug("Assertion '%s' failed at %s:%u, function %s.\n", #expr , __FILE__, __LINE__, PA_PRETTY_FUNCTION); \
+            pa_log_debug("Assertion '%s' failed at %s:%u, function %s.", #expr , __FILE__, __LINE__, PA_PRETTY_FUNCTION); \
             return (val);                                               \
         }                                                               \
     } while(false)
diff --git a/src/pulsecore/shm.c b/src/pulsecore/shm.c
index 8bd7ed7..1c5eb44 100644
--- a/src/pulsecore/shm.c
+++ b/src/pulsecore/shm.c
@@ -483,7 +483,7 @@ int pa_shm_cleanup(void) {
         segment_name(fn, sizeof(fn), id);
 
         if (shm_unlink(fn) < 0 && errno != EACCES && errno != ENOENT)
-            pa_log_warn("Failed to remove SHM segment %s: %s\n", fn, pa_cstrerror(errno));
+            pa_log_warn("Failed to remove SHM segment %s: %s", fn, pa_cstrerror(errno));
     }
 
     closedir(d);
diff --git a/src/tests/cpu-mix-test.c b/src/tests/cpu-mix-test.c
index a3189b7..cad8984 100644
--- a/src/tests/cpu-mix-test.c
+++ b/src/tests/cpu-mix-test.c
@@ -114,7 +114,7 @@ static void run_mix_test(
         for (i = 0; i < nsamples; i++) {
             if (samples[i] != samples_ref[i]) {
                 pa_log_debug("Correctness test failed: align=%d, channels=%d", align, channels);
-                pa_log_debug("%d: %hd != %04hd (%hd + %hd)\n",
+                pa_log_debug("%d: %hd != %04hd (%hd + %hd)",
                     i,
                     samples[i], samples_ref[i],
                     samples0[i], samples1[i]);
diff --git a/src/tests/cpu-remap-test.c b/src/tests/cpu-remap-test.c
index 7af5e29..c4eec45 100644
--- a/src/tests/cpu-remap-test.c
+++ b/src/tests/cpu-remap-test.c
@@ -68,7 +68,7 @@ static void run_remap_test_float(
         for (i = 0; i < nsamples * n_oc; i++) {
             if (fabsf(out[i] - out_ref[i]) > 0.0001f) {
                 pa_log_debug("Correctness test failed: align=%d", align);
-                pa_log_debug("%d: %.24f != %.24f\n", i,
+                pa_log_debug("%d: %.24f != %.24f", i,
                     out[i], out_ref[i]);
                 ck_abort();
             }
@@ -122,7 +122,7 @@ static void run_remap_test_s16(
         for (i = 0; i < nsamples * n_oc; i++) {
             if (abs(out[i] - out_ref[i]) > 3) {
                 pa_log_debug("Correctness test failed: align=%d", align);
-                pa_log_debug("%d: %d != %d\n", i, out[i], out_ref[i]);
+                pa_log_debug("%d: %d != %d", i, out[i], out_ref[i]);
                 ck_abort();
             }
         }
diff --git a/src/tests/cpu-volume-test.c b/src/tests/cpu-volume-test.c
index 15f0658..535488e 100644
--- a/src/tests/cpu-volume-test.c
+++ b/src/tests/cpu-volume-test.c
@@ -76,7 +76,7 @@ static void run_volume_test(
         for (i = 0; i < nsamples; i++) {
             if (samples[i] != samples_ref[i]) {
                 pa_log_debug("Correctness test failed: align=%d, channels=%d", align, channels);
-                pa_log_debug("%d: %04hx != %04hx (%04hx * %08x)\n", i, samples[i], samples_ref[i],
+                pa_log_debug("%d: %04hx != %04hx (%04hx * %08x)", i, samples[i], samples_ref[i],
                         samples_orig[i], volumes[i % channels]);
                 ck_abort();
             }
diff --git a/src/tests/interpol-test.c b/src/tests/interpol-test.c
index b4cf18c..bb69e52 100644
--- a/src/tests/interpol-test.c
+++ b/src/tests/interpol-test.c
@@ -212,7 +212,7 @@ START_TEST (interpol_test) {
             bool cork_now;
 #endif
             rtc = pa_timeval_diff(&now, &start);
-            pa_log_info("%i\t%llu\t%llu\t%llu\t%llu\t%lli\t%u\t%u\t%llu\t%llu\n", k,
+            pa_log_info("%i\t%llu\t%llu\t%llu\t%llu\t%lli\t%u\t%u\t%llu\t%llu", k,
                    (unsigned long long) rtc,
                    (unsigned long long) t,
                    (unsigned long long) (rtc-old_rtc),
diff --git a/src/tests/lfe-filter-test.c b/src/tests/lfe-filter-test.c
index ba63895..d779e05 100644
--- a/src/tests/lfe-filter-test.c
+++ b/src/tests/lfe-filter-test.c
@@ -70,7 +70,7 @@ static int compare_data_block(struct lfe_filter_test *lft, void *a, void *b) {
 
     for (i = 0; i < ONE_BLOCK_SAMPLES; i++) {
         if (abs(*r++ - *u++) > TOLERANT_VARIATION) {
-            pa_log_error("lfe-filter-test: test failed, the output data in the position 0x%x of a block does not equal!\n", i);
+            pa_log_error("lfe-filter-test: test failed, the output data in the position 0x%x of a block does not equal!", i);
             ret = -1;
             break;
         }
@@ -88,7 +88,7 @@ static int lfe_filter_rewind_test(struct lfe_filter_test *lft, int rewind_sample
     uint32_t fz = pa_frame_size(lft->ss);
 
     if (rewind_samples > TOTAL_SAMPLES || rewind_samples < TOTAL_SAMPLES - ONE_BLOCK_SAMPLES) {
-        pa_log_error("lfe-filter-test: Please keep %d samples < rewind_samples < %d samples\n", TOTAL_SAMPLES - ONE_BLOCK_SAMPLES, TOTAL_SAMPLES);
+        pa_log_error("lfe-filter-test: Please keep %d samples < rewind_samples < %d samples", TOTAL_SAMPLES - ONE_BLOCK_SAMPLES, TOTAL_SAMPLES);
         return ret;
     }
 
diff --git a/src/tests/lo-test-util.c b/src/tests/lo-test-util.c
index 2ff8cf8..fae91a2 100644
--- a/src/tests/lo-test-util.c
+++ b/src/tests/lo-test-util.c
@@ -38,11 +38,11 @@ static void nop_free_cb(void *p) {
 }
 
 static void underflow_cb(struct pa_stream *s, void *userdata) {
-    pa_log_warn("Underflow\n");
+    pa_log_warn("Underflow");
 }
 
 static void overflow_cb(struct pa_stream *s, void *userdata) {
-    pa_log_warn("Overlow\n");
+    pa_log_warn("Overlow");
 }
 
 /*
@@ -114,7 +114,7 @@ static void calibrate_read_cb(pa_stream *s, size_t nbytes, void *userdata) {
                 v += 0.02f;
 
                 if (v > 1.0) {
-                    pa_log_error("Capture signal too weak at 100%% volume (%g). Giving up.\n", pa_rms(in, nsamp));
+                    pa_log_error("Capture signal too weak at 100%% volume (%g). Giving up.", pa_rms(in, nsamp));
                     pa_assert_not_reached();
                 }
 
@@ -126,7 +126,7 @@ static void calibrate_read_cb(pa_stream *s, size_t nbytes, void *userdata) {
                 /* Make sure the signal strength is steadily above our threshold */
                 if (++confirm > 5) {
 #if 0
-                    pa_log_debug(stderr, "Capture volume = %g (%g)\n", v, pa_rms(in, nsamp));
+                    pa_log_debug(stderr, "Capture volume = %g (%g)", v, pa_rms(in, nsamp));
 #endif
                     cal_state = CALIBRATION_ZERO;
                 }
@@ -138,7 +138,7 @@ static void calibrate_read_cb(pa_stream *s, size_t nbytes, void *userdata) {
             /* Now make sure silence doesn't trigger a false positive because
              * of noise. */
             if (pa_rms(in, nsamp) > 0.1f) {
-                fprintf(stderr, "Too much noise on capture (%g). Giving up.\n", pa_rms(in, nsamp));
+                pa_log_warn("Too much noise on capture (%g). Giving up.", pa_rms(in, nsamp));
                 pa_assert_not_reached();
             }
 
@@ -179,7 +179,7 @@ static void stream_state_callback(pa_stream *s, void *userdata) {
             }
 
             if (!o) {
-                pa_log_error("Could not set stream volume: %s\n", pa_strerror(pa_context_errno(ctx->context)));
+                pa_log_error("Could not set stream volume: %s", pa_strerror(pa_context_errno(ctx->context)));
                 pa_assert_not_reached();
             } else
                 pa_operation_unref(o);
@@ -189,7 +189,7 @@ static void stream_state_callback(pa_stream *s, void *userdata) {
 
         case PA_STREAM_FAILED:
         default:
-            pa_log_error("Stream error: %s\n", pa_strerror(pa_context_errno(ctx->context)));
+            pa_log_error("Stream error: %s", pa_strerror(pa_context_errno(ctx->context)));
             pa_assert_not_reached();
     }
 }
@@ -252,7 +252,7 @@ static void context_state_callback(pa_context *c, void *userdata) {
 
         case PA_CONTEXT_FAILED:
         default:
-            pa_log_error("Context error: %s\n", pa_strerror(pa_context_errno(c)));
+            pa_log_error("Context error: %s", pa_strerror(pa_context_errno(c)));
             pa_assert_not_reached();
     }
 }
@@ -271,7 +271,7 @@ int pa_lo_test_init(pa_lo_test_context *ctx) {
 
     /* Connect the context */
     if (pa_context_connect(ctx->context, NULL, PA_CONTEXT_NOFLAGS, NULL) < 0) {
-        pa_log_error("pa_context_connect() failed.\n");
+        pa_log_error("pa_context_connect() failed.");
         goto quit;
     }
 
@@ -288,7 +288,7 @@ int pa_lo_test_run(pa_lo_test_context *ctx) {
     int ret;
 
     if (pa_mainloop_run(ctx->mainloop, &ret) < 0) {
-        pa_log_error("pa_mainloop_run() failed.\n");
+        pa_log_error("pa_mainloop_run() failed.");
         return -1;
     }
 
diff --git a/src/tests/mix-test.c b/src/tests/mix-test.c
index 972f5d7..d9255e3 100644
--- a/src/tests/mix-test.c
+++ b/src/tests/mix-test.c
@@ -299,7 +299,7 @@ START_TEST (mix_test) {
         pa_mix_info m[2];
         void *ptr;
 
-        pa_log_debug("=== mixing: %s\n", pa_sample_format_to_string(a.format));
+        pa_log_debug("=== mixing: %s", pa_sample_format_to_string(a.format));
 
         /* Generate block */
         i.memblock = generate_block(pool, &a);
diff --git a/src/tests/remix-test.c b/src/tests/remix-test.c
index e21c109..1e58418 100644
--- a/src/tests/remix-test.c
+++ b/src/tests/remix-test.c
@@ -59,7 +59,7 @@ int main(int argc, char *argv[]) {
             pa_resampler *r;
             pa_sample_spec ss1, ss2;
 
-            pa_log_info("Converting from '%s' to '%s'.\n", pa_channel_map_snprint(a, sizeof(a), &maps[i]), pa_channel_map_snprint(b, sizeof(b), &maps[j]));
+            pa_log_info("Converting from '%s' to '%s'.", pa_channel_map_snprint(a, sizeof(a), &maps[i]), pa_channel_map_snprint(b, sizeof(b), &maps[j]));
 
             ss1.channels = maps[i].channels;
             ss2.channels = maps[j].channels;
diff --git a/src/tests/utf8-test.c b/src/tests/utf8-test.c
index 22a58c0..1e1e777 100644
--- a/src/tests/utf8-test.c
+++ b/src/tests/utf8-test.c
@@ -25,7 +25,7 @@ START_TEST (utf8_filter) {
     {
         char res1[] = { 0x68, 0x5f, 0x70, 0x66, 0x62, 0x75, 0x72, 0x67, '\0' };
         c = pa_utf8_filter("hüpfburg");
-        pa_log_debug("%s %s\n", res1, c);
+        pa_log_debug("%s %s", res1, c);
         fail_unless(pa_streq(c, res1));
         pa_xfree(c);
     }
@@ -34,14 +34,14 @@ START_TEST (utf8_filter) {
         char res2[] = { 0x68, 0xc3, 0xbc, 0x70, 0x66, 0x62, 0x75, 0x72, 0x67, '\0' };
         c = pa_utf8_filter("hüpfburg");
         fail_unless(pa_streq(c, res2));
-        pa_log_debug("%s %s\n", res2, c);
+        pa_log_debug("%s %s", res2, c);
         pa_xfree(c);
     }
 
     {
         char res3[] = { 0x5f, 0x78, 0x6b, 0x6e, 0x5f, 0x72, 0x7a, 0x6d, 0x5f, 0x72, 0x7a, 0x65, 0x6c, 0x74, 0x5f, 0x72, 0x73, 0x7a, 0xdf, 0xb3, 0x5f, 0x64, 0x73, 0x6a, 0x6b, 0x66, 0x68, '\0' };
         c = pa_utf8_filter("üxknärzmörzeltörszß³§dsjkfh");
-        pa_log_debug("%s %s\n", res3, c);
+        pa_log_debug("%s %s", res3, c);
         fail_unless(pa_streq(c, res3));
         pa_xfree(c);
     }
-- 
2.7.4



More information about the pulseaudio-discuss mailing list