fixed clang warnings (CXX = /usr/bin/clang++)

This commit is contained in:
badaix 2016-04-27 21:44:51 +02:00
parent f11a7055a1
commit e1a47b3b98
5 changed files with 9 additions and 11 deletions

View file

@ -32,8 +32,8 @@ else
CXX = /usr/bin/g++ CXX = /usr/bin/g++
STRIP = strip STRIP = strip
CXXFLAGS += -static-libgcc -static-libstdc++ -DHAS_OGG -DHAS_ALSA -DHAS_AVAHI -DHAS_DAEMON CXXFLAGS += -DHAS_OGG -DHAS_ALSA -DHAS_AVAHI -DHAS_DAEMON
LDFLAGS = -lrt -lasound -logg -lvorbis -lFLAC -lavahi-client -lavahi-common LDFLAGS = -lrt -lasound -logg -lvorbis -lFLAC -lavahi-client -lavahi-common -static-libgcc -static-libstdc++
OBJ += player/alsaPlayer.o decoder/oggDecoder.o browseAvahi.o OBJ += player/alsaPlayer.o decoder/oggDecoder.o browseAvahi.o
endif endif

View file

@ -50,11 +50,13 @@ PcmChunk::~PcmChunk()
int PcmChunk::seek(int frames) int PcmChunk::seek(int frames)
{ {
if ((frames < 0) && (-frames > (int)idx_))
frames = -idx_;
idx_ += frames; idx_ += frames;
if (idx_ > getFrameCount()) if (idx_ > getFrameCount())
idx_ = getFrameCount(); idx_ = getFrameCount();
if (idx_ < 0)
idx_ = 0;
return idx_; return idx_;
} }

View file

@ -21,8 +21,7 @@ else
CXX = /usr/bin/g++ CXX = /usr/bin/g++
STRIP = strip STRIP = strip
CXXFLAGS += -static-libgcc -static-libstdc++ LDFLAGS = -lrt -lvorbis -lvorbisenc -logg -lFLAC -lavahi-client -lavahi-common -static-libgcc -static-libstdc++
LDFLAGS = -lrt -lvorbis -lvorbisenc -logg -lFLAC -lavahi-client -lavahi-common
endif endif

View file

@ -28,7 +28,7 @@
using namespace std; using namespace std;
OggEncoder::OggEncoder(const std::string& codecOptions) : Encoder(codecOptions), lastGranulepos(0), eos(0) OggEncoder::OggEncoder(const std::string& codecOptions) : Encoder(codecOptions), lastGranulepos(0)
{ {
} }
@ -180,7 +180,7 @@ void OggEncoder::initEncoder()
*********************************************************************/ *********************************************************************/
ret = vorbis_encode_init_vbr(&vi, sampleFormat_.channels, sampleFormat_.rate, quality); int ret = vorbis_encode_init_vbr(&vi, sampleFormat_.channels, sampleFormat_.rate, quality);
/* do not continue if setup failed; this can happen if we ask for a /* do not continue if setup failed; this can happen if we ask for a
mode that libVorbis does not support (eg, too low a bitrate, etc, mode that libVorbis does not support (eg, too low a bitrate, etc,

View file

@ -48,9 +48,6 @@ private:
vorbis_block vb; /* local working space for packet->PCM decode */ vorbis_block vb; /* local working space for packet->PCM decode */
ogg_int64_t lastGranulepos; ogg_int64_t lastGranulepos;
int eos, ret;
int i, founddata;
}; };