diff --git a/meson.build b/meson.build index 819d20869..43a76926d 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project('kiwix-lib', 'cpp', version : '1.1.1', license : 'GPL', - default_options : ['c_std=c11', 'cpp_std=c++11']) + default_options : ['c_std=c11', 'cpp_std=c++11', 'werror=true']) compiler = meson.get_compiler('cpp') find_library_in_compiler = meson.version().version_compare('>=0.31.0') diff --git a/src/common/networkTools.cpp b/src/common/networkTools.cpp index 639e995c0..d2516996a 100644 --- a/src/common/networkTools.cpp +++ b/src/common/networkTools.cpp @@ -19,13 +19,15 @@ #include + + std::map kiwix::getNetworkInterfaces() { std::map interfaces; #ifdef _WIN32 SOCKET sd = WSASocket(AF_INET, SOCK_DGRAM, 0, 0, 0, 0); - if (sd == SOCKET_ERROR) { + if (sd == (SOCKET)SOCKET_ERROR) { std::cerr << "Failed to get a socket. Error " << WSAGetLastError() << std::endl; return interfaces; diff --git a/src/searcher.cpp b/src/searcher.cpp index 65671b1bd..4fd430eba 100644 --- a/src/searcher.cpp +++ b/src/searcher.cpp @@ -43,7 +43,7 @@ namespace kiwix class _Result : public Result { public: - _Result(Searcher* searcher, zim::Search::iterator& iterator); + _Result(zim::Search::iterator& iterator); virtual ~_Result(){}; virtual std::string get_url(); @@ -56,7 +56,6 @@ class _Result : public Result virtual int get_readerIndex(); private: - Searcher* searcher; zim::Search::iterator iterator; }; @@ -258,7 +257,7 @@ Result* Searcher::getNextResult() return internal->_xapianSearcher->getNextResult(); } else if (internal->_search && internal->current_iterator != internal->_search->end()) { - Result* result = new _Result(this, internal->current_iterator); + Result* result = new _Result(internal->current_iterator); internal->current_iterator++; return result; } @@ -324,8 +323,8 @@ bool Searcher::setSearchProtocolPrefix(const std::string prefix) return true; } -_Result::_Result(Searcher* searcher, zim::Search::iterator& iterator) - : searcher(searcher), iterator(iterator) +_Result::_Result(zim::Search::iterator& iterator) + : iterator(iterator) { } diff --git a/src/xapian/myhtmlparse.h b/src/xapian/myhtmlparse.h index f221cb5d7..d37298563 100644 --- a/src/xapian/myhtmlparse.h +++ b/src/xapian/myhtmlparse.h @@ -40,6 +40,7 @@ class MyHtmlParser : public HtmlParser { void process_text(const string &text); void opening_tag(const string &tag); void closing_tag(const string &tag); + using HtmlParser::parse_html; void parse_html(const string &text, const string &charset_, bool charset_from_meta_); MyHtmlParser() :