Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some VC type conversion warnings #4574

Merged
merged 1 commit into from
Dec 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/controllers/midi/portmidicontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ void PortMidiController::send(const QByteArray& data) {
// Pm_WriteSysEx. Instead, it scans for a MIDI_EOX byte to know when the
// message is over. If one is not provided, it will overflow the buffer and
// cause a segfault.
if (!data.endsWith(MIDI_EOX)) {
if (!data.endsWith(static_cast<char>(MIDI_EOX))) {
controllerDebug("SysEx message does not end with 0xF7 -- ignoring.");
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/encoder/encoderopus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ void EncoderOpus::pushTagsPacket() {
int commentCount = 0;

const char* vendorString = opus_get_version_string();
int vendorStringLength = strlen(vendorString);
int vendorStringLength = static_cast<int>(strlen(vendorString));

// == Compute tags frame size ==
// - Magic signature: 8 bytes
Expand Down
2 changes: 1 addition & 1 deletion src/engine/sync/synccontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ void SyncControl::updateAudible() {
int channelIndex = m_pChannel->getChannelIndex();
if (channelIndex >= 0) {
CSAMPLE_GAIN gain = getEngineMaster()->getMasterGain(channelIndex);
bool newAudible = gain > CSAMPLE_GAIN_ZERO;
int newAudible = (gain > CSAMPLE_GAIN_ZERO) ? 1 : 0;
if (m_audible != newAudible) {
m_audible = newAudible;
m_pEngineSync->notifyPlayingAudible(this, m_pPlayButton->toBool() && m_audible);
Expand Down
4 changes: 2 additions & 2 deletions src/waveform/waveformwidgetfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ void WaveformWidgetFactory::render() {
// Don't bother doing the pre-render work if we aren't going to
// render this widget.
bool shouldRender = shouldRenderWaveform(pWaveformWidget);
shouldRenderWaveforms[i] = shouldRender;
shouldRenderWaveforms[static_cast<int>(i)] = shouldRender;
if (!shouldRender) {
continue;
}
Expand All @@ -662,7 +662,7 @@ void WaveformWidgetFactory::render() {
i < m_waveformWidgetHolders.size();
i++) {
WaveformWidgetAbstract* pWaveformWidget = m_waveformWidgetHolders[i].m_waveformWidget;
if (!shouldRenderWaveforms[i]) {
if (!shouldRenderWaveforms[static_cast<int>(i)]) {
continue;
}
pWaveformWidget->render();
Expand Down
2 changes: 1 addition & 1 deletion src/widget/wtracktableviewheader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ HeaderViewState::HeaderViewState(const QString& base64serialized) {
QString HeaderViewState::saveState() const {
// Serialize the proto to a byte array, then encode the array as Base64.
#if GOOGLE_PROTOBUF_VERSION >= 3001000
size_t size = m_view_state.ByteSizeLong();
int size = static_cast<int>(m_view_state.ByteSizeLong());
#else
int size = m_view_state.ByteSize();
#endif
Expand Down