From 0b2c00307dc03997140b33ee1986a294afd32b23 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Tue, 1 Apr 2014 00:13:43 +0400 Subject: [PATCH] Some functions with unused return value explicitly casted to (void) --- libuavcan/include/uavcan/debug.hpp | 6 +++--- libuavcan/src/transport/can_io.cpp | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/libuavcan/include/uavcan/debug.hpp b/libuavcan/include/uavcan/debug.hpp index 777e65093b..82896228fc 100644 --- a/libuavcan/include/uavcan/debug.hpp +++ b/libuavcan/include/uavcan/debug.hpp @@ -16,11 +16,11 @@ __attribute__ ((format(printf, 2, 3))) static void UAVCAN_TRACE(const char* src, const char* fmt, ...) { va_list args; - std::printf("UAVCAN: %s: ", src); + (void)std::printf("UAVCAN: %s: ", src); va_start(args, fmt); - std::vprintf(fmt, args); + (void)std::vprintf(fmt, args); va_end(args); - std::puts(""); + (void)std::puts(""); } #else diff --git a/libuavcan/src/transport/can_io.cpp b/libuavcan/src/transport/can_io.cpp index d89777fd96..20fe36bf66 100644 --- a/libuavcan/src/transport/can_io.cpp +++ b/libuavcan/src/transport/can_io.cpp @@ -159,7 +159,6 @@ void CanTxQueue::push(const CanFrame& frame, MonotonicTime tx_deadline, Qos qos, if (praw == NULL) { return; // Seems that there is no memory at all. - } Entry* entry = new (praw) Entry(frame, tx_deadline, qos, flags); assert(entry); @@ -405,7 +404,7 @@ int CanIOManager::receive(CanRxFrame& out_frame, MonotonicTime blocking_deadline { if (masks.write & (1 << i)) { - sendFromTxQueue(i); + (void)sendFromTxQueue(i); // It may fail, we don't care. Requested operation was receive, not send. } }