From 31608bb706ef411f215d037f09accbb68c2c9c7e Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Sat, 31 Dec 2016 01:27:37 +0100 Subject: [PATCH] refactor(renderer): Cast signal data --- src/components/renderer.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/renderer.cpp b/src/components/renderer.cpp index 84689a2e..f1d8ef0c 100644 --- a/src/components/renderer.cpp +++ b/src/components/renderer.cpp @@ -525,7 +525,7 @@ void renderer::debug_hints() { #endif bool renderer::on(const change_background& evt) { - uint32_t color{*evt()}; + const uint32_t color{*evt()}; if (m_colors[gc::BG] == color) { m_log.trace_x("renderer: ignoring unchanged background color(#%08x)", color); @@ -540,7 +540,7 @@ bool renderer::on(const change_background& evt) { } bool renderer::on(const change_foreground& evt) { - uint32_t color{*evt()}; + const uint32_t color{*evt()}; if (m_colors[gc::FG] == color) { m_log.trace_x("renderer: ignoring unchanged foreground color(#%08x)", color); @@ -555,7 +555,7 @@ bool renderer::on(const change_foreground& evt) { } bool renderer::on(const change_underline& evt) { - uint32_t color{*evt()}; + const uint32_t color{*evt()}; if (m_colors[gc::UL] == color) { m_log.trace_x("renderer: ignoring unchanged underline color(#%08x)", color); @@ -569,7 +569,7 @@ bool renderer::on(const change_underline& evt) { } bool renderer::on(const change_overline& evt) { - uint32_t color{*evt()}; + const uint32_t color{*evt()}; if (m_colors[gc::OL] == color) { m_log.trace_x("renderer: ignoring unchanged overline color(#%08x)", color); @@ -583,7 +583,7 @@ bool renderer::on(const change_overline& evt) { } bool renderer::on(const change_font& evt) { - uint8_t font{*evt()}; + const uint8_t font{*evt()}; if (m_fontindex == font) { m_log.trace_x("renderer: ignoring unchanged font index(%i)", static_cast(font)); @@ -597,7 +597,7 @@ bool renderer::on(const change_font& evt) { } bool renderer::on(const change_alignment& evt) { - alignment align{*evt()}; + auto align = static_cast(*evt()); if (align == m_alignment) { m_log.trace_x("renderer: ignoring unchanged alignment(%i)", static_cast(align)); @@ -634,7 +634,7 @@ bool renderer::on(const attribute_toggle& evt) { } bool renderer::on(const action_begin& evt) { - action a{*evt()}; + auto a = static_cast(*evt()); action_block action{}; action.button = a.button; action.align = m_alignment; @@ -653,7 +653,7 @@ bool renderer::on(const action_begin& evt) { } bool renderer::on(const action_end& evt) { - mousebtn btn{*evt()}; + auto btn = static_cast(*evt()); int16_t clickable_width{0}; for (auto action = m_actions.rbegin(); action != m_actions.rend(); action++) { @@ -702,7 +702,7 @@ bool renderer::on(const write_text_unicode& evt) { } bool renderer::on(const write_text_string& evt) { - parser::packet pkt{(*evt())}; + auto pkt = static_cast(*evt()); draw_textstring(pkt.data, pkt.length); return true; }