mirror of
https://github.com/yse/easy_profiler.git
synced 2024-12-28 01:04:41 +08:00
Warnings fix
This commit is contained in:
parent
795d347d2a
commit
f0ee9215bd
@ -383,6 +383,7 @@ namespace profiler {
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
explicit BlockDescRef(const BaseBlockDescriptor& _desc) : m_desc(_desc) { }
|
explicit BlockDescRef(const BaseBlockDescriptor& _desc) : m_desc(_desc) { }
|
||||||
|
explicit BlockDescRef(const BaseBlockDescriptor* _desc) : m_desc(*_desc) { }
|
||||||
inline operator const BaseBlockDescriptor& () const { return m_desc; }
|
inline operator const BaseBlockDescriptor& () const { return m_desc; }
|
||||||
~BlockDescRef();
|
~BlockDescRef();
|
||||||
|
|
||||||
@ -407,7 +408,7 @@ namespace profiler {
|
|||||||
|
|
||||||
\ingroup 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.
|
/** Stores event in the blocks list.
|
||||||
|
|
||||||
|
@ -816,7 +816,6 @@ const ::profiler_gui::EasyBlock* EasyGraphicsItem::intersectEvent(const QPointF&
|
|||||||
}
|
}
|
||||||
|
|
||||||
const auto sceneView = view();
|
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)
|
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;
|
return sceneView->time2position(blocksTree(_index).node->begin()) < _value;
|
||||||
|
@ -47,7 +47,7 @@ extern timestamp_t getCurrentTime();
|
|||||||
|
|
||||||
extern "C" {
|
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);
|
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);
|
auto size = static_cast<uint16_t>(sizeof(BaseBlockData) + name_length + 1);
|
||||||
|
|
||||||
#if EASY_MEASURE_STORAGE_EXPAND != 0
|
#if EASY_MEASURE_STORAGE_EXPAND != 0
|
||||||
const bool expanded = desc.enabled() && blocks.closedList.need_expand(size);
|
const bool expanded = desc->enabled() && blocks.closedList.need_expand(size);
|
||||||
profiler::Block b(0ULL, desc.id(), "");
|
profiler::Block b(0ULL, desc->id(), "");
|
||||||
if (expanded) b.start();
|
if (expanded) b.start();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -342,7 +342,7 @@ public:
|
|||||||
~ProfileManager();
|
~ProfileManager();
|
||||||
|
|
||||||
template <class ... TArgs>
|
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...);
|
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;
|
desc->m_pEnable = &m_blocksEnableStatus.emplace(key, desc->enabled()).first->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
return *desc;
|
return desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void storeBlock(const profiler::BaseBlockDescriptor& _desc, const char* _runtimeName);
|
void storeBlock(const profiler::BaseBlockDescriptor& _desc, const char* _runtimeName);
|
||||||
|
@ -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_parent_statistics = parent_statistics[thread_id];
|
||||||
auto& per_thread_statistics = thread_statistics[thread_id];
|
auto& per_thread_statistics = thread_statistics[thread_id];
|
||||||
auto descriptor = descriptors[baseData->id()];
|
|
||||||
|
|
||||||
if (*tree.node->name() != 0)
|
if (*tree.node->name() != 0)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user