From 1421adbc61b4525b41a07bc14c47cb47f5f030f0 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Mon, 13 Jan 2020 14:34:19 +0100 Subject: smpl_buf: Fix str_code() param and print unknown error val Change-Id: I95fadac15b9ad337ebc7cfb44a20dcf803ff8a47 --- Transceiver52M/device/common/smpl_buf.cpp | 6 ++++-- Transceiver52M/device/common/smpl_buf.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'Transceiver52M/device') diff --git a/Transceiver52M/device/common/smpl_buf.cpp b/Transceiver52M/device/common/smpl_buf.cpp index 33161bc..ceca000 100644 --- a/Transceiver52M/device/common/smpl_buf.cpp +++ b/Transceiver52M/device/common/smpl_buf.cpp @@ -154,7 +154,7 @@ std::string smpl_buf::str_status(TIMESTAMP timestamp) const return ost.str(); } -std::string smpl_buf::str_code(ssize_t code) +std::string smpl_buf::str_code(int code) { switch (code) { case ERROR_TIMESTAMP: @@ -166,6 +166,8 @@ std::string smpl_buf::str_code(ssize_t code) case ERROR_OVERFLOW: return "Sample buffer: Overrun"; default: - return "Sample buffer: Unknown error"; + std::stringstream ss; + ss << "Sample buffer: Unknown error " << code; + return ss.str(); } } diff --git a/Transceiver52M/device/common/smpl_buf.h b/Transceiver52M/device/common/smpl_buf.h index ab612de..0b49b82 100644 --- a/Transceiver52M/device/common/smpl_buf.h +++ b/Transceiver52M/device/common/smpl_buf.h @@ -68,7 +68,7 @@ public: @param code an error code @return a formatted error string */ - static std::string str_code(ssize_t code); + static std::string str_code(int code); enum err_code { ERROR_TIMESTAMP = -1, -- cgit v1.2.3