Merge pull request #125 from kiwix/no_warning

Try to compile kiwix-lib without warning.
This commit is contained in:
Matthieu Gautier 2018-04-18 17:05:50 +02:00 committed by GitHub
commit 10893ae19f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 7 deletions

View File

@ -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')

View File

@ -19,13 +19,15 @@
#include <common/networkTools.h>
std::map<std::string, std::string> kiwix::getNetworkInterfaces()
{
std::map<std::string, std::string> 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;

View File

@ -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)
{
}

View File

@ -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() :