From 39c152bada5854b9d73aea154d098a1c8c638017 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Fri, 17 Apr 2020 14:26:40 +0100 Subject: [PATCH] Fixed MSVC warnings, all inocuous --- src/bincimapmime/mime-parseonlyheader.cc | 7 +- src/bincimapmime/mime.h | 247 +++++++++++------------ src/common/conf_post.h | 2 + src/common/rclconfig.cpp | 4 +- src/common/rclinit.cpp | 2 +- src/common/textsplit.cpp | 6 + src/common/utf8fn.cpp | 20 ++ src/index/checkretryfailed.cpp | 1 + src/index/exefetcher.cpp | 4 +- src/index/fetcher.h | 2 +- src/index/idxstatus.cpp | 10 +- src/index/mimetype.cpp | 2 + src/index/recollindex.cpp | 6 +- src/index/webqueue.h | 2 +- src/index/webqueuefetcher.cpp | 2 +- src/internfile/extrameta.cpp | 4 + src/internfile/htmlparse.cpp | 2 +- src/internfile/internfile.cpp | 4 +- src/internfile/mh_exec.cpp | 1 + src/internfile/mh_html.cpp | 2 +- src/internfile/mh_mail.cpp | 4 +- src/internfile/mh_mbox.cpp | 6 +- src/internfile/mh_null.h | 2 +- src/internfile/mh_symlink.h | 2 +- src/internfile/mh_text.cpp | 4 +- src/internfile/mh_unknown.h | 2 +- src/internfile/mh_xslt.cpp | 9 +- src/query/recollq.cpp | 2 +- src/query/wasaparse.cpp | 2 +- src/query/wasaparse.ypp | 2 +- src/query/wasaparseaux.cpp | 12 +- src/query/wasaparserdriver.h | 4 +- src/rcldb/rclabsfromtext.cpp | 2 +- src/rcldb/rclabstract.cpp | 2 +- src/rcldb/rcldb.cpp | 2 +- src/rcldb/rclterms.cpp | 2 +- src/rcldb/searchdata.h | 8 +- src/rcldb/searchdatatox.cpp | 8 +- src/utils/chrono.cpp | 34 ++-- src/utils/chrono.h | 15 +- src/utils/circache.cpp | 7 +- src/utils/cmdtalk.cpp | 2 +- src/utils/dlib.cpp | 2 +- src/utils/fstreewalk.cpp | 2 +- src/utils/pathut.cpp | 1 + src/utils/rclutil.cpp | 3 +- src/utils/readfile.cpp | 11 +- src/utils/smallut.cpp | 2 +- src/windows/qmkrecoll/librecoll.pro | 2 - 49 files changed, 262 insertions(+), 224 deletions(-) diff --git a/src/bincimapmime/mime-parseonlyheader.cc b/src/bincimapmime/mime-parseonlyheader.cc index 7470fa43..fc15a461 100644 --- a/src/bincimapmime/mime-parseonlyheader.cc +++ b/src/bincimapmime/mime-parseonlyheader.cc @@ -63,7 +63,7 @@ void Binc::MimeDocument::parseOnlyHeader(int fd) nlines = 0; nbodylines = 0; - doParseOnlyHeader(doc_mimeSource, ""); + doParseOnlyHeader(doc_mimeSource); } void Binc::MimeDocument::parseOnlyHeader(istream& s) @@ -86,12 +86,11 @@ void Binc::MimeDocument::parseOnlyHeader(istream& s) nlines = 0; nbodylines = 0; - doParseOnlyHeader(doc_mimeSource, ""); + doParseOnlyHeader(doc_mimeSource); } //------------------------------------------------------------------------ -int Binc::MimePart::doParseOnlyHeader(MimeInputSource *ms, - const string &toboundary) +int Binc::MimePart::doParseOnlyHeader(MimeInputSource *ms) { mimeSource = ms; string name; diff --git a/src/bincimapmime/mime.h b/src/bincimapmime/mime.h index 182c99fe..9a7cbf01 100644 --- a/src/bincimapmime/mime.h +++ b/src/bincimapmime/mime.h @@ -32,155 +32,154 @@ namespace Binc { - class MimeInputSource; +class MimeInputSource; - //---------------------------------------------------------------------- - class HeaderItem { - private: - mutable std::string key; - mutable std::string value; +//---------------------------------------------------------------------- +class HeaderItem { +private: + mutable std::string key; + mutable std::string value; - public: - inline const std::string &getKey(void) const { return key; } - inline const std::string &getValue(void) const { return value; } +public: + inline const std::string &getKey(void) const { return key; } + inline const std::string &getValue(void) const { return value; } - //-- - HeaderItem(void); - HeaderItem(const std::string &key, const std::string &value); + //-- + HeaderItem(void); + HeaderItem(const std::string &key, const std::string &value); +}; + +//---------------------------------------------------------------------- +class Header { +private: + mutable std::vector content; + +public: + bool getFirstHeader(const std::string &key, HeaderItem &dest) const; + bool getAllHeaders(const std::string &key, std::vector &dest) const; + void add(const std::string &name, const std::string &content); + void clear(void); + + //-- + Header(void); + ~Header(void); +}; + +//---------------------------------------------------------------------- +class IODevice; +class MimeDocument; +class MimePart { +protected: +public: + mutable bool multipart; + mutable bool messagerfc822; + mutable std::string subtype; + mutable std::string boundary; + + mutable unsigned int headerstartoffsetcrlf; + mutable unsigned int headerlength; + + mutable unsigned int bodystartoffsetcrlf; + mutable unsigned int bodylength; + mutable unsigned int nlines; + mutable unsigned int nbodylines; + mutable unsigned int size; + +public: + enum FetchType { + FetchBody, + FetchHeader, + FetchMime }; - //---------------------------------------------------------------------- - class Header { - private: - mutable std::vector content; + mutable Header h; - public: - bool getFirstHeader(const std::string &key, HeaderItem &dest) const; - bool getAllHeaders(const std::string &key, std::vector &dest) const; - void add(const std::string &name, const std::string &content); - void clear(void); + mutable std::vector members; - //-- - Header(void); - ~Header(void); - }; + inline const std::string &getSubType(void) const { return subtype; } + inline bool isMultipart(void) const { return multipart; } + inline bool isMessageRFC822(void) const { return messagerfc822; } + inline unsigned int getSize(void) const { return bodylength; } + inline unsigned int getNofLines(void) const { return nlines; } + inline unsigned int getNofBodyLines(void) const { return nbodylines; } + inline unsigned int getBodyLength(void) const { return bodylength; } + inline unsigned int getBodyStartOffset(void) const { return bodystartoffsetcrlf; } - //---------------------------------------------------------------------- - class IODevice; - class MimeDocument; - class MimePart { - protected: - public: - mutable bool multipart; - mutable bool messagerfc822; - mutable std::string subtype; - mutable std::string boundary; + void printBody(Binc::IODevice &output, unsigned int startoffset, unsigned int length) const; + void getBody(std::string& s, unsigned int startoffset, unsigned int length) const; + virtual void clear(void); - mutable unsigned int headerstartoffsetcrlf; - mutable unsigned int headerlength; + virtual int doParseOnlyHeader(MimeInputSource *ms); + virtual int doParseFull(MimeInputSource *ms, + const std::string &toboundary, int &boundarysize); - mutable unsigned int bodystartoffsetcrlf; - mutable unsigned int bodylength; - mutable unsigned int nlines; - mutable unsigned int nbodylines; - mutable unsigned int size; + MimePart(void); + virtual ~MimePart(void); - public: - enum FetchType { - FetchBody, - FetchHeader, - FetchMime - }; +private: + MimeInputSource *mimeSource; - mutable Header h; + bool parseOneHeaderLine(Binc::Header *header, unsigned int *nlines); - mutable std::vector members; + bool skipUntilBoundary(const std::string &delimiter, + unsigned int *nlines, bool *eof); + inline void postBoundaryProcessing(bool *eof, + unsigned int *nlines, + int *boundarysize, + bool *foundendofpart); + void parseMultipart(const std::string &boundary, + const std::string &toboundary, + bool *eof, + unsigned int *nlines, + int *boundarysize, + bool *foundendofpart, + unsigned int *bodylength, + std::vector *members); + void parseSinglePart(const std::string &toboundary, + int *boundarysize, + unsigned int *nbodylines, + unsigned int *nlines, + bool *eof, bool *foundendofpart, + unsigned int *bodylength); + void parseHeader(Binc::Header *header, unsigned int *nlines); + void analyzeHeader(Binc::Header *header, bool *multipart, + bool *messagerfc822, std::string *subtype, + std::string *boundary); + void parseMessageRFC822(std::vector *members, + bool *foundendofpart, + unsigned int *bodylength, + unsigned int *nbodylines, + const std::string &toboundary); +}; - inline const std::string &getSubType(void) const { return subtype; } - inline bool isMultipart(void) const { return multipart; } - inline bool isMessageRFC822(void) const { return messagerfc822; } - inline unsigned int getSize(void) const { return bodylength; } - inline unsigned int getNofLines(void) const { return nlines; } - inline unsigned int getNofBodyLines(void) const { return nbodylines; } - inline unsigned int getBodyLength(void) const { return bodylength; } - inline unsigned int getBodyStartOffset(void) const { return bodystartoffsetcrlf; } +//---------------------------------------------------------------------- +class MimeDocument : public MimePart { +public: + MimeDocument(void); + ~MimeDocument(void); - void printBody(Binc::IODevice &output, unsigned int startoffset, unsigned int length) const; - void getBody(std::string& s, unsigned int startoffset, unsigned int length) const; - virtual void clear(void); + void parseOnlyHeader(int fd); + void parseFull(int fd); + void parseOnlyHeader(std::istream& s); + void parseFull(std::istream& s); - virtual int doParseOnlyHeader(MimeInputSource *ms, - const std::string &toboundary); - virtual int doParseFull(MimeInputSource *ms, - const std::string &toboundary, int &boundarysize); - - MimePart(void); - virtual ~MimePart(void); - - private: - MimeInputSource *mimeSource; - - bool parseOneHeaderLine(Binc::Header *header, unsigned int *nlines); - - bool skipUntilBoundary(const std::string &delimiter, - unsigned int *nlines, bool *eof); - inline void postBoundaryProcessing(bool *eof, - unsigned int *nlines, - int *boundarysize, - bool *foundendofpart); - void parseMultipart(const std::string &boundary, - const std::string &toboundary, - bool *eof, - unsigned int *nlines, - int *boundarysize, - bool *foundendofpart, - unsigned int *bodylength, - std::vector *members); - void parseSinglePart(const std::string &toboundary, - int *boundarysize, - unsigned int *nbodylines, - unsigned int *nlines, - bool *eof, bool *foundendofpart, - unsigned int *bodylength); - void parseHeader(Binc::Header *header, unsigned int *nlines); - void analyzeHeader(Binc::Header *header, bool *multipart, - bool *messagerfc822, std::string *subtype, - std::string *boundary); - void parseMessageRFC822(std::vector *members, - bool *foundendofpart, - unsigned int *bodylength, - unsigned int *nbodylines, - const std::string &toboundary); - }; - - //---------------------------------------------------------------------- - class MimeDocument : public MimePart { - public: - MimeDocument(void); - ~MimeDocument(void); - - void parseOnlyHeader(int fd); - void parseFull(int fd); - void parseOnlyHeader(std::istream& s); - void parseFull(std::istream& s); - - void clear(void); + void clear(void); - bool isHeaderParsed(void) const + bool isHeaderParsed(void) const { return headerIsParsed; } - bool isAllParsed(void) const + bool isAllParsed(void) const { return allIsParsed; } - private: - bool headerIsParsed; - bool allIsParsed; - MimeInputSource *doc_mimeSource; - }; +private: + bool headerIsParsed; + bool allIsParsed; + MimeInputSource *doc_mimeSource; +}; }; diff --git a/src/common/conf_post.h b/src/common/conf_post.h index 1b55c826..578a85f7 100644 --- a/src/common/conf_post.h +++ b/src/common/conf_post.h @@ -50,3 +50,5 @@ typedef int ssize_t; #define lstat stat #endif // _WIN32 + +#define PRETEND_USE(expr) ((void)(expr)) diff --git a/src/common/rclconfig.cpp b/src/common/rclconfig.cpp index 8c90fb26..a08e8585 100644 --- a/src/common/rclconfig.cpp +++ b/src/common/rclconfig.cpp @@ -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( diff --git a/src/common/rclinit.cpp b/src/common/rclinit.cpp index e5eed5e2..8224fc8d 100644 --- a/src/common/rclinit.cpp +++ b/src/common/rclinit.cpp @@ -224,7 +224,7 @@ bool CreateInvisibleWindow() return TRUE; } -DWORD WINAPI RunInvisibleWindowThread(LPVOID lpParam) +DWORD WINAPI RunInvisibleWindowThread(LPVOID) { MSG msg; CreateInvisibleWindow(); diff --git a/src/common/textsplit.cpp b/src/common/textsplit.cpp index 1c782fca..3a515466 100644 --- a/src/common/textsplit.cpp +++ b/src/common/textsplit.cpp @@ -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) { diff --git a/src/common/utf8fn.cpp b/src/common/utf8fn.cpp index c3a52985..75b2b60f 100644 --- a/src/common/utf8fn.cpp +++ b/src/common/utf8fn.cpp @@ -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; diff --git a/src/index/checkretryfailed.cpp b/src/index/checkretryfailed.cpp index f733e824..eafef967 100644 --- a/src/index/checkretryfailed.cpp +++ b/src/index/checkretryfailed.cpp @@ -34,6 +34,7 @@ using namespace std; bool checkRetryFailed(RclConfig *conf, bool record) { #ifdef _WIN32 + PRETEND_USE(record); // Under Windows we only retry if the recollindex program is newer // than the index struct PathStat st; diff --git a/src/index/exefetcher.cpp b/src/index/exefetcher.cpp index 9e34c83e..3c404b48 100644 --- a/src/index/exefetcher.cpp +++ b/src/index/exefetcher.cpp @@ -65,13 +65,13 @@ EXEDocFetcher::EXEDocFetcher(const EXEDocFetcher::Internal& _m) stringsToString(m->sfetch) << "\n"); } -bool EXEDocFetcher::fetch(RclConfig* cnf, const Rcl::Doc& idoc, RawDoc& out) +bool EXEDocFetcher::fetch(RclConfig*, const Rcl::Doc& idoc, RawDoc& out) { out.kind = RawDoc::RDK_DATADIRECT; return m->docmd(m->sfetch, idoc, out.data); } -bool EXEDocFetcher::makesig(RclConfig* cnf, const Rcl::Doc& idoc, string& sig) +bool EXEDocFetcher::makesig(RclConfig*, const Rcl::Doc& idoc, string& sig) { return m->docmd(m->smkid, idoc, sig); } diff --git a/src/index/fetcher.h b/src/index/fetcher.h index 2ac1bfef..f42f8603 100644 --- a/src/index/fetcher.h +++ b/src/index/fetcher.h @@ -75,7 +75,7 @@ public: virtual bool makesig(RclConfig* cnf, const Rcl::Doc& idoc, std::string& sig) = 0; enum Reason{FetchOk, FetchNotExist, FetchNoPerm, FetchOther}; - virtual Reason testAccess(RclConfig* cnf, const Rcl::Doc& idoc) { + virtual Reason testAccess(RclConfig*, const Rcl::Doc&) { return FetchOther; } virtual ~DocFetcher() {} diff --git a/src/index/idxstatus.cpp b/src/index/idxstatus.cpp index d798b122..63596c8f 100644 --- a/src/index/idxstatus.cpp +++ b/src/index/idxstatus.cpp @@ -26,10 +26,10 @@ void readIdxStatus(RclConfig *config, DbIxStatus &status) ConfSimple cs(config->getIdxStatusFile().c_str(), 1); status.phase = DbIxStatus::Phase(cs.getInt("phase", 0)); cs.get("fn", status.fn); - status.docsdone = cs.getInt("docsdone", 0); - status.filesdone = cs.getInt("filesdone", 0); - status.fileerrors = cs.getInt("fileerrors", 0); - status.dbtotdocs = cs.getInt("dbtotdocs", 0); - status.totfiles = cs.getInt("totfiles", 0); + status.docsdone = (int)cs.getInt("docsdone", 0); + status.filesdone = (int)cs.getInt("filesdone", 0); + status.fileerrors = (int)cs.getInt("fileerrors", 0); + status.dbtotdocs = (int)cs.getInt("dbtotdocs", 0); + status.totfiles = (int)cs.getInt("totfiles", 0); status.hasmonitor = cs.getBool("hasmonitor", false); } diff --git a/src/index/mimetype.cpp b/src/index/mimetype.cpp index 321303c6..b20c55df 100644 --- a/src/index/mimetype.cpp +++ b/src/index/mimetype.cpp @@ -48,6 +48,8 @@ using namespace std; static string mimetypefromdata(RclConfig *cfg, const string &fn, bool usfc) { LOGDEB1("mimetypefromdata: fn [" << fn << "]\n"); + PRETEND_USE(usfc); + PRETEND_USE(cfg); // First try the internal identifying routine string mime = idFile(fn.c_str()); diff --git a/src/index/recollindex.cpp b/src/index/recollindex.cpp index fb83c998..75fddc5b 100644 --- a/src/index/recollindex.cpp +++ b/src/index/recollindex.cpp @@ -229,6 +229,7 @@ static void makeIndexerOrExit(RclConfig *config, bool inPlaceReset) void rclIxIonice(const RclConfig *config) { + PRETEND_USE(config); #ifndef _WIN32 string clss, classdata; if (!config->getConfParam("monioniceclass", clss) || clss.empty()) @@ -241,6 +242,7 @@ void rclIxIonice(const RclConfig *config) static void setMyPriority(const RclConfig *config) { + PRETEND_USE(config); #ifndef _WIN32 int prio{19}; std::string sprio; @@ -474,8 +476,7 @@ static const char usage [] = " -c : specify config directory, overriding $RECOLL_CONFDIR\n" ; -static void -Usage(FILE *where = stderr) +static void Usage() { FILE *fp = (op_flags & OPT_h) ? stdout : stderr; fprintf(fp, "%s: Usage: %s", path_getsimple(thisprog).c_str(), usage); @@ -487,6 +488,7 @@ static RclConfig *config; static void lockorexit(Pidfile *pidfile, RclConfig *config) { + PRETEND_USE(config); pid_t pid; if ((pid = pidfile->open()) != 0) { if (pid > 0) { diff --git a/src/index/webqueue.h b/src/index/webqueue.h index 56573085..62d59bac 100644 --- a/src/index/webqueue.h +++ b/src/index/webqueue.h @@ -58,7 +58,7 @@ public: /** Purge a list of files. No way to do this currently and dont want * to do anything as this is mostly called by the monitor when *I* delete * files inside the queue dir */ - bool purgeFiles(std::list& files) {return true;} + bool purgeFiles(std::list&) {return true;} /** Called when indexing data from the cache, and from internfile for * search result preview */ diff --git a/src/index/webqueuefetcher.cpp b/src/index/webqueuefetcher.cpp index 4f140813..2f162128 100644 --- a/src/index/webqueuefetcher.cpp +++ b/src/index/webqueuefetcher.cpp @@ -58,7 +58,7 @@ bool WQDocFetcher::fetch(RclConfig* cnf, const Rcl::Doc& idoc, RawDoc& out) return true; } -bool WQDocFetcher::makesig(RclConfig* cnf, const Rcl::Doc& idoc, string& sig) +bool WQDocFetcher::makesig(RclConfig*, const Rcl::Doc&, string& sig) { // Web queue sigs are empty sig.clear(); diff --git a/src/internfile/extrameta.cpp b/src/internfile/extrameta.cpp index b848704d..8d658c48 100644 --- a/src/internfile/extrameta.cpp +++ b/src/internfile/extrameta.cpp @@ -85,6 +85,10 @@ void reapXAttrs(const RclConfig* cfg, const string& path, xfields[key] = value; LOGDEB2("reapXAttrs: [" << key << "] -> [" << value << "]\n"); } +#else + PRETEND_USE(cfg); + PRETEND_USE(path); + PRETEND_USE(xfields); #endif } diff --git a/src/internfile/htmlparse.cpp b/src/internfile/htmlparse.cpp index 93d67060..48a1373a 100644 --- a/src/internfile/htmlparse.cpp +++ b/src/internfile/htmlparse.cpp @@ -112,7 +112,7 @@ HtmlParser::HtmlParser() } void -HtmlParser::decode_entities(string &s) +HtmlParser::decode_entities(string &) { // Not used for recoll. Kept here to minimize the amount of // diffs. Almost the same code in myhtmlparse except that the diff --git a/src/internfile/internfile.cpp b/src/internfile/internfile.cpp index 03ff75e4..5d05cd2f 100644 --- a/src/internfile/internfile.cpp +++ b/src/internfile/internfile.cpp @@ -271,8 +271,8 @@ FileInterner::FileInterner(const string &data, RclConfig *cnf, init(data, cnf, flags, imime); } -void FileInterner::init(const string &data, RclConfig *cnf, - int flags, const string& imime) +void FileInterner::init(const string &data, RclConfig *, + int, const string& imime) { if (imime.empty()) { LOGERR("FileInterner: inmemory constructor needs input mime type\n"); diff --git a/src/internfile/mh_exec.cpp b/src/internfile/mh_exec.cpp index 6be777f4..1d35ceef 100644 --- a/src/internfile/mh_exec.cpp +++ b/src/internfile/mh_exec.cpp @@ -47,6 +47,7 @@ void MEAdv::reset() void MEAdv::newData(int n) { + PRETEND_USE(n); LOGDEB2("MHExec:newData(" << n << ")\n"); if (m_filtermaxseconds > 0 && time(0L) - m_start > m_filtermaxseconds) { diff --git a/src/internfile/mh_html.cpp b/src/internfile/mh_html.cpp index 4cc81ba9..d6d60f9e 100644 --- a/src/internfile/mh_html.cpp +++ b/src/internfile/mh_html.cpp @@ -44,7 +44,7 @@ bool MimeHandlerHtml::set_document_file_impl(const string& mt, const string &fn) return set_document_string(mt, otext); } -bool MimeHandlerHtml::set_document_string_impl(const string& mt, +bool MimeHandlerHtml::set_document_string_impl(const string&, const string& htext) { m_html = htext; diff --git a/src/internfile/mh_mail.cpp b/src/internfile/mh_mail.cpp index 0a23bea7..148115d9 100644 --- a/src/internfile/mh_mail.cpp +++ b/src/internfile/mh_mail.cpp @@ -85,7 +85,7 @@ void MimeHandlerMail::clear_impl() m_attachments.clear(); } -bool MimeHandlerMail::set_document_file_impl(const string& mt, const string &fn) +bool MimeHandlerMail::set_document_file_impl(const string&, const string &fn) { LOGDEB("MimeHandlerMail::set_document_file(" << fn << ")\n"); if (m_fd >= 0) { @@ -125,7 +125,7 @@ bool MimeHandlerMail::set_document_file_impl(const string& mt, const string &fn) return true; } -bool MimeHandlerMail::set_document_string_impl(const string& mt, +bool MimeHandlerMail::set_document_string_impl(const string&, const string& msgtxt) { LOGDEB1("MimeHandlerMail::set_document_string\n"); diff --git a/src/internfile/mh_mbox.cpp b/src/internfile/mh_mbox.cpp index 1a039ecf..a70a81fe 100644 --- a/src/internfile/mh_mbox.cpp +++ b/src/internfile/mh_mbox.cpp @@ -324,7 +324,9 @@ void MimeHandlerMbox::clear_impl() m->fn.erase(); m->ipath.erase(); m->instream = ifstream(); - m->msgnum = m->lineno = m->fsize = 0; + m->msgnum = 0; + m->lineno = 0; + m->fsize = 0; m->offsets.clear(); m->quirks = 0; } @@ -334,7 +336,7 @@ bool MimeHandlerMbox::skip_to_document(const std::string& ipath) { return true; } -bool MimeHandlerMbox::set_document_file_impl(const string& mt, const string &fn) +bool MimeHandlerMbox::set_document_file_impl(const string&, const string &fn) { LOGDEB("MimeHandlerMbox::set_document_file(" << fn << ")\n"); clear_impl(); diff --git a/src/internfile/mh_null.h b/src/internfile/mh_null.h index 4e0a47a2..648a9594 100644 --- a/src/internfile/mh_null.h +++ b/src/internfile/mh_null.h @@ -39,7 +39,7 @@ class MimeHandlerNull : public RecollFilter { } virtual ~MimeHandlerNull() {} - virtual bool is_data_input_ok(DataInput input) const { + virtual bool is_data_input_ok(DataInput) const { return true; } diff --git a/src/internfile/mh_symlink.h b/src/internfile/mh_symlink.h index 544ab21b..c35bfb54 100644 --- a/src/internfile/mh_symlink.h +++ b/src/internfile/mh_symlink.h @@ -60,7 +60,7 @@ class MimeHandlerSymlink : public RecollFilter { return true; } protected: - virtual bool set_document_file_impl(const string& mt, const string& fn) { + virtual bool set_document_file_impl(const string&, const string& fn) { m_fn = fn; return m_havedoc = true; } diff --git a/src/internfile/mh_text.cpp b/src/internfile/mh_text.cpp index 5dd0e8a7..13e9f64c 100644 --- a/src/internfile/mh_text.cpp +++ b/src/internfile/mh_text.cpp @@ -40,7 +40,7 @@ const int MB = 1024*1024; const int KB = 1024; // Process a plain text file -bool MimeHandlerText::set_document_file_impl(const string& mt, const string &fn) +bool MimeHandlerText::set_document_file_impl(const string&, const string &fn) { LOGDEB("MimeHandlerText::set_document_file: [" << fn << "] offs " << m_offs << "\n"); @@ -94,7 +94,7 @@ bool MimeHandlerText::set_document_file_impl(const string& mt, const string &fn) return true; } -bool MimeHandlerText::set_document_string_impl(const string& mt, +bool MimeHandlerText::set_document_string_impl(const string&, const string& otext) { m_text = otext; diff --git a/src/internfile/mh_unknown.h b/src/internfile/mh_unknown.h index 5463cd86..9f17fb96 100644 --- a/src/internfile/mh_unknown.h +++ b/src/internfile/mh_unknown.h @@ -32,7 +32,7 @@ class MimeHandlerUnknown : public RecollFilter { : RecollFilter(cnf, id) { } virtual ~MimeHandlerUnknown() {} - virtual bool is_data_input_ok(DataInput input) const { + virtual bool is_data_input_ok(DataInput) const { return true; } diff --git a/src/internfile/mh_xslt.cpp b/src/internfile/mh_xslt.cpp index 26a02782..5afdf19d 100644 --- a/src/internfile/mh_xslt.cpp +++ b/src/internfile/mh_xslt.cpp @@ -71,8 +71,7 @@ public: return ctxt->myDoc; } - virtual bool init(int64_t size, string *) { - LOGDEB1("FileScanXML: init: size " << size << endl); + virtual bool init(int64_t, string *) { ctxt = xmlCreatePushParserCtxt(NULL, NULL, NULL, 0, m_fn.c_str()); if (ctxt == nullptr) { LOGERR("FileScanXML: xmlCreatePushParserCtxt failed\n"); @@ -276,8 +275,7 @@ bool MimeHandlerXslt::Internal::process_doc_or_string( return true; } -bool MimeHandlerXslt::set_document_file_impl(const std::string& mt, - const std::string &fn) +bool MimeHandlerXslt::set_document_file_impl(const string&, const string &fn) { LOGDEB0("MimeHandlerXslt::set_document_file_: fn: " << fn << endl); if (!m || !m->ok) { @@ -290,8 +288,7 @@ bool MimeHandlerXslt::set_document_file_impl(const std::string& mt, return ret; } -bool MimeHandlerXslt::set_document_string_impl(const string& mt, - const string& txt) +bool MimeHandlerXslt::set_document_string_impl(const string&, const string& txt) { LOGDEB0("MimeHandlerXslt::set_document_string_\n"); if (!m || !m->ok) { diff --git a/src/query/recollq.cpp b/src/query/recollq.cpp index 0e5bbca2..645b1973 100644 --- a/src/query/recollq.cpp +++ b/src/query/recollq.cpp @@ -57,7 +57,7 @@ bool dump_contents(RclConfig *rclconfig, Rcl::Doc& idoc) } void output_fields(vector fields, Rcl::Doc& doc, - Rcl::Query& query, Rcl::Db& rcldb, bool printnames) + Rcl::Query& query, Rcl::Db&, bool printnames) { if (fields.empty()) { map::const_iterator it; diff --git a/src/query/wasaparse.cpp b/src/query/wasaparse.cpp index 9e9a4098..1e7efa4d 100644 --- a/src/query/wasaparse.cpp +++ b/src/query/wasaparse.cpp @@ -60,7 +60,7 @@ int yylex(yy::parser::semantic_type *, yy::parser::location_type *, void yyerror(char const *); static void qualify(Rcl::SearchDataClauseDist *, const string &); -static void addSubQuery(WasaParserDriver *d, +static void addSubQuery(WasaParserDriver *, Rcl::SearchData *sd, Rcl::SearchData *sq) { if (sd && sq) diff --git a/src/query/wasaparse.ypp b/src/query/wasaparse.ypp index 418bc604..b0434e45 100644 --- a/src/query/wasaparse.ypp +++ b/src/query/wasaparse.ypp @@ -25,7 +25,7 @@ int yylex(yy::parser::semantic_type *, yy::parser::location_type *, void yyerror(char const *); static void qualify(Rcl::SearchDataClauseDist *, const string &); -static void addSubQuery(WasaParserDriver *d, +static void addSubQuery(WasaParserDriver *, Rcl::SearchData *sd, Rcl::SearchData *sq) { if (sd && sq) diff --git a/src/query/wasaparseaux.cpp b/src/query/wasaparseaux.cpp index 436b0520..40affbe5 100644 --- a/src/query/wasaparseaux.cpp +++ b/src/query/wasaparseaux.cpp @@ -33,7 +33,7 @@ using namespace Rcl; void -yy::parser::error (const location_type& l, const std::string& m) +yy::parser::error (const location_type&, const std::string& m) { d->setreason(m); } @@ -55,7 +55,7 @@ WasaParserDriver::WasaParserDriver(const RclConfig *c, const std::string sl, const std::string& as) : m_stemlang(sl), m_autosuffs(as), m_config(c), m_index(0), m_result(0), m_haveDates(false), - m_maxSize((size_t)-1), m_minSize((size_t)-1) + m_maxSize(-1), m_minSize(-1) { } @@ -95,10 +95,10 @@ SearchData *WasaParserDriver::parse(const std::string& in) if (m_haveDates) { m_result->setDateSpan(&m_dates); } - if (m_minSize != (size_t)-1) { + if (m_minSize != -1) { m_result->setMinSize(m_minSize); } - if (m_maxSize != (size_t)-1) { + if (m_maxSize != -1) { m_result->setMaxSize(m_maxSize); } //if (m_result) m_result->dump(cout); @@ -193,13 +193,13 @@ bool WasaParserDriver::addClause(SearchData *sd, // Handle "size" spec if (!fld.compare("size")) { char *cp; - size_t size = strtoll(cl->gettext().c_str(), &cp, 10); + int64_t size = strtoll(cl->gettext().c_str(), &cp, 10); if (*cp != 0) { switch (*cp) { case 'k': case 'K': size *= 1000;break; case 'm': case 'M': size *= 1000*1000;break; case 'g': case 'G': size *= 1000*1000*1000;break; - case 't': case 'T': size *= size_t(1000)*1000*1000*1000;break; + case 't': case 'T': size *= int64_t(1000)*1000*1000*1000;break; default: m_reason = string("Bad multiplier suffix: ") + *cp; delete cl; diff --git a/src/query/wasaparserdriver.h b/src/query/wasaparserdriver.h index 26061a72..7c75a921 100644 --- a/src/query/wasaparserdriver.h +++ b/src/query/wasaparserdriver.h @@ -78,8 +78,8 @@ private: std::vector m_nfiletypes; 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; std::string m_reason; diff --git a/src/rcldb/rclabsfromtext.cpp b/src/rcldb/rclabsfromtext.cpp index 28aab57b..a78c62ca 100644 --- a/src/rcldb/rclabsfromtext.cpp +++ b/src/rcldb/rclabsfromtext.cpp @@ -388,7 +388,7 @@ int Query::Native::abstractFromText( Xapian::docid docid, const vector& matchTerms, const multimap> byQ, - double totalweight, + double, int ctxwords, unsigned int maxtotaloccs, vector& vabs, diff --git a/src/rcldb/rclabstract.cpp b/src/rcldb/rclabstract.cpp index 6f333eba..a3e825d5 100644 --- a/src/rcldb/rclabstract.cpp +++ b/src/rcldb/rclabstract.cpp @@ -502,7 +502,7 @@ void Query::Native::abstractCreateSnippetsVector( int Query::Native::abstractFromIndex( Rcl::Db::Native *ndb, Xapian::docid docid, - const vector& matchTerms, + const vector&, const multimap> byQ, double totalweight, int ctxwords, diff --git a/src/rcldb/rcldb.cpp b/src/rcldb/rcldb.cpp index 28202a23..913ee19f 100644 --- a/src/rcldb/rcldb.cpp +++ b/src/rcldb/rcldb.cpp @@ -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", diff --git a/src/rcldb/rclterms.cpp b/src/rcldb/rclterms.cpp index fe27eeba..5faa919e 100644 --- a/src/rcldb/rclterms.cpp +++ b/src/rcldb/rclterms.cpp @@ -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 client, diff --git a/src/rcldb/searchdata.h b/src/rcldb/searchdata.h index cfca30c2..654ae7af 100644 --- a/src/rcldb/searchdata.h +++ b/src/rcldb/searchdata.h @@ -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 diff --git a/src/rcldb/searchdatatox.cpp b/src/rcldb/searchdatatox.cpp index 1683db11..8fb788d0 100644 --- a/src/rcldb/searchdatatox.cpp +++ b/src/rcldb/searchdatatox.cpp @@ -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; diff --git a/src/utils/chrono.cpp b/src/utils/chrono.cpp index 0c5863cc..0ab8d4e6 100644 --- a/src/utils/chrono.cpp +++ b/src/utils/chrono.cpp @@ -17,11 +17,11 @@ #ifndef TEST_CHRONO #include "autoconfig.h" +#include "chrono.h" + #include #include -#include "chrono.h" - using namespace std; #ifndef CLOCK_REALTIME @@ -31,19 +31,19 @@ typedef int clockid_t; #define SECONDS(TS1, TS2) \ - (float((TS2).tv_sec - (TS1).tv_sec) + \ - float((TS2).tv_nsec - (TS1).tv_nsec) * 1e-9) + (double((TS2).tv_sec - (TS1).tv_sec) + \ + double((TS2).tv_nsec - (TS1).tv_nsec) * 1e-9) #define MILLIS(TS1, TS2) \ - ((long long)((TS2).tv_sec - (TS1).tv_sec) * 1000LL + \ + ((int64_t)((TS2).tv_sec - (TS1).tv_sec) * 1000LL + \ ((TS2).tv_nsec - (TS1).tv_nsec) / 1000000) #define MICROS(TS1, TS2) \ - ((long long)((TS2).tv_sec - (TS1).tv_sec) * 1000000LL + \ + ((int64_t)((TS2).tv_sec - (TS1).tv_sec) * 1000000LL + \ ((TS2).tv_nsec - (TS1).tv_nsec) / 1000) #define NANOS(TS1, TS2) \ - ((long long)((TS2).tv_sec - (TS1).tv_sec) * 1000000000LL + \ + ((int64_t)((TS2).tv_sec - (TS1).tv_sec) * 1000000000LL + \ ((TS2).tv_nsec - (TS1).tv_nsec)) @@ -69,7 +69,7 @@ typedef struct timeval { long tv_usec; } timeval; -int gettimeofday(struct timeval * tp, struct timezone * tzp) +int gettimeofday(struct timeval * tp, struct timezone * /*tzp*/) { // Note: some broken versions only have 8 trailing zero's, the // correct epoch has 9 trailing zero's @@ -136,26 +136,26 @@ Chrono::Chrono() } // Reset and return value before rest in milliseconds -long Chrono::restart() +int64_t Chrono::restart() { TimeSpec now; gettime(CLOCK_REALTIME, &now); - long ret = MILLIS(m_orig, now); + int64_t ret = MILLIS(m_orig, now); m_orig = now; return ret; } -long Chrono::urestart() +int64_t Chrono::urestart() { TimeSpec now; gettime(CLOCK_REALTIME, &now); - long ret = MICROS(m_orig, now); + int64_t ret = MICROS(m_orig, now); m_orig = now; return ret; } // Get current timer value, milliseconds -long Chrono::millis(bool frozen) +int64_t Chrono::millis(bool frozen) { if (frozen) { return MILLIS(m_orig, o_now); @@ -167,7 +167,7 @@ long Chrono::millis(bool frozen) } // -long Chrono::micros(bool frozen) +int64_t Chrono::micros(bool frozen) { if (frozen) { return MICROS(m_orig, o_now); @@ -178,7 +178,7 @@ long Chrono::micros(bool frozen) } } -long long Chrono::amicros() const +int64_t Chrono::amicros() const { TimeSpec ts; ts.tv_sec = 0; @@ -187,7 +187,7 @@ long long Chrono::amicros() const } // -long long Chrono::nanos(bool frozen) +int64_t Chrono::nanos(bool frozen) { if (frozen) { return NANOS(m_orig, o_now); @@ -198,7 +198,7 @@ long long Chrono::nanos(bool frozen) } } -float Chrono::secs(bool frozen) +double Chrono::secs(bool frozen) { if (frozen) { return SECONDS(m_orig, o_now); diff --git a/src/utils/chrono.h b/src/utils/chrono.h index cd2c8d9b..cbff47c3 100644 --- a/src/utils/chrono.h +++ b/src/utils/chrono.h @@ -19,6 +19,7 @@ #define _CHRONO_H_INCLUDED_ #include +#include /** Easy interface to measuring time intervals */ class Chrono { @@ -27,9 +28,9 @@ public: Chrono(); /** Re-store current time and return mS since init or last call */ - long restart(); + int64_t restart(); /** Re-store current time and return uS since init or last call */ - long urestart(); + int64_t urestart(); /** Snapshot current time to static storage */ static void refnow(); @@ -41,13 +42,13 @@ public: values from many chrono objects, like when examining timeouts in a queue */ - long long nanos(bool frozen = false); - long micros(bool frozen = false); - long millis(bool frozen = false); - float secs(bool frozen = false); + int64_t nanos(bool frozen = false); + int64_t micros(bool frozen = false); + int64_t millis(bool frozen = false); + double secs(bool frozen = false); /** Return the absolute value of the current origin */ - long long amicros() const; + int64_t amicros() const; struct TimeSpec { time_t tv_sec; /* Time in seconds */ diff --git a/src/utils/circache.cpp b/src/utils/circache.cpp index bbb35eb4..261a65ca 100644 --- a/src/utils/circache.cpp +++ b/src/utils/circache.cpp @@ -455,8 +455,9 @@ public: m_reason << "CirCache::weh: erase requested but not empty"; return false; } - string buf(d.padsize, ' '); - if (write(m_fd, buf.c_str(), d.padsize) != (ssize_t)d.padsize) { + string buf((size_t)d.padsize, ' '); + if (write(m_fd, buf.c_str(), (size_t)d.padsize) != + (ssize_t)d.padsize) { m_reason << "CirCache::weh: write failed. errno " << errno; return false; } @@ -675,7 +676,7 @@ public: CCScanHookRecord() : headoffs(0), padsize(0) { } - virtual status takeone(int64_t offs, const string& udi, + virtual status takeone(int64_t offs, const string&, const EntryHeaderData& d) { headoffs = offs; padsize = d.padsize; diff --git a/src/utils/cmdtalk.cpp b/src/utils/cmdtalk.cpp index 5c3da04e..d64e9e57 100644 --- a/src/utils/cmdtalk.cpp +++ b/src/utils/cmdtalk.cpp @@ -39,7 +39,7 @@ public: Canceler(int tmsecs) : m_timeosecs(tmsecs) {} - virtual void newData(int cnt) { + virtual void newData(int) { if (m_starttime && (time(0) - m_starttime) > m_timeosecs) { throw TimeoutExcept(); } diff --git a/src/utils/dlib.cpp b/src/utils/dlib.cpp index 588c5575..7981e899 100644 --- a/src/utils/dlib.cpp +++ b/src/utils/dlib.cpp @@ -36,7 +36,7 @@ #error dlib.cpp not ported on this system #endif -void *dlib_open(const std::string& libname, int flags) +void *dlib_open(const std::string& libname, int) { #ifdef _WIN32 return LoadLibraryA(libname.c_str()); diff --git a/src/utils/fstreewalk.cpp b/src/utils/fstreewalk.cpp index e3bf03f7..3930ebc2 100644 --- a/src/utils/fstreewalk.cpp +++ b/src/utils/fstreewalk.cpp @@ -534,7 +534,7 @@ int64_t fsTreeBytes(const string& topdir) { class bytesCB : public FsTreeWalkerCB { public: - FsTreeWalker::Status processone(const string &path, + FsTreeWalker::Status processone(const string &, const struct PathStat *st, FsTreeWalker::CbFlag flg) { if (flg == FsTreeWalker::FtwDirEnter || diff --git a/src/utils/pathut.cpp b/src/utils/pathut.cpp index 6163a251..46b0f80b 100644 --- a/src/utils/pathut.cpp +++ b/src/utils/pathut.cpp @@ -710,6 +710,7 @@ bool path_makepath(const string& ipath, int mode) path = "/"; for (const auto& elem : elems) { #ifdef _WIN32 + PRETEND_USE(mode); if (path == "/" && path_strlookslikedrive(elem)) { path = ""; } diff --git a/src/utils/rclutil.cpp b/src/utils/rclutil.cpp index 19ee2d84..39485947 100644 --- a/src/utils/rclutil.cpp +++ b/src/utils/rclutil.cpp @@ -127,7 +127,7 @@ static const string& path_wingetrcltmpdir() return tdir; } -static bool path_gettempfilename(string& filename, string& reason) +static bool path_gettempfilename(string& filename, string&) { string tdir = path_wingetrcltmpdir(); wchar_t dbuf[MAX_PATH + 1]; @@ -245,6 +245,7 @@ const string& path_pkgdatadir() bool printableUrl(const string& fcharset, const string& in, string& out) { #ifdef _WIN32 + PRETEND_USE(fcharset); // On windows our paths are always utf-8 out = in; #else diff --git a/src/utils/readfile.cpp b/src/utils/readfile.cpp index 236edd41..0f90d117 100644 --- a/src/utils/readfile.cpp +++ b/src/utils/readfile.cpp @@ -68,9 +68,9 @@ public: // usage almost by 2 on both linux i586 and macosx (compared to // just append()) Also tried a version with mmap, but it's // actually slower on the mac and not faster on linux. - virtual bool init(int64_t size, string *reason) { + virtual bool init(int64_t size, string *) { if (size > 0) { - m_data.reserve(size); + m_data.reserve((size_t)size); } return true; } @@ -264,10 +264,10 @@ public: return true; } - static voidpf alloc_func(voidpf opaque, uInt items, uInt size) { + static voidpf alloc_func(voidpf, uInt items, uInt size) { return malloc(items * size); } - static void free_func(voidpf opaque, voidpf address) { + static void free_func(voidpf, voidpf address) { free(address); } @@ -372,7 +372,7 @@ public: } if (m_cnttoread != -1) { - toread = MIN(toread, (uint64_t)(m_cnttoread - totread)); + toread = (size_t)MIN(toread, (uint64_t)(m_cnttoread - totread)); } ssize_t n = static_cast(read(fd, buf, toread)); if (n < 0) { @@ -491,6 +491,7 @@ public: static size_t write_cb(void *pOpaque, mz_uint64 file_ofs, const void *pBuf, size_t n) { const char *cp = (const char*)pBuf; + PRETEND_USE(file_ofs); LOGDEB1("write_cb: ofs " << file_ofs << " cnt " << n << " data: " << string(cp, n) << endl); FileScanSourceZip *ths = (FileScanSourceZip *)pOpaque; diff --git a/src/utils/smallut.cpp b/src/utils/smallut.cpp index 8907c6e1..19c82286 100644 --- a/src/utils/smallut.cpp +++ b/src/utils/smallut.cpp @@ -1290,7 +1290,7 @@ bool SimpleRegexp::simpleMatch(const string& val) const return regex_search(val, m->res, m->expr); } -string SimpleRegexp::getMatch(const string& val, int i) const +string SimpleRegexp::getMatch(const string&, int i) const { return m->res.str(i); } diff --git a/src/windows/qmkrecoll/librecoll.pro b/src/windows/qmkrecoll/librecoll.pro index f4485117..99e3e89e 100644 --- a/src/windows/qmkrecoll/librecoll.pro +++ b/src/windows/qmkrecoll/librecoll.pro @@ -161,8 +161,6 @@ windows { $$RECOLLDEPS/msvc/libxslt/libxslt-1.1.29/ \ $$RECOLLDEPS/msvc/libxml2/libxml2-2.9.4+dfsg1/include \ $$RECOLLDEPS/msvc/wlibiconv/include - QMAKE_CXXFLAGS_WARN_ON -= -w34100 - QMAKE_CXXFLAGS += -wd4100 } }