0
0
mirror of https://github.com/yse/easy_profiler.git synced 2024-12-28 01:04:41 +08:00

gcc warnings fix

This commit is contained in:
Victor Zarubkin 2016-12-04 18:40:46 +03:00
parent e388c8e08e
commit f9e8138c36
3 changed files with 11 additions and 15 deletions

View File

@ -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);

View File

@ -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<decltype(::profiler_gui::EasyBlockItem::children_begin)>();
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);

View File

@ -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);