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 { class HyperlinkMatcher {
public: public:
virtual ~HyperlinkMatcher() {}
virtual Label match(const std::map<std::string,Label> &lMap, const std::string &id) const = 0; 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); myFindFileId->setFileName(fileName);
if (!myFindFileId->run()) { if (!myFindFileId->run()) {
return false; return 0;
} }
((DBIntValue&)*myLoadBook->parameter("@file_id").value()) = myFindFileId->fileId(); ((DBIntValue&)*myLoadBook->parameter("@file_id").value()) = myFindFileId->fileId();
shared_ptr<DBDataReader> reader = myLoadBook->executeReader(); 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]; char *buffer = new char[BUFFER_SIZE];
int length; int length;
char previous = 0;
do { do {
length = stream.read(buffer, BUFFER_SIZE); length = stream.read(buffer, BUFFER_SIZE);
const char *end = buffer + length; const char *end = buffer + length;
@ -135,7 +134,6 @@ void PlainTextFormatDetector::detect(ZLInputStream &stream, PlainTextFormat &for
} else { } else {
currentLineIsEmpty = false; currentLineIsEmpty = false;
} }
previous = *ptr;
} }
} while (length == BUFFER_SIZE); } while (length == BUFFER_SIZE);
delete[] buffer; delete[] buffer;

View file

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

View file

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

View file

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

View file

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

View file

@ -23,8 +23,8 @@
class ZLInputStream; class ZLInputStream;
struct ZLZipHeader { struct ZLZipHeader {
static const int SignatureLocalFile; static const unsigned long SignatureLocalFile;
static const int SignatureData; static const unsigned long SignatureData;
unsigned long Signature; unsigned long Signature;
unsigned short Version; 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) : ZLArrayBasedStatisticsItem::ZLArrayBasedStatisticsItem(size_t sequenceLength, char* sequencePtr, unsigned short* frequencyPtr, size_t index) :
ZLStatisticsItem(index), ZLStatisticsItem(index),
mySequenceLength(sequenceLength), mySequencePtr(sequencePtr),
mySequencePtr(sequencePtr), myFrequencyPtr(frequencyPtr),
myFrequencyPtr(frequencyPtr) { mySequenceLength(sequenceLength) {
} }
ZLCharSequence ZLArrayBasedStatisticsItem::sequence() const { ZLCharSequence ZLArrayBasedStatisticsItem::sequence() const {