Skip to content

Commit 5eded5c

Browse files
authored
Merge pull request #167 from sccn/1.16
Version 1.16
2 parents 6cdcf74 + e505ded commit 5eded5c

File tree

10 files changed

+20
-20
lines changed

10 files changed

+20
-20
lines changed

.github/workflows/cppcmake.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ jobs:
3434
config:
3535
- {name: "ubuntu-20.04", os: "ubuntu-20.04", cmake_extra: "-DLSL_BUNDLED_PUGIXML=OFF"}
3636
- {name: "ubuntu-18.04", os: "ubuntu-latest", docker: "ubuntu:18.04" }
37-
- {name: "windows-x64", os: "windows-latest", cmake_extra: "-T v140,host=x86"}
38-
- {name: "windows-32", os: "windows-latest", cmake_extra: "-T v140,host=x86 -A Win32"}
37+
- {name: "windows-x64", os: "windows-2019", cmake_extra: "-T v140,host=x86"}
38+
- {name: "windows-32", os: "windows-2019", cmake_extra: "-T v140,host=x86 -A Win32"}
3939
- {name: "macOS-latest", os: "macOS-latest"}
4040

4141
# runs all steps in the container configured in config.docker or as subprocesses when empty

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required (VERSION 3.12)
22
project (liblsl
3-
VERSION 1.15.2
3+
VERSION 1.16.0
44
LANGUAGES C CXX
55
DESCRIPTION "Labstreaminglayer C/C++ library"
66
HOMEPAGE_URL "https://github.com/sccn/liblsl"

examples/ReceiveDataInChunks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ int main(int argc, char **argv) {
2222
bool flush = argc > 3;
2323
// resolve the stream of interest & make an inlet
2424
lsl::stream_info inlet_info = lsl::resolve_stream("name", name).at(0);
25-
lsl::stream_inlet inlet(inlet_info, max_buffered);
25+
lsl::stream_inlet inlet(inlet_info, (int32_t)max_buffered);
2626

2727
// Use set_postprocessing to get the timestamps in a common base clock.
2828
// Do not use if this application will record timestamps to disk -- it is better to

examples/SendData.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ int main(int argc, char *argv[]) {
7171
// Create random data for the first 8 channels.
7272
for (int c = 0; c < 8; c++) sample[c] = (float)((rand() % 1500) / 500.0 - 1.5);
7373
// For the remaining channels, fill them with a sample counter (wraps at 1M).
74-
std::fill(sample.begin() + 8, sample.end(), t % 1000000);
74+
std::fill(sample.begin() + 8, sample.end(), (float)(t % 1000000));
7575

7676
// Wait until the next expected sample time.
7777
next_sample_time += std::chrono::microseconds(sample_dur_us);

examples/SendDataInChunks.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ struct fake_device {
2525
*/
2626
std::size_t n_channels;
2727
double srate;
28-
int64_t pattern_samples;
29-
int64_t head;
28+
std::size_t pattern_samples;
29+
std::size_t head;
3030
std::vector<int16_t> pattern;
3131
std::chrono::steady_clock::time_point last_time;
3232

3333
fake_device(const int16_t n_channels, const float srate)
3434
: n_channels(n_channels), srate(srate), head(0) {
35-
pattern_samples = (int64_t)(srate - 0.5) + 1; // truncate OK.
35+
pattern_samples = (std::size_t)(srate - 0.5) + 1; // truncate OK.
3636

3737
// Pre-allocate entire test pattern. The data _could_ be generated on the fly
3838
// for a much smaller memory hit, but we also use this example application
@@ -47,8 +47,9 @@ struct fake_device {
4747
// sin(2*pi*f*t), where f cycles from 1 Hz to Nyquist: srate / 2
4848
double f = (chan_ix + 1) % (int)(srate / 2);
4949
pattern.emplace_back(
50-
offset_0 + chan_ix * offset_step +
51-
magnitude * static_cast<int16_t>(sin(2 * M_PI * f * sample_ix / srate)));
50+
static_cast<int16_t>(
51+
offset_0 + chan_ix * offset_step +
52+
magnitude * sin(2 * M_PI * f * sample_ix / srate)));
5253
}
5354
}
5455
last_time = std::chrono::steady_clock::now();
@@ -70,8 +71,8 @@ struct fake_device {
7071
auto now = std::chrono::steady_clock::now();
7172
auto elapsed_nano =
7273
std::chrono::duration_cast<std::chrono::nanoseconds>(now - last_time).count();
73-
int64_t elapsed_samples = std::size_t(elapsed_nano * srate * 1e-9); // truncate OK.
74-
elapsed_samples = std::min(elapsed_samples, (int64_t)(buffer.size() / n_channels));
74+
std::size_t elapsed_samples = std::size_t(elapsed_nano * srate * 1e-9); // truncate OK.
75+
elapsed_samples = std::min(elapsed_samples, (std::size_t)(buffer.size() / n_channels));
7576
if (nodata) {
7677
// The fastest but no patterns.
7778
// memset(&buffer[0], 23, buffer.size() * sizeof buffer[0]);
@@ -116,7 +117,7 @@ int main(int argc, char **argv) {
116117
chn.append_child_value("unit", "microvolts");
117118
chn.append_child_value("type", type);
118119
}
119-
int32_t buf_samples = max_buffered * samplingrate;
120+
int32_t buf_samples = (int32_t)(max_buffered * samplingrate);
120121
lsl::stream_outlet outlet(info, chunk_samples, buf_samples);
121122
info = outlet.info(); // Refresh info with whatever the outlet captured.
122123
std::cout << "Stream UID: " << info.uid() << std::endl;

examples/SendDataSimple.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ int main(int argc, char *argv[]) {
2222
float sample[nchannels];
2323
while (outlet.have_consumers()) {
2424
// generate random data
25-
for (int c = 0; c < nchannels; c++) sample[c] = (rand() % 1500) / 500.0 - 1.5;
25+
for (int c = 0; c < nchannels; c++) sample[c] = (float)((rand() % 1500) / 500.0 - 1.5);
2626
// send it
2727
outlet.push_sample(sample);
2828
std::this_thread::sleep_for(std::chrono::milliseconds(5));

examples/SendStringMarkersC.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ void sleep_(int ms) { usleep(ms * 1000); }
1818
int main(int argc, char *argv[]) {
1919
lsl_streaminfo info; /* out stream declaration object */
2020
lsl_outlet outlet; /* stream outlet */
21-
double endtime; /* used for send timing */
2221
const char *mrk; /* marker to send next */
2322

2423
/* declare a new streaminfo (name: "MyEventStream", content type: "Markers", 1 channel,

src/common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ extern "C" {
4646
const int LSL_PROTOCOL_VERSION = 110;
4747

4848
// the library version
49-
const int LSL_LIBRARY_VERSION = 115;
49+
const int LSL_LIBRARY_VERSION = 116;
5050

5151
/// size of the lsl_last_error() buffer size
5252
const int LAST_ERROR_SIZE = 512;

testing/ext/DataType.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,14 @@ TEST_CASE("Flush", "[datatransfer][basic]") {
9191
});
9292

9393
double data_in;
94-
double ts_in = sp.in_.pull_sample(&data_in, 1.);
94+
double ts_in = sp.in_.pull_sample(&data_in, 1);
9595
REQUIRE(ts_in == Approx(data_in));
9696
std::this_thread::sleep_for(std::chrono::milliseconds(700));
9797
auto pulled = sp.in_.flush() + 1;
9898

9999
for(; pulled < n; ++pulled) {
100100
INFO(pulled);
101-
ts_in = sp.in_.pull_sample(&data_in, 1.);
101+
ts_in = sp.in_.pull_sample(&data_in, 1);
102102
REQUIRE(ts_in == Approx(data_in));
103103
}
104104

testing/int/samples.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ TEST_CASE("sample conversion", "[basic]") {
6868
CHECK(values[j] == static_cast<int64_t>(buf[j]));
6969
CHECK(strbuf[j] == std::to_string(buf[j]));
7070
}
71-
values[0] = buf[0] << 1;
72-
values[1] = -buf[0];
71+
values[0] = (double)(buf[0] << 1);
72+
values[1] = (double)(-buf[0]);
7373
}
7474
}

0 commit comments

Comments
 (0)