From 00f822e00c0bfc01918cfb1aeb9d98f9e538c01b Mon Sep 17 00:00:00 2001 From: Ariel Elkin Date: Thu, 27 Feb 2014 01:08:45 +0000 Subject: [PATCH 1/4] explicitly cast return value in frames() to match return type --- include/Stk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/Stk.h b/include/Stk.h index 5c9c37b..d5bf1b2 100644 --- a/include/Stk.h +++ b/include/Stk.h @@ -376,7 +376,7 @@ public: unsigned int channels( void ) const { return nChannels_; }; //! Return the number of sample frames represented by the data. - unsigned int frames( void ) const { return nFrames_; }; + unsigned int frames( void ) const { return (unsigned int)nFrames_; }; //! Set the sample rate associated with the StkFrames data. /*! From 7aefe7caff56aa9d99978feb04e2b2033236c5a5 Mon Sep 17 00:00:00 2001 From: Ariel Elkin Date: Thu, 27 Feb 2014 01:19:34 +0000 Subject: [PATCH 2/4] make casts in Fir.h explicit --- include/Fir.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/Fir.h b/include/Fir.h index 55979db..5f8091d 100644 --- a/include/Fir.h +++ b/include/Fir.h @@ -88,7 +88,7 @@ inline StkFloat Fir :: tick( StkFloat input ) lastFrame_[0] = 0.0; inputs_[0] = gain_ * input; - for ( unsigned int i=b_.size()-1; i>0; i-- ) { + for ( unsigned int i=(unsigned int)(b_.size())-1; i>0; i-- ) { lastFrame_[0] += b_[i] * inputs_[i]; inputs_[i] = inputs_[i-1]; } @@ -112,7 +112,7 @@ inline StkFrames& Fir :: tick( StkFrames& frames, unsigned int channel ) inputs_[0] = gain_ * *samples; *samples = 0.0; - for ( i=b_.size()-1; i>0; i-- ) { + for ( i=(unsigned int)b_.size()-1; i>0; i-- ) { *samples += b_[i] * inputs_[i]; inputs_[i] = inputs_[i-1]; } @@ -139,7 +139,7 @@ inline StkFrames& Fir :: tick( StkFrames& iFrames, StkFrames& oFrames, unsigned inputs_[0] = gain_ * *iSamples; *oSamples = 0.0; - for ( i=b_.size()-1; i>0; i-- ) { + for ( i=(unsigned int)b_.size()-1; i>0; i-- ) { *oSamples += b_[i] * inputs_[i]; inputs_[i] = inputs_[i-1]; } From cafad844ad59d3c8618a1328d294c334cdcbdce9 Mon Sep 17 00:00:00 2001 From: Ariel Elkin Date: Sat, 8 Mar 2014 17:18:45 +0100 Subject: [PATCH 3/4] make casts in MidiFileIn.cpp explicit --- src/MidiFileIn.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/MidiFileIn.cpp b/src/MidiFileIn.cpp index 64873d2..6c94b29 100644 --- a/src/MidiFileIn.cpp +++ b/src/MidiFileIn.cpp @@ -232,7 +232,7 @@ unsigned long MidiFileIn :: getNextEvent( std::vector *event, uns if ( !file_.read( (char *)&c, 1 ) ) goto error; event->push_back( c ); if ( format_ != 1 && ( c == 0x51 ) ) isTempoEvent = true; - position = file_.tellg(); + position = (unsigned long)file_.tellg(); if ( !readVariableLength( &bytes ) ) goto error; bytes += ( (unsigned long)file_.tellg() - position ); file_.seekg( position, std::ios_base::beg ); @@ -242,7 +242,7 @@ unsigned long MidiFileIn :: getNextEvent( std::vector *event, uns case 0xF7: // The start or continuation of a Sysex event trackStatus_[track] = 0; event->push_back( c ); - position = file_.tellg(); + position = (unsigned long)file_.tellg(); if ( !readVariableLength( &bytes ) ) goto error; bytes += ( (unsigned long)file_.tellg() - position ); file_.seekg( position, std::ios_base::beg ); @@ -294,7 +294,7 @@ unsigned long MidiFileIn :: getNextEvent( std::vector *event, uns } // Save the current track pointer value. - trackPointers_[track] = file_.tellg(); + trackPointers_[track] = (long)file_.tellg(); return ticks; From 9e2cad425a1225b176dfd64e7d90d69e95cbb653 Mon Sep 17 00:00:00 2001 From: Felipe Sateler Date: Wed, 12 Mar 2014 11:21:39 -0300 Subject: [PATCH 4/4] Add configure options to build static or shared libraries --- configure.ac | 20 ++++++++++++++++++++ src/Makefile.in | 12 +++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 98d88e3..830c6f5 100644 --- a/configure.ac +++ b/configure.ac @@ -50,6 +50,26 @@ else fi AC_MSG_RESULT($realtime) +AC_MSG_CHECKING(whether to build the static library) +AC_ARG_ENABLE(static, + [ --disable-static = do not compile static library ], + build_static=$enableval, + build_static=yes) +AC_SUBST(build_static) +AC_MSG_RESULT($build_static) + +AC_MSG_CHECKING(whether to build the shared library) +AC_ARG_ENABLE(shared, + [ --enable-shared = compile the shared library ], + build_shared=$enableval, + build_shared=no) +AC_SUBST(build_shared) +AC_MSG_RESULT($build_shared) + +if test x$build_static = xno -a x$build_shared = xno ; then + AC_MSG_ERROR([ both static and shared libraries are disabled], 1) +fi + # Check for math library AC_CHECK_LIB(m, cos, , AC_MSG_ERROR(math library is needed!)) diff --git a/src/Makefile.in b/src/Makefile.in index e5641ad..64da6bf 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -55,6 +55,16 @@ ifeq ($(REALTIME),yes) OBJECTS += RtMidi.o RtAudio.o RtWvOut.o RtWvIn.o InetWvOut.o InetWvIn.o Thread.o Mutex.o Socket.o TcpClient.o TcpServer.o UdpSocket.o @objects@ endif +BUILD_STATIC = @build_static@ +BUILD_SHARED = @build_shared@ +DEFAULT_TARGETS = +ifeq ($(BUILD_STATIC),yes) + DEFAULT_TARGETS += $(STATICLIB) +endif +ifeq ($(BUILD_SHARED),yes) + DEFAULT_TARGETS += $(SHAREDLIB) +endif + RAWWAVES = @rawwaves@ ifeq ($(strip $(RAWWAVES)), ) RAWWAVES = ../../rawwaves/ @@ -67,7 +77,7 @@ DEFS += -DRAWWAVE_PATH=\"$(RAWWAVES)\" %.o : ../src/include/%.cpp $(OBJECT_PATH)/.placeholder $(CC) $(CFLAGS) $(DEFS) -c $(<) -o $(OBJECT_PATH)/$@ -all : $(STATICLIB) +all : $(DEFAULT_TARGETS) $(OBJECT_PATH)/.placeholder: mkdir -vp $(OBJECT_PATH)