Minor changes across codebase for TravisCI integration to build on

OSX/Clang and Linux/GCC.
pull/38/head
dimitri 7 years ago
parent 7aa6d409e0
commit 782d5455d2

@ -4,14 +4,31 @@ sudo: true
matrix:
include:
- os: linux
env: CXXFLAGS="-std=c++11"
- os: osx
env: CXXFLAGS="-std=c++11"
install:
# install latest cmake
- |
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
CMAKE_URL="https://cmake.org/files/v3.11/cmake-3.11.1-Linux-x86_64.tar.gz";
mkdir cmake_latest && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake_latest;
export PATH=$(pwd)/cmake_latest/bin:${PATH};
fi
- |
if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
brew update;
brew uninstall cmake;
brew install cmake;
fi
- which ${CC}
- which ${CXX}
- which cmake
script:
- mkdir build
- cd build
- cmake ..
- cmake -DBUILD_EXAMPLE=FALSE ..
- cmake --build .
after_success:

@ -36,6 +36,8 @@
#include <atomic>
#include <assert.h>
#include <cstring>
#include <cstdlib>
template <typename T>
class RingBufferT
@ -65,9 +67,9 @@ class RingBufferT
size_t allocatedSize = count + 1; // one bin is used to distinguish between the read and write indices when full.
if (mAllocatedSize)
mData = (T *)::realloc(mData, allocatedSize * sizeof(T));
mData = (T *) std::realloc(mData, allocatedSize * sizeof(T));
else
mData = (T *)::calloc(allocatedSize, sizeof(T));
mData = (T *) std::calloc(allocatedSize, sizeof(T));
assert(mData);

@ -265,19 +265,19 @@ class Dither
{
std::uniform_real_distribution<float> distribution;
std::mt19937 gen;
float prev{ 0.0f };
float previous;
DitherType d;
public:
Dither(DitherType d) : distribution(-0.5f, +0.5f), d(d) {}
Dither(DitherType d) : distribution(-0.5f, +0.5f), d(d), previous(0.f) {}
float operator()(float s)
{
if (d == DITHER_TRIANGLE)
{
const float value = distribution(gen);
s = s + value - prev;
prev = value;
s = s + value - previous;
previous = value;
return s;
}
else return s;

@ -42,7 +42,7 @@ namespace nqr
virtual ~BaseDecoder() {}
};
typedef std::pair<std::string, std::shared_ptr<nqr::BaseDecoder>> DecoderPair;
typedef std::pair< std::string, std::shared_ptr<nqr::BaseDecoder> > DecoderPair;
class NyquistIO
{
@ -50,7 +50,7 @@ namespace nqr
std::shared_ptr<nqr::BaseDecoder> GetDecoderForExtension(const std::string & ext);
void BuildDecoderTable();
void AddDecoderToTable(std::shared_ptr<nqr::BaseDecoder> decoder);
std::map<std::string, std::shared_ptr<BaseDecoder>> decoderTable;
std::map< std::string, std::shared_ptr<BaseDecoder> > decoderTable;
NO_MOVE(NyquistIO);

Loading…
Cancel
Save