Skip to content

Commit

Permalink
Merge PR #6536: BUILD: Fix compiler warnings on 32bit architectures
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzmbrzl authored Aug 20, 2024
2 parents 4985b18 + da02ba2 commit 4610353
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/MumbleProtocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ namespace Protocol {
}


m_audioData.payload = gsl::span< byte >(payloadBegin, payloadSize);
m_audioData.payload = gsl::span< byte >(payloadBegin, static_cast< std::size_t >(payloadSize));

if (stream.left() == 3 * sizeof(float)) {
// If there are further bytes after the audio payload, this means that there is positional data attached to
Expand Down
2 changes: 1 addition & 1 deletion src/mumble/Audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void LoopUser::addFrame(const Mumble::Protocol::AudioData &audioData) {
QMutexLocker l(&qmLock);
bool restart = (qetLastFetch.elapsed() > 100);

long time = qetTicker.elapsed();
qint64 time = qetTicker.elapsed();

float r;
if (restart)
Expand Down
9 changes: 5 additions & 4 deletions src/mumble/AudioOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,12 +616,13 @@ bool AudioOutput::mix(void *outbuff, unsigned int frameCount) {
if (speech->bStereo) {
// Mix down stereo to mono. TODO: stereo record support
// frame: for a stereo stream, the [LR] pair inside ...[LR]LRLRLR.... is a frame
for (unsigned int i = 0; i < frameCount; ++i) {
recbuff[i] += (pfBuffer[2 * i] / 2.0f + pfBuffer[2 * i + 1] / 2.0f) * volumeAdjustment;
for (std::size_t i = 0; i < frameCount; ++i) {
recbuff.get()[i] +=
(pfBuffer[2 * i] / 2.0f + pfBuffer[2 * i + 1] / 2.0f) * volumeAdjustment;
}
} else {
for (unsigned int i = 0; i < frameCount; ++i) {
recbuff[i] += pfBuffer[i] * volumeAdjustment;
for (std::size_t i = 0; i < frameCount; ++i) {
recbuff.get()[i] += pfBuffer[i] * volumeAdjustment;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/murmur/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,7 @@ void Server::sendMessage(ServerUser &u, const unsigned char *data, int len, QByt
((reinterpret_cast< quint64 >(ebuffer.data()) + 8) & static_cast< quint64 >(~7)) + 4);
#else
std::vector< char > bufVec;
bufVec.resize(len + 4);
bufVec.resize(static_cast< std::size_t >(len + 4));
char *buffer = bufVec.data();
#endif
{
Expand Down

0 comments on commit 4610353

Please sign in to comment.