Fixed compilation warnings

Mostly, by making base class destructors virtual.
This commit is contained in:
Slava Monich 2015-05-27 00:07:12 +03:00
parent 74ca5511d7
commit 448a70f889
9 changed files with 13 additions and 11 deletions

View file

@ -55,6 +55,7 @@ public:
class HyperlinkMatcher {
public:
virtual ~HyperlinkMatcher() {}
virtual Label match(const std::map<std::string,Label> &lMap, const std::string &id) const = 0;
};

View file

@ -145,7 +145,7 @@ shared_ptr<Book> BooksDB::loadBook(const std::string &fileName) {
myFindFileId->setFileName(fileName);
if (!myFindFileId->run()) {
return false;
return 0;
}
((DBIntValue&)*myLoadBook->parameter("@file_id").value()) = myFindFileId->fileId();
shared_ptr<DBDataReader> reader = myLoadBook->executeReader();

View file

@ -95,7 +95,6 @@ void PlainTextFormatDetector::detect(ZLInputStream &stream, PlainTextFormat &for
char *buffer = new char[BUFFER_SIZE];
int length;
char previous = 0;
do {
length = stream.read(buffer, BUFFER_SIZE);
const char *end = buffer + length;
@ -135,7 +134,6 @@ void PlainTextFormatDetector::detect(ZLInputStream &stream, PlainTextFormat &for
} else {
currentLineIsEmpty = false;
}
previous = *ptr;
}
} while (length == BUFFER_SIZE);
delete[] buffer;

View file

@ -44,6 +44,7 @@ public:
public:
BookReference(const std::string &url, Format format, Type type);
virtual ~BookReference() {}
public:
const std::string URL;

View file

@ -45,7 +45,7 @@ class ZLApplicationBase {
protected:
ZLApplicationBase(const std::string &name);
~ZLApplicationBase();
virtual ~ZLApplicationBase();
};
class ZLApplication : public ZLApplicationBase {

View file

@ -27,6 +27,8 @@ class ZLFile;
class ZLOpenFileDialog {
public:
virtual ~ZLOpenFileDialog() {}
class Filter {
public:

View file

@ -23,8 +23,8 @@
#include "ZLZDecompressor.h"
#include "../ZLInputStream.h"
const int ZLZipHeader::SignatureLocalFile = 0x04034B50;
const int ZLZipHeader::SignatureData = 0x08074B50;
const unsigned long ZLZipHeader::SignatureLocalFile = 0x04034B50;
const unsigned long ZLZipHeader::SignatureData = 0x08074B50;
bool ZLZipHeader::readFrom(ZLInputStream &stream) {
size_t startOffset = stream.offset();

View file

@ -23,8 +23,8 @@
class ZLInputStream;
struct ZLZipHeader {
static const int SignatureLocalFile;
static const int SignatureData;
static const unsigned long SignatureLocalFile;
static const unsigned long SignatureData;
unsigned long Signature;
unsigned short Version;

View file

@ -38,9 +38,9 @@ void ZLMapBasedStatisticsItem::next() {
ZLArrayBasedStatisticsItem::ZLArrayBasedStatisticsItem(size_t sequenceLength, char* sequencePtr, unsigned short* frequencyPtr, size_t index) :
ZLStatisticsItem(index),
mySequenceLength(sequenceLength),
mySequencePtr(sequencePtr),
myFrequencyPtr(frequencyPtr) {
myFrequencyPtr(frequencyPtr),
mySequenceLength(sequenceLength) {
}
ZLCharSequence ZLArrayBasedStatisticsItem::sequence() const {