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
+1 -1
View File
@@ -388,7 +388,7 @@ int Query::Native::abstractFromText(
Xapian::docid docid,
const vector<string>& matchTerms,
const multimap<double, vector<string>> byQ,
double totalweight,
double,
int ctxwords,
unsigned int maxtotaloccs,
vector<Snippet>& vabs,
+1 -1
View File
@@ -502,7 +502,7 @@ void Query::Native::abstractCreateSnippetsVector(
int Query::Native::abstractFromIndex(
Rcl::Db::Native *ndb,
Xapian::docid docid,
const vector<string>& matchTerms,
const vector<string>&,
const multimap<double, vector<string>> byQ,
double totalweight,
int ctxwords,
+1 -1
View File
@@ -1701,7 +1701,7 @@ bool Db::addOrUpdate(const string &udi, const string &parent_udi, Doc &doc)
// won't work).
time_t mtime = atoll(doc.dmtime.empty() ? doc.fmtime.c_str() :
doc.dmtime.c_str());
struct tm tmb;
struct tm tmb{0};
localtime_r(&mtime, &tmb);
char buf[50]; // It's actually 9, but use 50 to suppress warnings.
snprintf(buf, 50, "%04d%02d%02d",
+1 -1
View File
@@ -334,7 +334,7 @@ bool Db::termMatch(int typ_sens, const string &lang, const string &_term,
}
bool Db::Native::idxTermMatch_p(
int typ, const string &lang, const string &root,
int typ, const string&, const string& root,
std::function<bool(const string& term,
Xapian::termcount colfreq,
Xapian::doccount termfreq)> client,
+4 -4
View File
@@ -113,8 +113,8 @@ public:
const std::string& getStemLang() {return m_stemlang;}
void setMinSize(size_t size) {m_minSize = size;}
void setMaxSize(size_t size) {m_maxSize = size;}
void setMinSize(int64_t size) {m_minSize = size;}
void setMaxSize(int64_t size) {m_maxSize = size;}
/** Set date span for filtering results */
void setDateSpan(DateInterval *dip) {m_dates = *dip; m_haveDates = true;}
@@ -179,8 +179,8 @@ private:
// something else (date and size specs)
bool m_haveDates;
DateInterval m_dates; // Restrict to date interval
size_t m_maxSize;
size_t m_minSize;
int64_t m_maxSize;
int64_t m_minSize;
// Printable expanded version of the complete query, retrieved/set
// from rcldb after the Xapian::setQuery() call
+4 -4
View File
@@ -218,15 +218,15 @@ bool SearchData::toNativeQuery(Rcl::Db &db, void *d)
}
if (m_minSize != size_t(-1) || m_maxSize != size_t(-1)) {
if (m_minSize != -1 || m_maxSize != -1) {
Xapian::Query sq;
string min = lltodecstr(m_minSize);
string max = lltodecstr(m_maxSize);
if (m_minSize == size_t(-1)) {
if (m_minSize == -1) {
string value(max);
leftzeropad(value, 12);
sq = Xapian::Query(Xapian::Query::OP_VALUE_LE, VALUE_SIZE, value);
} else if (m_maxSize == size_t(-1)) {
} else if (m_maxSize == -1) {
string value(min);
leftzeropad(value, 12);
sq = Xapian::Query(Xapian::Query::OP_VALUE_GE, VALUE_SIZE, value);
@@ -331,7 +331,7 @@ public:
m_ts = ts;
}
bool takeword(const std::string &term, int pos, int bs, int be) {
bool takeword(const std::string &term, int pos, int, int be) {
m_alltermcount++;
if (m_lastpos < pos)
m_lastpos = pos;