From f9e8138c3665b10e10541a8a0928997d1db9f878 Mon Sep 17 00:00:00 2001 From: Victor Zarubkin Date: Sun, 4 Dec 2016 18:40:46 +0300 Subject: [PATCH] gcc warnings fix --- profiler_gui/blocks_graphics_view.cpp | 5 +---- profiler_gui/easy_graphics_item.cpp | 19 ++++++++++--------- profiler_gui/easy_graphics_scrollbar.cpp | 2 -- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/profiler_gui/blocks_graphics_view.cpp b/profiler_gui/blocks_graphics_view.cpp index 77f9ed6..95bd55d 100644 --- a/profiler_gui/blocks_graphics_view.cpp +++ b/profiler_gui/blocks_graphics_view.cpp @@ -533,8 +533,6 @@ const EasyGraphicsView::Items &EasyGraphicsView::getItems() const qreal EasyGraphicsView::setTree(EasyGraphicsItem* _item, ::profiler::block_index_t _parent, const ::profiler::BlocksTree::children_t& _children, qreal& _height, qreal _y, short _level) { - static const qreal MIN_DURATION = 0.25; - if (_children.empty()) { return 0; @@ -568,10 +566,9 @@ qreal EasyGraphicsView::setTree(EasyGraphicsItem* _item, ::profiler::block_index // xbegin -= dt; //} + //static const qreal MIN_DURATION = 0.25; //if (duration < MIN_DURATION) - //{ // duration = MIN_DURATION; - //} const auto i = _item->addItem(level); auto& b = _item->getItem(level, i); diff --git a/profiler_gui/easy_graphics_item.cpp b/profiler_gui/easy_graphics_item.cpp index b76d8d8..1a356b7 100644 --- a/profiler_gui/easy_graphics_item.cpp +++ b/profiler_gui/easy_graphics_item.cpp @@ -141,7 +141,8 @@ void EasyGraphicsItem::paint(QPainter* _painter, const QStyleOptionGraphicsItem* QRectF rect; QBrush brush; - QRgb previousColor = 0, inverseColor = 0xffffffff, textColor = 0; + QRgb previousColor = 0, textColor = 0; + //QRgb inverseColor = 0xffffffff; Qt::PenStyle previousPenStyle = Qt::NoPen; bool is_light = false; brush.setStyle(Qt::SolidPattern); @@ -206,12 +207,12 @@ void EasyGraphicsItem::paint(QPainter* _painter, const QStyleOptionGraphicsItem* if (gotItems) { static const auto MAX_CHILD_INDEX = ::profiler_gui::numeric_max(); - auto const skip_children = [this, &levelsNumber](short next_level, decltype(::profiler_gui::EasyBlockItem::children_begin) children_begin) - { - // Mark that we would not paint children of current item - if (next_level < levelsNumber && children_begin != MAX_CHILD_INDEX) - m_levels[next_level][children_begin].state = BLOCK_ITEM_DO_NOT_PAINT; - }; + //auto const skip_children = [this, &levelsNumber](short next_level, decltype(::profiler_gui::EasyBlockItem::children_begin) children_begin) + //{ + // // Mark that we would not paint children of current item + // if (next_level < levelsNumber && children_begin != MAX_CHILD_INDEX) + // m_levels[next_level][children_begin].state = BLOCK_ITEM_DO_NOT_PAINT; + //}; auto const dont_skip_children = [this, &levelsNumber](short next_level, decltype(::profiler_gui::EasyBlockItem::children_begin) children_begin, int8_t _state) { @@ -344,7 +345,7 @@ void EasyGraphicsItem::paint(QPainter* _painter, const QStyleOptionGraphicsItem* { // Set background color brush for rectangle previousColor = itemDesc.color(); - inverseColor = 0xffffffff - previousColor; + //inverseColor = 0xffffffff - previousColor; is_light = ::profiler_gui::isLightColor(previousColor); textColor = ::profiler_gui::textColorForFlag(is_light); brush.setColor(previousColor); @@ -401,7 +402,7 @@ void EasyGraphicsItem::paint(QPainter* _painter, const QStyleOptionGraphicsItem* { // Set background color brush for rectangle previousColor = itemDesc.color(); - inverseColor = 0xffffffff - previousColor; + //inverseColor = 0xffffffff - previousColor; is_light = ::profiler_gui::isLightColor(previousColor); textColor = ::profiler_gui::textColorForFlag(is_light); brush.setColor(previousColor); diff --git a/profiler_gui/easy_graphics_scrollbar.cpp b/profiler_gui/easy_graphics_scrollbar.cpp index e49c25e..33c8c67 100644 --- a/profiler_gui/easy_graphics_scrollbar.cpp +++ b/profiler_gui/easy_graphics_scrollbar.cpp @@ -839,7 +839,6 @@ void EasyHystogramItem::setSource(::profiler::thread_id_t _thread_id, ::profiler for (auto frame : profiler_thread.children) { const auto& frame_block = easyBlock(frame).tree; - const char* frame_name = easyDescriptor(frame_block.node->id()).name(); if (frame_block.node->id() == m_blockId) { m_selectedBlocks.push_back(frame); @@ -861,7 +860,6 @@ void EasyHystogramItem::setSource(::profiler::thread_id_t _thread_id, ::profiler { const auto child_index = top_children[top.second]; const auto& child = easyBlock(child_index).tree; - const char* child_name = easyDescriptor(child.node->id()).name(); if (child.node->id() == m_blockId) { m_selectedBlocks.push_back(child_index);