Skip to content

Commit

Permalink
sonarcloud code rev
Browse files Browse the repository at this point in the history
  • Loading branch information
Raffaello committed Oct 16, 2023
1 parent 5e99106 commit 2ebfd19
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ namespace HyperSonicDrivers::devices

void MT32::lcd_message(const std::string& msg) noexcept
{
m_mt32->sysEx(hardware::mt32::mt32_LCD_addr, reinterpret_cast<const uint8_t*>(msg.c_str()), msg.size());
m_mt32->sysEx(
hardware::mt32::mt32_LCD_addr,
std::bit_cast<const uint8_t*>(msg.c_str()),
//reinterpret_cast<const uint8_t*>(msg.c_str()),
static_cast<uint32_t>(msg.size())
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace HyperSonicDrivers::drivers::midi::mt32
utils::throwLogC<std::runtime_error>("MT32 device is null");

m_mt32 = mt32->getMt32();
mt32->lcd_message("test lcd");
}

MT32Driver::~MT32Driver()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ namespace HyperSonicDrivers::hardware::mt32
void MT32ReportHandler::printDebug(const char* fmt, va_list list)
{
constexpr const int buf_size = 1024;
char buf[buf_size];
vsnprintf(buf, buf_size, fmt, list);
logD(std::format("{}", buf));
std::string buf;
buf.resize(buf_size);

vsnprintf(buf.data(), buf_size, fmt, list);
logD(buf);
}

void MT32ReportHandler::onErrorControlROM()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace HyperSonicDrivers::hardware::mt32
{
public:
MT32ReportHandler() = default;
~MT32ReportHandler() = default;

void printDebug(const char* fmt, va_list list) override;
void onErrorControlROM() override;
Expand Down

0 comments on commit 2ebfd19

Please sign in to comment.