mirror of https://github.com/kiwix/libkiwix.git
Try to compile kiwix-lib without warning.
This commit is contained in:
parent
32ad40a5b0
commit
ec097ab267
|
@ -1,7 +1,7 @@
|
||||||
project('kiwix-lib', 'cpp',
|
project('kiwix-lib', 'cpp',
|
||||||
version : '1.1.1',
|
version : '1.1.1',
|
||||||
license : 'GPL',
|
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')
|
compiler = meson.get_compiler('cpp')
|
||||||
find_library_in_compiler = meson.version().version_compare('>=0.31.0')
|
find_library_in_compiler = meson.version().version_compare('>=0.31.0')
|
||||||
|
|
|
@ -19,13 +19,15 @@
|
||||||
|
|
||||||
#include <common/networkTools.h>
|
#include <common/networkTools.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
std::map<std::string, std::string> kiwix::getNetworkInterfaces()
|
std::map<std::string, std::string> kiwix::getNetworkInterfaces()
|
||||||
{
|
{
|
||||||
std::map<std::string, std::string> interfaces;
|
std::map<std::string, std::string> interfaces;
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
SOCKET sd = WSASocket(AF_INET, SOCK_DGRAM, 0, 0, 0, 0);
|
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::cerr << "Failed to get a socket. Error " << WSAGetLastError()
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
return interfaces;
|
return interfaces;
|
||||||
|
|
|
@ -43,7 +43,7 @@ namespace kiwix
|
||||||
class _Result : public Result
|
class _Result : public Result
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
_Result(Searcher* searcher, zim::Search::iterator& iterator);
|
_Result(zim::Search::iterator& iterator);
|
||||||
virtual ~_Result(){};
|
virtual ~_Result(){};
|
||||||
|
|
||||||
virtual std::string get_url();
|
virtual std::string get_url();
|
||||||
|
@ -56,7 +56,6 @@ class _Result : public Result
|
||||||
virtual int get_readerIndex();
|
virtual int get_readerIndex();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Searcher* searcher;
|
|
||||||
zim::Search::iterator iterator;
|
zim::Search::iterator iterator;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -258,7 +257,7 @@ Result* Searcher::getNextResult()
|
||||||
return internal->_xapianSearcher->getNextResult();
|
return internal->_xapianSearcher->getNextResult();
|
||||||
} else if (internal->_search &&
|
} else if (internal->_search &&
|
||||||
internal->current_iterator != internal->_search->end()) {
|
internal->current_iterator != internal->_search->end()) {
|
||||||
Result* result = new _Result(this, internal->current_iterator);
|
Result* result = new _Result(internal->current_iterator);
|
||||||
internal->current_iterator++;
|
internal->current_iterator++;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -324,8 +323,8 @@ bool Searcher::setSearchProtocolPrefix(const std::string prefix)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
_Result::_Result(Searcher* searcher, zim::Search::iterator& iterator)
|
_Result::_Result(zim::Search::iterator& iterator)
|
||||||
: searcher(searcher), iterator(iterator)
|
: iterator(iterator)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,7 @@ class MyHtmlParser : public HtmlParser {
|
||||||
void process_text(const string &text);
|
void process_text(const string &text);
|
||||||
void opening_tag(const string &tag);
|
void opening_tag(const string &tag);
|
||||||
void closing_tag(const string &tag);
|
void closing_tag(const string &tag);
|
||||||
|
using HtmlParser::parse_html;
|
||||||
void parse_html(const string &text, const string &charset_,
|
void parse_html(const string &text, const string &charset_,
|
||||||
bool charset_from_meta_);
|
bool charset_from_meta_);
|
||||||
MyHtmlParser() :
|
MyHtmlParser() :
|
||||||
|
|
Loading…
Reference in New Issue