Logging: Explicitly cast Q_FUNC_INFO and __FILE__ to const char *

Otherwise they might end up as const char[], which clang-tidy complains
about because it implicitly decays into a pointer when passed to the
QMessageLogger ctor.

Change-Id: I0d223f0c94cb63be6fc2a165348f143fadaf11ea
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Ulf Hermann 2018-11-01 09:47:14 +01:00
parent dc0111b2a7
commit 84ff636ecf

View File

@ -153,9 +153,9 @@ private:
#endif
#ifdef QT_MESSAGELOGCONTEXT
#define QT_MESSAGELOG_FILE __FILE__
#define QT_MESSAGELOG_FILE static_cast<const char *>(__FILE__)
#define QT_MESSAGELOG_LINE __LINE__
#define QT_MESSAGELOG_FUNC Q_FUNC_INFO
#define QT_MESSAGELOG_FUNC static_cast<const char *>(Q_FUNC_INFO)
#else
#define QT_MESSAGELOG_FILE nullptr
#define QT_MESSAGELOG_LINE 0