From 293600447b29938a534095335895ddfd6a37c97d Mon Sep 17 00:00:00 2001 From: tastytea Date: Tue, 22 May 2018 20:45:54 +0200 Subject: [PATCH] Corrected logstring format --- CMakeLists.txt | 7 ++++++- src/masto.cpp | 12 ++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 753db34..ba2b3ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.7) project (expandurl-mastodon - VERSION 0.6.2 + VERSION 0.6.3 LANGUAGES CXX ) @@ -15,6 +15,11 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall") +if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") + # uint_fast16_t can be bigger than 16 bit, but that doesn't matter because + # everything but the last 16 bit is padded with zeroes. + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-format") +endif() include_directories(${PROJECT_SOURCE_DIR}/src) include_directories(${PROJECT_BINARY_DIR}) diff --git a/src/masto.cpp b/src/masto.cpp index 8e549fa..99e8ee6 100644 --- a/src/masto.cpp +++ b/src/masto.cpp @@ -220,7 +220,7 @@ Mastodon::Easy::Status Listener::get_status(const std::uint_fast64_t &id) } else { - syslog(LOG_ERR, "Error %lu in %s.", ret, __FUNCTION__); + syslog(LOG_ERR, "Error %u in %s.", ret, __FUNCTION__); return Easy::Status(); } } @@ -272,7 +272,7 @@ const bool Listener::send_reply(const Easy::Status &to_status, } else { - syslog(LOG_ERR, "Error %lu in %s.", ret, __FUNCTION__); + syslog(LOG_ERR, "Error %u in %s.", ret, __FUNCTION__); return false; } } @@ -287,7 +287,7 @@ const std::uint_fast64_t Listener::get_parent_id(const Easy::Notification ¬if answer); if (ret > 0 || !Easy::Status(answer).valid()) { - syslog(LOG_ERR, "Error %lu: Could not fetch status (in %s).", + syslog(LOG_ERR, "Error %u: Could not fetch status (in %s).", ret, __FUNCTION__); return 0; } @@ -298,7 +298,7 @@ const std::uint_fast64_t Listener::get_parent_id(const Easy::Notification ¬if if (ret > 0) { - syslog(LOG_ERR, "Error %lu: Could not get status (in %s).", + syslog(LOG_ERR, "Error %u: Could not get status (in %s).", ret, __FUNCTION__); return 0; } @@ -354,12 +354,12 @@ const bool Listener::register_app() } else { - syslog(LOG_ERR, "register_app2(): %lu", ret); + syslog(LOG_ERR, "register_app2(): %u", ret); } } else { - syslog(LOG_ERR, "register_app1(): %lu", ret); + syslog(LOG_ERR, "register_app1(): %u", ret); } return false;