From e513ee1bb08b6e3e98d782c8fd1782697512909a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 28 Aug 2012 18:19:18 +0200 Subject: [PATCH] fix line number display the line numbers are limited to unsigned short in the parser and consequently the evaluator. as that's an internal detail that could change any time, the display works with ints. so the special value ~0 needs to be converted to -1 in the right place. Change-Id: Ia9437164b88ecf2077ffc4c01d7e16033970df1b Reviewed-by: Daniel Teske --- src/shared/proparser/qmakeevaluator.cpp | 3 ++- src/shared/proparser/qmakeevaluator.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/shared/proparser/qmakeevaluator.cpp b/src/shared/proparser/qmakeevaluator.cpp index fd6366aeee1..885caf6d71b 100644 --- a/src/shared/proparser/qmakeevaluator.cpp +++ b/src/shared/proparser/qmakeevaluator.cpp @@ -1854,7 +1854,8 @@ void QMakeEvaluator::message(int type, const QString &msg) const { if (!m_skipLevel) m_handler->message(type, msg, - m_current.line ? m_current.pro->fileName() : QString(), m_current.line); + m_current.line ? m_current.pro->fileName() : QString(), + m_current.line != 0xffff ? m_current.line : -1); } #ifdef PROEVALUATOR_DEBUG diff --git a/src/shared/proparser/qmakeevaluator.h b/src/shared/proparser/qmakeevaluator.h index 1195d4b1b43..a2b4b93ad91 100644 --- a/src/shared/proparser/qmakeevaluator.h +++ b/src/shared/proparser/qmakeevaluator.h @@ -248,9 +248,9 @@ public: struct Location { Location() : pro(0), line(0) {} - Location(ProFile *_pro, int _line) : pro(_pro), line(_line) {} + Location(ProFile *_pro, ushort _line) : pro(_pro), line(_line) {} ProFile *pro; - int line; + ushort line; }; Location m_current; // Currently evaluated location