From: Moritz Bunkus Date: Fri, 25 Nov 2011 21:23:21 +0000 (+0000) Subject: Fix several gcc warnings occurring with -Wextra X-Git-Tag: release-1.4.0~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=699562e7093c77a9496f8728342c756d6364f524;p=libmatroska Fix several gcc warnings occurring with -Wextra Warnings fixed are: - warning: type qualifiers ignored on function return type [-Wignored-qualifiers] - warning: unused parameter ... [-Wunused-parameter] - warning: comparison is always true due to limited range of data type [-Wtype-limits] git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libmatroska@823 a6f86f6d-0131-4f8e-9e7b-e335508773d5 --- diff --git a/make/linux/Makefile b/make/linux/Makefile index c678e28..fd4bf01 100644 --- a/make/linux/Makefile +++ b/make/linux/Makefile @@ -67,7 +67,7 @@ objects:=$(patsubst %$(EXTENSION),%.o,$(sources)) objects_so:=$(patsubst %$(EXTENSION),%.lo,$(sources)) -WARNINGFLAGS=-Wall -Wno-unknown-pragmas -ansi -fno-gnu-keywords -D_GNU_SOURCE \ +WARNINGFLAGS=-Wall -Wextra -Wno-unknown-pragmas -ansi -fno-gnu-keywords -D_GNU_SOURCE \ -Wshadow COMPILEFLAGS=$(DEBUGFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(WARNINGFLAGS) $(INCLUDE) LINKFLAGS=-L. -L$(LIBEBML_LIB_DIR) $(LDFLAGS) diff --git a/matroska/KaxBlock.h b/matroska/KaxBlock.h index 1fb3c9e..4931cbd 100644 --- a/matroska/KaxBlock.h +++ b/matroska/KaxBlock.h @@ -84,7 +84,7 @@ class MATROSKA_DLL_API DataBuffer { virtual binary * Buffer() {assert(bValidValue); return myBuffer;} virtual uint32 & Size() {return mySize;}; virtual const binary * Buffer() const {assert(bValidValue); return myBuffer;} - virtual const uint32 Size() const {return mySize;}; + virtual uint32 Size() const {return mySize;}; bool FreeBuffer(const DataBuffer & aBuffer) { bool bResult = true; if (myBuffer != NULL && bValidValue) { diff --git a/src/KaxBlock.cpp b/src/KaxBlock.cpp index e96910e..b5501e5 100644 --- a/src/KaxBlock.cpp +++ b/src/KaxBlock.cpp @@ -161,7 +161,7 @@ LacingType KaxInternalBlock::GetBestLacingType() const { return LACING_EBML; } -filepos_t KaxInternalBlock::UpdateSize(bool bSaveDefault, bool bForceRender) +filepos_t KaxInternalBlock::UpdateSize(bool /* bSaveDefault */, bool /* bForceRender */) { LacingType LacingHere; assert(EbmlBinary::GetBuffer() == NULL); // Data is not used for KaxInternalBlock @@ -238,7 +238,7 @@ KaxBlockVirtual::~KaxBlockVirtual() SetBuffer( NULL, 0 ); } -filepos_t KaxBlockVirtual::UpdateSize(bool bSaveDefault, bool bForceRender) +filepos_t KaxBlockVirtual::UpdateSize(bool /* bSaveDefault */, bool /* bForceRender */) { assert(TrackNumber < 0x4000); binary *cursor = EbmlBinary::GetBuffer(); @@ -268,7 +268,7 @@ filepos_t KaxBlockVirtual::UpdateSize(bool bSaveDefault, bool bForceRender) \todo more optimisation is possible (render the Block head and don't copy the buffer in memory, care should be taken with the allocation of Data) \todo the actual timecode to write should be retrieved from the Cluster from here */ -filepos_t KaxInternalBlock::RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault) +filepos_t KaxInternalBlock::RenderData(IOCallback & output, bool /* bForceRender */, bool /* bSaveDefault */) { if (myBuffers.size() == 0) { return 0; @@ -1034,7 +1034,7 @@ void KaxBlockBlob::SetBlockGroup( KaxBlockGroup &BlockRef ) Block.group = &BlockRef; } -filepos_t KaxBlockVirtual::ReadData(IOCallback & input, ScopeMode ReadFully) +filepos_t KaxBlockVirtual::ReadData(IOCallback & input, ScopeMode /* ReadFully */) { input.setFilePointer(SizePosition + CodedSizeLength(Size, SizeLength, bSizeIsFinite) + Size, seek_beginning); return GetSize(); diff --git a/src/KaxSemantic.cpp b/src/KaxSemantic.cpp index a5b555f..2ebb4ce 100644 --- a/src/KaxSemantic.cpp +++ b/src/KaxSemantic.cpp @@ -666,97 +666,97 @@ DEFINE_MKX_UINTEGER_DEF(KaxTagDefault, 0x4484, 2, KaxTagSimple, "TagDefault", 1) DEFINE_MKX_UNISTRING(KaxTagString, 0x4487, 2, KaxTagSimple, "TagString"); DEFINE_MKX_BINARY (KaxTagBinary, 0x4485, 2, KaxTagSimple, "TagBinary"); -filepos_t KaxBlockVirtual::RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault) { +filepos_t KaxBlockVirtual::RenderData(IOCallback & /* output */, bool /* bForceRender */, bool /* bSaveDefault */) { assert(false); // no you are not allowed to use this element ! return 0; } -filepos_t KaxReferenceVirtual::RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault) { +filepos_t KaxReferenceVirtual::RenderData(IOCallback & /* output */, bool /* bForceRender */, bool /* bSaveDefault */) { assert(false); // no you are not allowed to use this element ! return 0; } -filepos_t KaxSliceFrameNumber::RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault) { +filepos_t KaxSliceFrameNumber::RenderData(IOCallback & /* output */, bool /* bForceRender */, bool /* bSaveDefault */) { assert(false); // no you are not allowed to use this element ! return 0; } -filepos_t KaxSliceBlockAddID::RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault) { +filepos_t KaxSliceBlockAddID::RenderData(IOCallback & /* output */, bool /* bForceRender */, bool /* bSaveDefault */) { assert(false); // no you are not allowed to use this element ! return 0; } -filepos_t KaxSliceDelay::RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault) { +filepos_t KaxSliceDelay::RenderData(IOCallback & /* output */, bool /* bForceRender */, bool /* bSaveDefault */) { assert(false); // no you are not allowed to use this element ! return 0; } -filepos_t KaxSliceDuration::RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault) { +filepos_t KaxSliceDuration::RenderData(IOCallback & /* output */, bool /* bForceRender */, bool /* bSaveDefault */) { assert(false); // no you are not allowed to use this element ! return 0; } -filepos_t KaxEncryptedBlock::RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault) { +filepos_t KaxEncryptedBlock::RenderData(IOCallback & /* output */, bool /* bForceRender */, bool /* bSaveDefault */) { assert(false); // no you are not allowed to use this element ! return 0; } -filepos_t KaxTrackOffset::RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault) { +filepos_t KaxTrackOffset::RenderData(IOCallback & /* output */, bool /* bForceRender */, bool /* bSaveDefault */) { assert(false); // no you are not allowed to use this element ! return 0; } -filepos_t KaxCodecSettings::RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault) { +filepos_t KaxCodecSettings::RenderData(IOCallback & /* output */, bool /* bForceRender */, bool /* bSaveDefault */) { assert(false); // no you are not allowed to use this element ! return 0; } -filepos_t KaxCodecInfoURL::RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault) { +filepos_t KaxCodecInfoURL::RenderData(IOCallback & /* output */, bool /* bForceRender */, bool /* bSaveDefault */) { assert(false); // no you are not allowed to use this element ! return 0; } -filepos_t KaxCodecDownloadURL::RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault) { +filepos_t KaxCodecDownloadURL::RenderData(IOCallback & /* output */, bool /* bForceRender */, bool /* bSaveDefault */) { assert(false); // no you are not allowed to use this element ! return 0; } -filepos_t KaxOldStereoMode::RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault) { +filepos_t KaxOldStereoMode::RenderData(IOCallback & /* output */, bool /* bForceRender */, bool /* bSaveDefault */) { assert(false); // no you are not allowed to use this element ! return 0; } -filepos_t KaxVideoGamma::RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault) { +filepos_t KaxVideoGamma::RenderData(IOCallback & /* output */, bool /* bForceRender */, bool /* bSaveDefault */) { assert(false); // no you are not allowed to use this element ! return 0; } -filepos_t KaxVideoFrameRate::RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault) { +filepos_t KaxVideoFrameRate::RenderData(IOCallback & /* output */, bool /* bForceRender */, bool /* bSaveDefault */) { assert(false); // no you are not allowed to use this element ! return 0; } -filepos_t KaxAudioPosition::RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault) { +filepos_t KaxAudioPosition::RenderData(IOCallback & /* output */, bool /* bForceRender */, bool /* bSaveDefault */) { assert(false); // no you are not allowed to use this element ! return 0; } -filepos_t KaxCueRefCluster::RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault) { +filepos_t KaxCueRefCluster::RenderData(IOCallback & /* output */, bool /* bForceRender */, bool /* bSaveDefault */) { assert(false); // no you are not allowed to use this element ! return 0; } -filepos_t KaxCueRefNumber::RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault) { +filepos_t KaxCueRefNumber::RenderData(IOCallback & /* output */, bool /* bForceRender */, bool /* bSaveDefault */) { assert(false); // no you are not allowed to use this element ! return 0; } -filepos_t KaxCueRefCodecState::RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault) { +filepos_t KaxCueRefCodecState::RenderData(IOCallback & /* output */, bool /* bForceRender */, bool /* bSaveDefault */) { assert(false); // no you are not allowed to use this element ! return 0; } -filepos_t KaxFileReferral::RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault) { +filepos_t KaxFileReferral::RenderData(IOCallback & /* output */, bool /* bForceRender */, bool /* bSaveDefault */) { assert(false); // no you are not allowed to use this element ! return 0; }