diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2019-05-06 23:59:28 +0300 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2019-05-07 07:29:15 +0000 |
commit | 38c166ab749b42ee8e97c5f867401a35f7bb9356 (patch) | |
tree | 746fe1a1db37ba5802ff6b10bbf8d67171f1d977 /src/plugins/perfprofiler | |
parent | 27a472aa30bf64d74938e4e10ebe2932f25808fd (diff) | |
download | qt-creator-38c166ab749b42ee8e97c5f867401a35f7bb9356.tar.gz |
PerfProfiler: Fix signedness mismatch on comparison
Detected by GCC9.
Change-Id: I14c1ece9f5070ba3a8d6d91c3cbdf7aff24c4a1e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/plugins/perfprofiler')
-rw-r--r-- | src/plugins/perfprofiler/perfprofilertracemanager.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/perfprofiler/perfprofilertracemanager.cpp b/src/plugins/perfprofiler/perfprofilertracemanager.cpp index 6da6c3e3cb..4f3b4d5c05 100644 --- a/src/plugins/perfprofiler/perfprofilertracemanager.cpp +++ b/src/plugins/perfprofiler/perfprofilertracemanager.cpp @@ -399,13 +399,13 @@ int PerfProfilerEventTypeStorage::append(Timeline::TraceEventType &&type) if (perfType.isLocation()) { const size_t index = m_locations.size(); m_locations.push_back(perfType); - QTC_ASSERT(index <= std::numeric_limits<int>::max(), + QTC_ASSERT(index <= size_t(std::numeric_limits<int>::max()), return std::numeric_limits<int>::max()); return static_cast<int>(index); } else if (perfType.isAttribute()) { const size_t index = m_attributes.size(); m_attributes.push_back(perfType); - QTC_ASSERT(index <= std::numeric_limits<int>::max(), + QTC_ASSERT(index <= size_t(std::numeric_limits<int>::max()), return -std::numeric_limits<int>::max()); return -static_cast<int>(index); } @@ -416,7 +416,8 @@ int PerfProfilerEventTypeStorage::append(Timeline::TraceEventType &&type) int PerfProfilerEventTypeStorage::size() const { const size_t result = m_attributes.size() + m_locations.size(); - QTC_ASSERT(result <= std::numeric_limits<int>::max(), return std::numeric_limits<int>::max()); + QTC_ASSERT(result <= size_t(std::numeric_limits<int>::max()), + return std::numeric_limits<int>::max()); return static_cast<int>(result); } |