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

Warnings fix

This commit is contained in:
Victor Zarubkin 2016-09-14 23:34:56 +03:00
parent 795d347d2a
commit f0ee9215bd
5 changed files with 7 additions and 8 deletions

View File

@ -383,6 +383,7 @@ namespace profiler {
public:
explicit BlockDescRef(const BaseBlockDescriptor& _desc) : m_desc(_desc) { }
explicit BlockDescRef(const BaseBlockDescriptor* _desc) : m_desc(*_desc) { }
inline operator const BaseBlockDescriptor& () const { return m_desc; }
~BlockDescRef();
@ -407,7 +408,7 @@ namespace profiler {
\ingroup profiler
*/
PROFILER_API const BaseBlockDescriptor& registerDescription(bool _enabled, const char* _autogenUniqueId, const char* _compiletimeName, const char* _filename, int _line, block_type_t _block_type, color_t _color);
PROFILER_API const BaseBlockDescriptor* registerDescription(bool _enabled, const char* _autogenUniqueId, const char* _compiletimeName, const char* _filename, int _line, block_type_t _block_type, color_t _color);
/** Stores event in the blocks list.

View File

@ -816,7 +816,6 @@ const ::profiler_gui::EasyBlock* EasyGraphicsItem::intersectEvent(const QPointF&
}
const auto sceneView = view();
const auto currentScale = view()->scale();
auto firstSync = ::std::lower_bound(m_pRoot->sync.begin(), m_pRoot->sync.end(), _pos.x(), [&sceneView](::profiler::block_index_t _index, qreal _value)
{
return sceneView->time2position(blocksTree(_index).node->begin()) < _value;

View File

@ -47,7 +47,7 @@ extern timestamp_t getCurrentTime();
extern "C" {
PROFILER_API const BaseBlockDescriptor& registerDescription(bool _enabled, const char* _autogenUniqueId, const char* _name, const char* _filename, int _line, block_type_t _block_type, color_t _color)
PROFILER_API const BaseBlockDescriptor* registerDescription(bool _enabled, const char* _autogenUniqueId, const char* _name, const char* _filename, int _line, block_type_t _block_type, color_t _color)
{
return MANAGER.addBlockDescriptor(_enabled, _autogenUniqueId, _name, _filename, _line, _block_type, _color);
}
@ -153,8 +153,8 @@ void ThreadStorage::storeBlock(const profiler::Block& block)
auto size = static_cast<uint16_t>(sizeof(BaseBlockData) + name_length + 1);
#if EASY_MEASURE_STORAGE_EXPAND != 0
const bool expanded = desc.enabled() && blocks.closedList.need_expand(size);
profiler::Block b(0ULL, desc.id(), "");
const bool expanded = desc->enabled() && blocks.closedList.need_expand(size);
profiler::Block b(0ULL, desc->id(), "");
if (expanded) b.start();
#endif

View File

@ -342,7 +342,7 @@ public:
~ProfileManager();
template <class ... TArgs>
const profiler::BaseBlockDescriptor& addBlockDescriptor(bool _enabledByDefault, const char* _autogenUniqueId, TArgs ... _args)
const profiler::BaseBlockDescriptor* addBlockDescriptor(bool _enabledByDefault, const char* _autogenUniqueId, TArgs ... _args)
{
auto desc = new profiler::BlockDescriptor(m_usedMemorySize, _enabledByDefault, _args...);
@ -362,7 +362,7 @@ public:
desc->m_pEnable = &m_blocksEnableStatus.emplace(key, desc->enabled()).first->second;
}
return *desc;
return desc;
}
void storeBlock(const profiler::BaseBlockDescriptor& _desc, const char* _runtimeName);

View File

@ -342,7 +342,6 @@ extern "C" ::profiler::block_index_t fillTreesFromFile(::std::atomic<int>& progr
auto& per_parent_statistics = parent_statistics[thread_id];
auto& per_thread_statistics = thread_statistics[thread_id];
auto descriptor = descriptors[baseData->id()];
if (*tree.node->name() != 0)
{