Fix numerous warnings arising from addition of -Weffc++.

This commit is contained in:
Erik de Castro Lopo 2013-09-15 18:10:55 +10:00
parent 24a644718f
commit 95552e11ba
5 changed files with 64 additions and 6 deletions

View File

@ -72,6 +72,9 @@ protected:
virtual ::FLAC__StreamDecoderWriteStatus write_callback(const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[]);
virtual void metadata_callback(const ::FLAC__StreamMetadata *metadata);
virtual void error_callback(::FLAC__StreamDecoderErrorStatus status);
private:
OurDecoder(const OurDecoder&);
OurDecoder&operator=(const OurDecoder&);
};
int main(int argc, char *argv[])

View File

@ -1090,6 +1090,10 @@ namespace FLAC {
protected:
::FLAC__Metadata_SimpleIterator *iterator_;
void clear();
private: // Do not use.
SimpleIterator(const SimpleIterator&);
SimpleIterator&operator=(const SimpleIterator&);
};
/* \} */
@ -1174,6 +1178,10 @@ namespace FLAC {
protected:
::FLAC__Metadata_Chain *chain_;
virtual void clear();
private: // Do not use.
Chain(const Chain&);
Chain&operator=(const Chain&);
};
/** This class is a wrapper around the FLAC__metadata_iterator
@ -1204,6 +1212,10 @@ namespace FLAC {
protected:
::FLAC__Metadata_Iterator *iterator_;
virtual void clear();
private: // Do not use.
Iterator(const Iterator&);
Iterator&operator=(const Iterator&);
};
/* \} */

View File

@ -523,36 +523,72 @@ namespace FLAC {
// VorbisComment::Entry
//
VorbisComment::Entry::Entry()
VorbisComment::Entry::Entry() :
is_valid_(true),
entry_(),
field_name_(0),
field_name_length_(0),
field_value_(0),
field_value_length_(0)
{
zero();
}
VorbisComment::Entry::Entry(const char *field, unsigned field_length)
VorbisComment::Entry::Entry(const char *field, unsigned field_length) :
is_valid_(true),
entry_(),
field_name_(0),
field_name_length_(0),
field_value_(0),
field_value_length_(0)
{
zero();
construct(field, field_length);
}
VorbisComment::Entry::Entry(const char *field)
VorbisComment::Entry::Entry(const char *field) :
is_valid_(true),
entry_(),
field_name_(0),
field_name_length_(0),
field_value_(0),
field_value_length_(0)
{
zero();
construct(field);
}
VorbisComment::Entry::Entry(const char *field_name, const char *field_value, unsigned field_value_length)
VorbisComment::Entry::Entry(const char *field_name, const char *field_value, unsigned field_value_length) :
is_valid_(true),
entry_(),
field_name_(0),
field_name_length_(0),
field_value_(0),
field_value_length_(0)
{
zero();
construct(field_name, field_value, field_value_length);
}
VorbisComment::Entry::Entry(const char *field_name, const char *field_value)
VorbisComment::Entry::Entry(const char *field_name, const char *field_value) :
is_valid_(true),
entry_(),
field_name_(0),
field_name_length_(0),
field_value_(0),
field_value_length_(0)
{
zero();
construct(field_name, field_value);
}
VorbisComment::Entry::Entry(const Entry &entry)
VorbisComment::Entry::Entry(const Entry &entry) :
is_valid_(true),
entry_(),
field_name_(0),
field_name_length_(0),
field_value_(0),
field_value_length_(0)
{
FLAC__ASSERT(entry.is_valid());
zero();

View File

@ -125,6 +125,7 @@ public:
bool error_occurred_;
DecoderCommon(Layer layer): layer_(layer), current_metadata_number_(0), ignore_errors_(false), error_occurred_(false) { }
virtual ~DecoderCommon(void) { }
::FLAC__StreamDecoderWriteStatus common_write_callback_(const ::FLAC__Frame *frame);
void common_metadata_callback_(const ::FLAC__StreamMetadata *metadata);
void common_error_callback_(::FLAC__StreamDecoderErrorStatus status);
@ -193,6 +194,9 @@ public:
void error_callback(::FLAC__StreamDecoderErrorStatus status);
bool test_respond(bool is_ogg);
private:
StreamDecoder(const StreamDecoder&);
StreamDecoder&operator=(const StreamDecoder&);
};
::FLAC__StreamDecoderReadStatus StreamDecoder::read_callback(FLAC__byte buffer[], size_t *bytes)

View File

@ -106,6 +106,9 @@ public:
::FLAC__StreamEncoderSeekStatus seek_callback(FLAC__uint64 absolute_byte_offset);
::FLAC__StreamEncoderTellStatus tell_callback(FLAC__uint64 *absolute_byte_offset);
void metadata_callback(const ::FLAC__StreamMetadata *metadata);
private:
StreamEncoder(const StreamEncoder&);
StreamEncoder&operator=(const StreamEncoder&);
};
::FLAC__StreamEncoderReadStatus StreamEncoder::read_callback(FLAC__byte buffer[], size_t *bytes)