Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanmcdermid committed Sep 23, 2024
1 parent 003efb5 commit bff283c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/decoders/common/api/nexcept.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ class NExcept
//! \param[in] szFormat_ String formatting.
//! \param[in] args_ Variable number of arguments.
//----------------------------------------------------------------------------
template <typename... Args> NExcept(const char* szFormat_, Args... args_)
template <typename... Args> NExcept(const char* szFormat_, Args&&... args_)
{
std::snprintf(buffer, sizeof(buffer), szFormat_, args_...);
std::snprintf(buffer, sizeof(buffer), szFormat_, std::forward<Args>(args_)...);
perror(buffer);
}

Expand All @@ -78,9 +78,9 @@ class NExcept
//! \param[in] szFormat_ String formatting.
//! \param[in] args_ Variable number of arguments.
//----------------------------------------------------------------------------
template <typename... Args> void Printf(const char* szFormat_, Args... args_)
template <typename... Args> void Printf(const char* szFormat_, Args&&... args_)
{
std::snprintf(buffer, sizeof(buffer), szFormat_, args_);
std::snprintf(buffer, sizeof(buffer), szFormat_, std::forward<Args>(args_)...);
perror(buffer);
}

Expand Down
5 changes: 2 additions & 3 deletions src/decoders/novatel/api/rxconfig/rxconfig_handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,10 @@ class RxConfigHandler
std::unique_ptr<unsigned char[]> pcMyFrameBuffer;
std::unique_ptr<unsigned char[]> pcMyEncodeBuffer;

// Inline buffer functions
template <typename... Args>
[[nodiscard]] static bool PrintToBuffer(char** ppcBuffer_, uint32_t& uiBytesLeft_, const char* szFormat_, Args... args_)
[[nodiscard]] static bool PrintToBuffer(char** ppcBuffer_, uint32_t& uiBytesLeft_, const char* szFormat_, Args&&... args_)
{
uint32_t uiBytesBuffered = std::snprintf(*ppcBuffer_, uiBytesLeft_, szFormat_, args_...);
uint32_t uiBytesBuffered = std::snprintf(*ppcBuffer_, uiBytesLeft_, szFormat_, std::forward<Args>(args_)...);
if (uiBytesLeft_ < uiBytesBuffered) { return false; }
*ppcBuffer_ += uiBytesBuffered;
uiBytesLeft_ -= uiBytesBuffered;
Expand Down

0 comments on commit bff283c

Please sign in to comment.