From 8ddc2df662afff8a547371c93d5b5655f8f3de2f Mon Sep 17 00:00:00 2001 From: iphydf Date: Tue, 7 Apr 2020 19:17:58 +0000 Subject: Remove newlines from the end of LOGGER format strings. See https://github.com/TokTok/hs-tokstyle/pull/49 for the corresponding tokstyle analysis. --- toxav/rtp.c | 2 +- toxav/toxav.c | 4 ++-- toxcore/DHT.c | 2 +- toxcore/Messenger.c | 2 +- toxcore/network.c | 2 +- toxcore/state.c | 8 ++++---- toxcore/tox.c | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/toxav/rtp.c b/toxav/rtp.c index aed9523b..f48c483b 100644 --- a/toxav/rtp.c +++ b/toxav/rtp.c @@ -256,7 +256,7 @@ static bool fill_data_into_slot(const Logger *log, struct RTPWorkBufferList *wkb struct RTPMessage *msg = (struct RTPMessage *)calloc(1, sizeof(struct RTPMessage) + header->data_length_full); if (msg == nullptr) { - LOGGER_ERROR(log, "Out of memory while trying to allocate for frame of size %u\n", + LOGGER_ERROR(log, "Out of memory while trying to allocate for frame of size %u", (unsigned)header->data_length_full); // Out of memory: throw away the incoming data. return false; diff --git a/toxav/toxav.c b/toxav/toxav.c index 8f3c7e01..dda16ecd 100644 --- a/toxav/toxav.c +++ b/toxav/toxav.c @@ -918,7 +918,7 @@ bool toxav_video_send_frame(ToxAV *av, uint32_t friend_number, uint16_t width, u if (vrc != VPX_CODEC_OK) { pthread_mutex_unlock(call->mutex_video); - LOGGER_ERROR(av->m->log, "Could not encode video frame: %s\n", vpx_codec_err_to_string(vrc)); + LOGGER_ERROR(av->m->log, "Could not encode video frame: %s", vpx_codec_err_to_string(vrc)); rc = TOXAV_ERR_SEND_FRAME_INVALID; goto RETURN; } @@ -1308,7 +1308,7 @@ static bool call_prepare_transmission(ToxAVCall *call) } if (call->active) { - LOGGER_WARNING(av->m->log, "Call already active!\n"); + LOGGER_WARNING(av->m->log, "Call already active!"); return true; } diff --git a/toxcore/DHT.c b/toxcore/DHT.c index 191ebc0e..7525e695 100644 --- a/toxcore/DHT.c +++ b/toxcore/DHT.c @@ -2924,7 +2924,7 @@ static State_Load_Status dht_load_state_callback(void *outer, const uint8_t *dat } default: - LOGGER_ERROR(dht->log, "Load state (DHT): contains unrecognized part (len %u, type %u)\n", + LOGGER_ERROR(dht->log, "Load state (DHT): contains unrecognized part (len %u, type %u)", length, type); break; } diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index ddd04518..a4bc8100 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c @@ -2651,7 +2651,7 @@ void do_messenger(Messenger *m, void *userdata) } if (m->numfriends != dht_get_num_friends(m->dht)) { - LOGGER_TRACE(m->log, "Friend num in DHT %u != friend num in msger %u\n", dht_get_num_friends(m->dht), m->numfriends); + LOGGER_TRACE(m->log, "Friend num in DHT %u != friend num in msger %u", dht_get_num_friends(m->dht), m->numfriends); } Friend *msgfptr; diff --git a/toxcore/network.c b/toxcore/network.c index d3284c4d..3f297ad7 100644 --- a/toxcore/network.c +++ b/toxcore/network.c @@ -759,7 +759,7 @@ Networking_Core *new_networking_ex(const Logger *log, IP ip, uint16_t port_from, /* maybe check for invalid IPs like 224+.x.y.z? if there is any IP set ever */ if (!net_family_is_ipv4(ip.family) && !net_family_is_ipv6(ip.family)) { - LOGGER_ERROR(log, "invalid address family: %u\n", ip.family.value); + LOGGER_ERROR(log, "invalid address family: %u", ip.family.value); return nullptr; } diff --git a/toxcore/state.c b/toxcore/state.c index 67cc68ad..13ae8e71 100644 --- a/toxcore/state.c +++ b/toxcore/state.c @@ -11,7 +11,7 @@ int state_load(const Logger *log, state_load_cb *state_load_callback, void *oute const uint8_t *data, uint32_t length, uint16_t cookie_inner) { if (state_load_callback == nullptr || data == nullptr) { - LOGGER_ERROR(log, "state_load() called with invalid args.\n"); + LOGGER_ERROR(log, "state_load() called with invalid args."); return -1; } @@ -30,13 +30,13 @@ int state_load(const Logger *log, state_load_cb *state_load_callback, void *oute if (length < length_sub) { /* file truncated */ - LOGGER_ERROR(log, "state file too short: %u < %u\n", length, length_sub); + LOGGER_ERROR(log, "state file too short: %u < %u", length, length_sub); return -1; } if (lendian_to_host16((cookie_type >> 16)) != cookie_inner) { /* something is not matching up in a bad way, give up */ - LOGGER_ERROR(log, "state file garbled: %04x != %04x\n", cookie_type >> 16, cookie_inner); + LOGGER_ERROR(log, "state file garbled: %04x != %04x", cookie_type >> 16, cookie_inner); return -1; } @@ -58,7 +58,7 @@ int state_load(const Logger *log, state_load_cb *state_load_callback, void *oute } if (length != 0) { - LOGGER_ERROR(log, "unparsed data in state file of length %u\n", length); + LOGGER_ERROR(log, "unparsed data in state file of length %u", length); return -1; } diff --git a/toxcore/tox.c b/toxcore/tox.c index b70be7a3..fdf2b42c 100644 --- a/toxcore/tox.c +++ b/toxcore/tox.c @@ -350,7 +350,7 @@ static State_Load_Status state_load_callback(void *outer, const uint8_t *data, u return STATE_LOAD_STATUS_END; } - LOGGER_ERROR(tox->m->log, "Load state: contains unrecognized part (len %u, type %u)\n", + LOGGER_ERROR(tox->m->log, "Load state: contains unrecognized part (len %u, type %u)", length, type); return STATE_LOAD_STATUS_CONTINUE; -- cgit v1.2.3