diff --git a/.github/workflows/cppcmake.yml b/.github/workflows/cppcmake.yml index 993ff483..e88f3d4a 100644 --- a/.github/workflows/cppcmake.yml +++ b/.github/workflows/cppcmake.yml @@ -34,8 +34,8 @@ jobs: config: - {name: "ubuntu-20.04", os: "ubuntu-20.04", cmake_extra: "-DLSL_BUNDLED_PUGIXML=OFF"} - {name: "ubuntu-18.04", os: "ubuntu-latest", docker: "ubuntu:18.04" } - - {name: "windows-x64", os: "windows-latest", cmake_extra: "-T v140,host=x86"} - - {name: "windows-32", os: "windows-latest", cmake_extra: "-T v140,host=x86 -A Win32"} + - {name: "windows-x64", os: "windows-2019", cmake_extra: "-T v140,host=x86"} + - {name: "windows-32", os: "windows-2019", cmake_extra: "-T v140,host=x86 -A Win32"} - {name: "macOS-latest", os: "macOS-latest"} # runs all steps in the container configured in config.docker or as subprocesses when empty diff --git a/CMakeLists.txt b/CMakeLists.txt index 97a08804..ac783f64 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.12) project (liblsl - VERSION 1.15.2 + VERSION 1.16.0 LANGUAGES C CXX DESCRIPTION "Labstreaminglayer C/C++ library" HOMEPAGE_URL "https://github.com/sccn/liblsl" diff --git a/examples/ReceiveDataInChunks.cpp b/examples/ReceiveDataInChunks.cpp index e3366a2a..139f6cfd 100644 --- a/examples/ReceiveDataInChunks.cpp +++ b/examples/ReceiveDataInChunks.cpp @@ -22,7 +22,7 @@ int main(int argc, char **argv) { bool flush = argc > 3; // resolve the stream of interest & make an inlet lsl::stream_info inlet_info = lsl::resolve_stream("name", name).at(0); - lsl::stream_inlet inlet(inlet_info, max_buffered); + lsl::stream_inlet inlet(inlet_info, (int32_t)max_buffered); // Use set_postprocessing to get the timestamps in a common base clock. // Do not use if this application will record timestamps to disk -- it is better to diff --git a/examples/SendData.cpp b/examples/SendData.cpp index 19194aa7..7a06a722 100644 --- a/examples/SendData.cpp +++ b/examples/SendData.cpp @@ -71,7 +71,7 @@ int main(int argc, char *argv[]) { // Create random data for the first 8 channels. for (int c = 0; c < 8; c++) sample[c] = (float)((rand() % 1500) / 500.0 - 1.5); // For the remaining channels, fill them with a sample counter (wraps at 1M). - std::fill(sample.begin() + 8, sample.end(), t % 1000000); + std::fill(sample.begin() + 8, sample.end(), (float)(t % 1000000)); // Wait until the next expected sample time. next_sample_time += std::chrono::microseconds(sample_dur_us); diff --git a/examples/SendDataInChunks.cpp b/examples/SendDataInChunks.cpp index 559a9159..5e83ce7d 100644 --- a/examples/SendDataInChunks.cpp +++ b/examples/SendDataInChunks.cpp @@ -25,14 +25,14 @@ struct fake_device { */ std::size_t n_channels; double srate; - int64_t pattern_samples; - int64_t head; + std::size_t pattern_samples; + std::size_t head; std::vector pattern; std::chrono::steady_clock::time_point last_time; fake_device(const int16_t n_channels, const float srate) : n_channels(n_channels), srate(srate), head(0) { - pattern_samples = (int64_t)(srate - 0.5) + 1; // truncate OK. + pattern_samples = (std::size_t)(srate - 0.5) + 1; // truncate OK. // Pre-allocate entire test pattern. The data _could_ be generated on the fly // for a much smaller memory hit, but we also use this example application @@ -47,8 +47,9 @@ struct fake_device { // sin(2*pi*f*t), where f cycles from 1 Hz to Nyquist: srate / 2 double f = (chan_ix + 1) % (int)(srate / 2); pattern.emplace_back( - offset_0 + chan_ix * offset_step + - magnitude * static_cast(sin(2 * M_PI * f * sample_ix / srate))); + static_cast( + offset_0 + chan_ix * offset_step + + magnitude * sin(2 * M_PI * f * sample_ix / srate))); } } last_time = std::chrono::steady_clock::now(); @@ -70,8 +71,8 @@ struct fake_device { auto now = std::chrono::steady_clock::now(); auto elapsed_nano = std::chrono::duration_cast(now - last_time).count(); - int64_t elapsed_samples = std::size_t(elapsed_nano * srate * 1e-9); // truncate OK. - elapsed_samples = std::min(elapsed_samples, (int64_t)(buffer.size() / n_channels)); + std::size_t elapsed_samples = std::size_t(elapsed_nano * srate * 1e-9); // truncate OK. + elapsed_samples = std::min(elapsed_samples, (std::size_t)(buffer.size() / n_channels)); if (nodata) { // The fastest but no patterns. // memset(&buffer[0], 23, buffer.size() * sizeof buffer[0]); @@ -116,7 +117,7 @@ int main(int argc, char **argv) { chn.append_child_value("unit", "microvolts"); chn.append_child_value("type", type); } - int32_t buf_samples = max_buffered * samplingrate; + int32_t buf_samples = (int32_t)(max_buffered * samplingrate); lsl::stream_outlet outlet(info, chunk_samples, buf_samples); info = outlet.info(); // Refresh info with whatever the outlet captured. std::cout << "Stream UID: " << info.uid() << std::endl; diff --git a/examples/SendDataSimple.cpp b/examples/SendDataSimple.cpp index 90c30aab..138eb874 100644 --- a/examples/SendDataSimple.cpp +++ b/examples/SendDataSimple.cpp @@ -22,7 +22,7 @@ int main(int argc, char *argv[]) { float sample[nchannels]; while (outlet.have_consumers()) { // generate random data - for (int c = 0; c < nchannels; c++) sample[c] = (rand() % 1500) / 500.0 - 1.5; + for (int c = 0; c < nchannels; c++) sample[c] = (float)((rand() % 1500) / 500.0 - 1.5); // send it outlet.push_sample(sample); std::this_thread::sleep_for(std::chrono::milliseconds(5)); diff --git a/examples/SendStringMarkersC.c b/examples/SendStringMarkersC.c index d3177b83..349fcc2f 100644 --- a/examples/SendStringMarkersC.c +++ b/examples/SendStringMarkersC.c @@ -18,7 +18,6 @@ void sleep_(int ms) { usleep(ms * 1000); } int main(int argc, char *argv[]) { lsl_streaminfo info; /* out stream declaration object */ lsl_outlet outlet; /* stream outlet */ - double endtime; /* used for send timing */ const char *mrk; /* marker to send next */ /* declare a new streaminfo (name: "MyEventStream", content type: "Markers", 1 channel, diff --git a/src/common.h b/src/common.h index ca02abf2..417720d1 100644 --- a/src/common.h +++ b/src/common.h @@ -46,7 +46,7 @@ extern "C" { const int LSL_PROTOCOL_VERSION = 110; // the library version -const int LSL_LIBRARY_VERSION = 115; +const int LSL_LIBRARY_VERSION = 116; /// size of the lsl_last_error() buffer size const int LAST_ERROR_SIZE = 512; diff --git a/testing/ext/DataType.cpp b/testing/ext/DataType.cpp index 0f50a518..36608cad 100644 --- a/testing/ext/DataType.cpp +++ b/testing/ext/DataType.cpp @@ -91,14 +91,14 @@ TEST_CASE("Flush", "[datatransfer][basic]") { }); double data_in; - double ts_in = sp.in_.pull_sample(&data_in, 1.); + double ts_in = sp.in_.pull_sample(&data_in, 1); REQUIRE(ts_in == Approx(data_in)); std::this_thread::sleep_for(std::chrono::milliseconds(700)); auto pulled = sp.in_.flush() + 1; for(; pulled < n; ++pulled) { INFO(pulled); - ts_in = sp.in_.pull_sample(&data_in, 1.); + ts_in = sp.in_.pull_sample(&data_in, 1); REQUIRE(ts_in == Approx(data_in)); } diff --git a/testing/int/samples.cpp b/testing/int/samples.cpp index c957384b..2ce8c92d 100644 --- a/testing/int/samples.cpp +++ b/testing/int/samples.cpp @@ -68,7 +68,7 @@ TEST_CASE("sample conversion", "[basic]") { CHECK(values[j] == static_cast(buf[j])); CHECK(strbuf[j] == std::to_string(buf[j])); } - values[0] = buf[0] << 1; - values[1] = -buf[0]; + values[0] = (double)(buf[0] << 1); + values[1] = (double)(-buf[0]); } }