Fixed MSVC warnings, all inocuous

This commit is contained in:
Jean-Francois Dockes
2020-04-17 14:26:40 +01:00
parent a51721b5c2
commit 39c152bada
49 changed files with 262 additions and 224 deletions
+2
View File
@@ -50,3 +50,5 @@ typedef int ssize_t;
#define lstat stat
#endif // _WIN32
#define PRETEND_USE(expr) ((void)(expr))
+2 -2
View File
@@ -969,7 +969,7 @@ bool RclConfig::readFieldsConfig(const string& cnferrloc)
"]: [" << val << "]\n");
return 0;
}
ft.wdfinc = attrs.getInt("wdfinc", 1);
ft.wdfinc = (int)attrs.getInt("wdfinc", 1);
ft.boost = attrs.getFloat("boost", 1.0);
ft.pfxonly = attrs.getBool("pfxonly", false);
ft.noterms = attrs.getBool("noterms", false);
@@ -1012,7 +1012,7 @@ bool RclConfig::readFieldsConfig(const string& cnferrloc)
return 0;
}
}
int valuelen = attrs.getInt("len", 0);
int valuelen = (int)attrs.getInt("len", 0);
// Find or insert traits entry
const auto pit =
m_fldtotraits.insert(
+1 -1
View File
@@ -224,7 +224,7 @@ bool CreateInvisibleWindow()
return TRUE;
}
DWORD WINAPI RunInvisibleWindowThread(LPVOID lpParam)
DWORD WINAPI RunInvisibleWindowThread(LPVOID)
{
MSG msg;
CreateInvisibleWindow();
+6
View File
@@ -319,18 +319,22 @@ static inline int whatcc(unsigned int c, char *asciirep = nullptr)
bool TextSplit::isCJK(int c)
{
PRETEND_USE(c);
return UNICODE_IS_CJK(c);
}
bool TextSplit::isKATAKANA(int c)
{
PRETEND_USE(c);
return UNICODE_IS_KATAKANA(c);
}
bool TextSplit::isHANGUL(int c)
{
PRETEND_USE(c);
return UNICODE_IS_HANGUL(c);
}
bool TextSplit::isNGRAMMED(int c)
{
PRETEND_USE(c);
return UNICODE_IS_CJK(c) && !UNICODE_IS_KATAKANA(c) &&
!UNICODE_IS_HANGUL(c);
}
@@ -359,6 +363,8 @@ inline bool TextSplit::emitterm(bool isspan, string &w, int pos,
// long words because stats are used to detect bad text
if (!isspan || m_wordLen == m_span.length())
m_stats.newsamp(m_wordChars);
#else
PRETEND_USE(isspan);
#endif
if (l > 0 && l <= o_maxWordLength) {
+20
View File
@@ -1,3 +1,22 @@
/* Copyright (C) 2004-2019 J.F.Dockes
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "autoconfig.h"
#include "utf8fn.h"
#include "rclconfig.h"
#include "transcode.h"
@@ -9,6 +28,7 @@ string compute_utf8fn(const RclConfig *config, const string& ifn, bool simple)
{
string lfn(simple ? path_getsimple(ifn) : ifn);
#ifdef _WIN32
PRETEND_USE(config);
// On windows file names are read as UTF16 wchar_t and converted to UTF-8
// while scanning directories
return lfn;