Skip to content

Commit a9ff299

Browse files
Additional fixes
1 parent 9561293 commit a9ff299

4 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/data_stream.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,8 @@ void ByteStreamWriter::write(const std::vector<std::uint8_t> &data) {
344344
while (offset < data.size()) {
345345
const std::size_t n =
346346
std::min<std::size_t>(kStreamChunkSize, data.size() - offset);
347-
std::vector<std::uint8_t> chunk(data.begin() + offset,
348-
data.begin() + offset + n);
347+
auto it = data.begin() + static_cast<std::ptrdiff_t>(offset);
348+
std::vector<std::uint8_t> chunk(it, it + static_cast<std::ptrdiff_t>(n));
349349
sendChunk(chunk);
350350
offset += n;
351351
}

src/room.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ bool Room::Connect(const std::string &url, const std::string &token,
188188

189189
// Install listener (Room is fully initialized)
190190
auto listenerId = FfiClient::instance().AddListener(
191-
std::bind(&Room::OnEvent, this, std::placeholders::_1));
191+
[this](const proto::FfiEvent &e) { OnEvent(e); });
192192
{
193193
std::lock_guard<std::mutex> g(lock_);
194194
listener_id_ = listenerId;

src/tests/stress/test_rpc_stress.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ std::string generateRandomPayload(size_t size) {
115115
loadTestData();
116116

117117
static thread_local std::random_device rd;
118-
static thread_local std::mt19937 gen(rd());
118+
static thread_local std::mt19937 gen(
119+
static_cast<std::mt19937::result_type>(rd()));
119120

120121
if (gTestDataLines.empty()) {
121122
// Should not happen, but return empty string if no data

src/tests/unit/test_audio_processing_module.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ TEST_F(AudioProcessingModuleTest, AGCWithNoiseSuppressionCombined) {
894894

895895
// Add noise on top
896896
auto &data = frame.data();
897-
std::mt19937 gen(kSeed + 50 + i);
897+
std::mt19937 gen(static_cast<std::mt19937::result_type>(kSeed + 50 + i));
898898
std::uniform_real_distribution<> dis(-kNoiseAmplitude, kNoiseAmplitude);
899899
for (auto &sample : data) {
900900
sample = static_cast<std::int16_t>(std::clamp(

0 commit comments

Comments
 (0)