add -Wcast-qual switch and fix all related warnings

This commit is contained in:
Ingo Weyrich
2019-07-25 17:45:43 +02:00
parent a9edbcf47b
commit 17f343f682
12 changed files with 30 additions and 30 deletions

View File

@@ -673,7 +673,7 @@ int TagDirectory::calculateSize ()
return size;
}
TagDirectory* TagDirectory::clone (TagDirectory* parent)
TagDirectory* TagDirectory::clone (TagDirectory* parent) const
{
TagDirectory* td = new TagDirectory (parent, attribs, order);
@@ -857,7 +857,7 @@ TagDirectoryTable::TagDirectoryTable (TagDirectory* p, FILE* f, int memsize, int
}
}
}
TagDirectory* TagDirectoryTable::clone (TagDirectory* parent)
TagDirectory* TagDirectoryTable::clone (TagDirectory* parent) const
{
TagDirectory* td = new TagDirectoryTable (parent, values, valuesSize, zeroOffset, defaultType, attribs, order);
@@ -1382,7 +1382,7 @@ bool Tag::parseMakerNote (FILE* f, int base, ByteOrder bom )
return true;
}
Tag* Tag::clone (TagDirectory* parent)
Tag* Tag::clone (TagDirectory* parent) const
{
Tag* t = new Tag (parent, attrib);
@@ -1397,7 +1397,7 @@ Tag* Tag::clone (TagDirectory* parent)
t->value = new unsigned char [valuesize];
memcpy (t->value, value, valuesize);
} else {
value = nullptr;
t->value = nullptr;
}
t->makerNoteKind = makerNoteKind;

View File

@@ -180,7 +180,7 @@ public:
virtual int calculateSize ();
virtual int write (int start, unsigned char* buffer);
virtual TagDirectory* clone (TagDirectory* parent);
virtual TagDirectory* clone (TagDirectory* parent) const;
void applyChange (const std::string &field, const Glib::ustring &value);
virtual void printAll (unsigned int level = 0) const; // reentrant debug function, keep level=0 on first call !
@@ -204,7 +204,7 @@ public:
~TagDirectoryTable() override;
int calculateSize () override;
int write (int start, unsigned char* buffer) override;
TagDirectory* clone (TagDirectory* parent) override;
TagDirectory* clone (TagDirectory* parent) const override;
};
// a class representing a single tag
@@ -310,7 +310,7 @@ public:
// functions for writing
int calculateSize ();
int write (int offs, int dataOffs, unsigned char* buffer);
Tag* clone (TagDirectory* parent);
Tag* clone (TagDirectory* parent) const;
// to control if the tag shall be written
bool getKeep ()