Clang doesn't like functions declared in an anonymous namespace in a
header and then later not used. It treats those are static functions,
and the -Wunused-functions warning is printed for them.
Instead, declare them inline in a regular namespace and use it.
qclucene_global_p.h:106:19: error: unused function 'QStringToTChar' [-Werror,-Wunused-function]
inline TCHAR* QStringToTChar(const QString &str)
^
Change-Id: I94696d40693558ef105281c8ec6e30159c47844d
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
# define CL_NS2(sub,sub2)
#endif
-namespace {
- TCHAR* QStringToTChar(const QString &str)
+namespace QtCLuceneHelpers {
+ inline TCHAR* QStringToTChar(const QString &str)
{
TCHAR *string = new TCHAR[(str.length() +1) * sizeof(TCHAR)];
memset(string, 0, (str.length() +1) * sizeof(TCHAR));
return string;
}
- QString TCharToQString(const TCHAR *string)
+ inline QString TCharToQString(const TCHAR *string)
{
#if defined(UNICODE) || defined(_CL_HAVE_WCHAR_H) && defined(_CL_HAVE_WCHAR_T)
QString retValue = QString::fromWCharArray(string);
#endif
}
}
+using namespace QtCLuceneHelpers;
QT_END_NAMESPACE