Compile without warning.

This commit is contained in:
Matthieu Gautier 2018-04-19 15:59:42 +02:00
parent eccf5e194c
commit 53b2dadfce
3 changed files with 4 additions and 13 deletions

View File

@ -1,7 +1,7 @@
project('kiwix-tools', 'cpp',
version : '0.4.0',
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')

View File

@ -79,10 +79,8 @@ int main(int argc, char** argv)
/* Start to read an article */
if (reader != NULL) {
string mainPageUrl = reader->getMainPageUrl();
string content;
string contentType;
unsigned int contentLength = 0;
string suggestion;
if (pattern != NULL) {
@ -94,13 +92,6 @@ int main(int argc, char** argv)
}
}
/*
if (reader->getContentByUrl(mainPageUrl, content, contentLength,
contentType)) {
cout << content << endl;
}
*/
delete reader;
} else {
cerr << "Unable instanciate the Kiwix reader." << endl;

View File

@ -218,8 +218,8 @@ static struct MHD_Response* build_response(const void* data,
bool cacheEnabled)
{
/* Create the response */
struct MHD_Response* response = MHD_create_response_from_data(
length, const_cast<void*>(data), MHD_NO, MHD_YES);
struct MHD_Response* response = MHD_create_response_from_buffer(
length, const_cast<void*>(data), MHD_RESPMEM_MUST_COPY);
/* Make a redirection if necessary otherwise send the content */
if (!httpRedirection.empty()) {
@ -784,7 +784,7 @@ int main(int argc, char** argv)
string rootPath;
string interface;
int serverPort = 80;
int daemonFlag = false;
int daemonFlag [[gnu::unused]] = false;
int libraryFlag = false;
string PPIDString;
unsigned int PPID = 0;