Fix C4189 and C4100 Warnings

C4189 is 'Local variable initialised but not used'
C4100 is 'Unreferenced parameter'

Fixed some other warnings, e.g. about empty if, too.
This commit is contained in:
James Crook 2018-10-10 19:09:10 +01:00
parent 66c861315f
commit 657159d542
30 changed files with 82 additions and 53 deletions

View File

@ -585,6 +585,8 @@ void DerivativeOfWindowFunc(int whichFunction, size_t NumSamples, bool extraSamp
// There are deltas at the ends // There are deltas at the ends
const double multiplier = 2 * M_PI / NumSamples; const double multiplier = 2 * M_PI / NumSamples;
static const double coeff0 = 0.54, coeff1 = -0.46 * multiplier; static const double coeff0 = 0.54, coeff1 = -0.46 * multiplier;
// TODO This code should be more explicit about the precision it intends.
// For now we get C4305 warnings, truncation from 'const double' to 'float'
in[0] *= coeff0; in[0] *= coeff0;
if (!extraSample) if (!extraSample)
--NumSamples; --NumSamples;

View File

@ -2569,7 +2569,7 @@ bool LabelTrack::PasteOver(double t, const Track * src)
if (! result ) if (! result )
// THROW_INCONSISTENCY_EXCEPTION; // ? // THROW_INCONSISTENCY_EXCEPTION; // ?
; (void)0;// intentionally do nothing
return result; return result;
} }
@ -2587,7 +2587,7 @@ void LabelTrack::Paste(double t, const Track *src)
if ( !bOk ) if ( !bOk )
// THROW_INCONSISTENCY_EXCEPTION; // ? // THROW_INCONSISTENCY_EXCEPTION; // ?
; (void)0;// intentionally do nothing
} }
// This repeats the labels in a time interval a specified number of times. // This repeats the labels in a time interval a specified number of times.

View File

@ -332,7 +332,7 @@ bool InvertMatrix(const Matrix& input, Matrix& Minv)
continue; continue;
if (fabs(M[j][i]) > 0) { if (fabs(M[j][i]) > 0) {
// Subtract a multiple of row i from row j // Subtract a multiple of row i from row j
double factor = M[j][i]; factor = M[j][i];
for(unsigned k = 0; k < N; k++) { for(unsigned k = 0; k < N; k++) {
M[j][k] -= (M[i][k] * factor); M[j][k] -= (M[i][k] * factor);
Minv[j][k] -= (Minv[i][k] * factor); Minv[j][k] -= (Minv[i][k] * factor);

View File

@ -5702,7 +5702,7 @@ void MenuCommandHandler::OnPaste(const CommandContext &context)
bool bPastedSomething = false; bool bPastedSomething = false;
auto pC = clipTrackRange.begin(); auto pC = clipTrackRange.begin();
size_t nnChannels, ncChannels; size_t nnChannels=0, ncChannels=0;
while (*pN && *pC) { while (*pN && *pC) {
auto n = *pN; auto n = *pN;
auto c = *pC; auto c = *pC;
@ -6852,6 +6852,8 @@ void MenuCommandHandler::OnSelectClipBoundary(AudacityProject &project, bool nex
MenuCommandHandler::FoundClip MenuCommandHandler::FindNextClip MenuCommandHandler::FoundClip MenuCommandHandler::FindNextClip
(AudacityProject &project, const WaveTrack* wt, double t0, double t1) (AudacityProject &project, const WaveTrack* wt, double t0, double t1)
{ {
(void)project;//Compiler food.
FoundClip result{}; FoundClip result{};
result.waveTrack = wt; result.waveTrack = wt;
const auto clips = wt->SortedClipArray(); const auto clips = wt->SortedClipArray();
@ -6888,6 +6890,8 @@ MenuCommandHandler::FoundClip MenuCommandHandler::FindNextClip
MenuCommandHandler::FoundClip MenuCommandHandler::FindPrevClip MenuCommandHandler::FoundClip MenuCommandHandler::FindPrevClip
(AudacityProject &project, const WaveTrack* wt, double t0, double t1) (AudacityProject &project, const WaveTrack* wt, double t0, double t1)
{ {
(void)project;//Compiler food.
FoundClip result{}; FoundClip result{};
result.waveTrack = wt; result.waveTrack = wt;
const auto clips = wt->SortedClipArray(); const auto clips = wt->SortedClipArray();
@ -7276,7 +7280,6 @@ void MenuCommandHandler::OnZoomFit(const CommandContext &context)
{ {
auto &project = context.project; auto &project = context.project;
auto &viewInfo = project.GetViewInfo(); auto &viewInfo = project.GetViewInfo();
auto &selectedRegion = viewInfo.selectedRegion;
auto tracks = project.GetTracks(); auto tracks = project.GetTracks();
const double start = viewInfo.bScrollBeyondZero const double start = viewInfo.bScrollBeyondZero
@ -7973,7 +7976,6 @@ void MenuCommandHandler::OnCursorTrackEnd(const CommandContext &context)
auto &selectedRegion = project.GetViewInfo().selectedRegion; auto &selectedRegion = project.GetViewInfo().selectedRegion;
double kWayOverToLeft = std::numeric_limits<double>::lowest(); double kWayOverToLeft = std::numeric_limits<double>::lowest();
double thisEndOffset = 0.0;
auto trackRange = tracks->Selected(); auto trackRange = tracks->Selected();
if (trackRange.empty()) if (trackRange.empty())

View File

@ -107,7 +107,7 @@ void MixAndRender(TrackList *tracks, TrackFactory *trackFactory,
} }
/* create the destination track (NEW track) */ /* create the destination track (NEW track) */
if (numWaves == TrackList::Channels(first).size()) if (numWaves == (int)TrackList::Channels(first).size())
oneinput = true; oneinput = true;
// only one input track (either 1 mono or one linked stereo pair) // only one input track (either 1 mono or one linked stereo pair)

View File

@ -612,7 +612,7 @@ void NoteTrack::Paste(double t, const Track *src)
if ( !bOk ) if ( !bOk )
// THROW_INCONSISTENCY_EXCEPTION; // ? // THROW_INCONSISTENCY_EXCEPTION; // ?
; (void)0;// intentionally do nothing
} }
void NoteTrack::Silence(double t0, double t1) void NoteTrack::Silence(double t0, double t1)

View File

@ -313,7 +313,7 @@ wxAccStatus CheckListAx::GetSelections( wxVariant * WXUNUSED(selections) )
} }
// Returns a state constant. // Returns a state constant.
wxAccStatus CheckListAx::GetState( int childId, long *state ) wxAccStatus CheckListAx::GetState( int childId, long *pState )
{ {
int flag = wxACC_STATE_SYSTEM_FOCUSABLE; int flag = wxACC_STATE_SYSTEM_FOCUSABLE;
@ -347,7 +347,7 @@ wxAccStatus CheckListAx::GetState( int childId, long *state )
} }
} }
*state = flag; *pState = flag;
return wxACC_OK; return wxACC_OK;
} }
@ -1947,7 +1947,7 @@ void PluginManager::Load()
} }
// Doing the deletion within the search loop risked skipping some items, // Doing the deletion within the search loop risked skipping some items,
// hence the delayed delete. // hence the delayed delete.
for (int i = 0; i < groupsToDelete.Count(); i++) { for (unsigned int i = 0; i < groupsToDelete.Count(); i++) {
registry.DeleteGroup(groupsToDelete[i]); registry.DeleteGroup(groupsToDelete[i]);
} }
registry.SetPath(""); registry.SetPath("");

View File

@ -403,6 +403,7 @@ size_t EnumSetting::Find( const wxString &value ) const
void EnumSetting::Migrate( wxString &value ) void EnumSetting::Migrate( wxString &value )
{ {
(void)value;// Compiler food
} }
bool EnumSetting::Write( const wxString &value ) bool EnumSetting::Write( const wxString &value )

View File

@ -128,7 +128,7 @@ void TimeTrack::Paste(double t, const Track * src)
if (! bOk ) if (! bOk )
// THROW_INCONSISTENCY_EXCEPTION // ? // THROW_INCONSISTENCY_EXCEPTION // ?
; (void)0;// intentionally do nothing.
} }
void TimeTrack::Silence(double WXUNUSED(t0), double WXUNUSED(t1)) void TimeTrack::Silence(double WXUNUSED(t0), double WXUNUSED(t1))

View File

@ -1899,17 +1899,19 @@ void TrackArtist::DrawClipWaveform(TrackPanelDrawingContext &context,
} }
} }
// TODO Add a comment to say what this loop does.
// Possily make it into a subroutine.
for (unsigned ii = 0; ii < nPortions; ++ii) { for (unsigned ii = 0; ii < nPortions; ++ii) {
WavePortion &portion = portions[ii]; WavePortion &portion = portions[ii];
const bool showIndividualSamples = portion.averageZoom > threshold1; const bool showIndividualSamples = portion.averageZoom > threshold1;
const bool showPoints = portion.averageZoom > threshold2; const bool showPoints = portion.averageZoom > threshold2;
wxRect& rect = portion.rect; wxRect& rectPortion = portion.rect;
rect.Intersect(mid); rectPortion.Intersect(mid);
wxASSERT(rect.width >= 0); wxASSERT(rectPortion.width >= 0);
float *useMin = 0, *useMax = 0, *useRms = 0; float *useMin = 0, *useMax = 0, *useRms = 0;
int *useBl = 0; int *useBl = 0;
WaveDisplay fisheyeDisplay(rect.width); WaveDisplay fisheyeDisplay(rectPortion.width);
int skipped = 0, skippedLeft = 0, skippedRight = 0; int skipped = 0, skippedLeft = 0, skippedRight = 0;
if (portion.inFisheye) { if (portion.inFisheye) {
if (!showIndividualSamples) { if (!showIndividualSamples) {
@ -1917,12 +1919,12 @@ void TrackArtist::DrawClipWaveform(TrackPanelDrawingContext &context,
const auto numSamples = clip->GetNumSamples(); const auto numSamples = clip->GetNumSamples();
// Get wave display data for different magnification // Get wave display data for different magnification
int jj = 0; int jj = 0;
for (; jj < rect.width; ++jj) { for (; jj < rectPortion.width; ++jj) {
const double time = const double time =
zoomInfo.PositionToTime(jj, -leftOffset) - tOffset; zoomInfo.PositionToTime(jj, -leftOffset) - tOffset;
const auto sample = (sampleCount)floor(time * rate + 0.5); const auto sample = (sampleCount)floor(time * rate + 0.5);
if (sample < 0) { if (sample < 0) {
++rect.x; ++rectPortion.x;
++skippedLeft; ++skippedLeft;
continue; continue;
} }
@ -1931,9 +1933,9 @@ void TrackArtist::DrawClipWaveform(TrackPanelDrawingContext &context,
fisheyeDisplay.where[jj - skippedLeft] = sample; fisheyeDisplay.where[jj - skippedLeft] = sample;
} }
skippedRight = rect.width - jj; skippedRight = rectPortion.width - jj;
skipped = skippedRight + skippedLeft; skipped = skippedRight + skippedLeft;
rect.width -= skipped; rectPortion.width -= skipped;
// where needs a sentinel // where needs a sentinel
if (jj > 0) if (jj > 0)
@ -1941,7 +1943,7 @@ void TrackArtist::DrawClipWaveform(TrackPanelDrawingContext &context,
1 + fisheyeDisplay.where[jj - skippedLeft - 1]; 1 + fisheyeDisplay.where[jj - skippedLeft - 1];
fisheyeDisplay.width -= skipped; fisheyeDisplay.width -= skipped;
// Get a wave display for the fisheye, uncached. // Get a wave display for the fisheye, uncached.
if (rect.width > 0) if (rectPortion.width > 0)
if (!clip->GetWaveDisplay( if (!clip->GetWaveDisplay(
fisheyeDisplay, t0, -1.0, // ignored fisheyeDisplay, t0, -1.0, // ignored
isLoadingOD)) isLoadingOD))
@ -1962,9 +1964,9 @@ void TrackArtist::DrawClipWaveform(TrackPanelDrawingContext &context,
leftOffset += skippedLeft; leftOffset += skippedLeft;
if (rect.width > 0) { if (rectPortion.width > 0) {
if (!showIndividualSamples) { if (!showIndividualSamples) {
std::vector<double> vEnv2(rect.width); std::vector<double> vEnv2(rectPortion.width);
double *const env2 = &vEnv2[0]; double *const env2 = &vEnv2[0];
clip->GetEnvelope()->GetValues clip->GetEnvelope()->GetValues
( tOffset, ( tOffset,
@ -1973,8 +1975,8 @@ void TrackArtist::DrawClipWaveform(TrackPanelDrawingContext &context,
// and then interpolate the display // and then interpolate the display
0, // 1.0 / rate, 0, // 1.0 / rate,
env2, rect.width, leftOffset, zoomInfo ); env2, rectPortion.width, leftOffset, zoomInfo );
DrawMinMaxRMS(dc, rect, env2, DrawMinMaxRMS(dc, rectPortion, env2,
zoomMin, zoomMax, zoomMin, zoomMax,
dB, dBRange, dB, dBRange,
useMin, useMax, useRms, useBl, useMin, useMax, useRms, useBl,
@ -1986,14 +1988,14 @@ void TrackArtist::DrawClipWaveform(TrackPanelDrawingContext &context,
auto target = dynamic_cast<SampleHandle*>(context.target.get()); auto target = dynamic_cast<SampleHandle*>(context.target.get());
highlight = target && target->GetTrack().get() == track; highlight = target && target->GetTrack().get() == track;
#endif #endif
DrawIndividualSamples(dc, leftOffset, rect, zoomMin, zoomMax, DrawIndividualSamples(dc, leftOffset, rectPortion, zoomMin, zoomMax,
dB, dBRange, dB, dBRange,
clip, zoomInfo, clip, zoomInfo,
bigPoints, showPoints, muted, highlight); bigPoints, showPoints, muted, highlight);
} }
} }
leftOffset += rect.width + skippedRight; leftOffset += rectPortion.width + skippedRight;
} }
if (drawEnvelope) { if (drawEnvelope) {

View File

@ -1752,6 +1752,7 @@ void TrackPanel::DrawOutside
void TrackPanel::DrawOutsideOfTrack void TrackPanel::DrawOutsideOfTrack
(TrackPanelDrawingContext &context, const Track * t, const wxRect & rect) (TrackPanelDrawingContext &context, const Track * t, const wxRect & rect)
{ {
(void)t;// Compiler food
auto dc = &context.dc; auto dc = &context.dc;
// Fill in area outside of the track // Fill in area outside of the track

View File

@ -24,6 +24,7 @@ TrackPanelResizerCell::TrackPanelResizerCell( std::shared_ptr<Track> pTrack )
std::vector<UIHandlePtr> TrackPanelResizerCell::HitTest std::vector<UIHandlePtr> TrackPanelResizerCell::HitTest
(const TrackPanelMouseState &st, const AudacityProject *pProject) (const TrackPanelMouseState &st, const AudacityProject *pProject)
{ {
(void)pProject;// Compiler food
std::vector<UIHandlePtr> results; std::vector<UIHandlePtr> results;
auto pTrack = mpTrack.lock(); auto pTrack = mpTrack.lock();
if (pTrack) { if (pTrack) {

View File

@ -1175,7 +1175,7 @@ void SpecCache::Populate
#ifdef _OPENMP #ifdef _OPENMP
#pragma omp parallel for #pragma omp parallel for
#endif #endif
for (auto xx = lowerBoundX; xx < upperBoundX; ++xx) { for (xx = lowerBoundX; xx < upperBoundX; ++xx) {
float *const results = &freq[nBins * xx]; float *const results = &freq[nBins * xx];
for (size_t ii = 0; ii < nBins; ++ii) { for (size_t ii = 0; ii < nBins; ++ii) {
float &power = results[ii]; float &power = results[ii];

View File

@ -1360,7 +1360,7 @@ void WaveTrack::Paste(double t0, const Track *src)
if( !bOk ) if( !bOk )
// THROW_INCONSISTENCY_EXCEPTION; // ? // THROW_INCONSISTENCY_EXCEPTION; // ?
; (void)0;// Empty if intentional.
} }
void WaveTrack::Silence(double t0, double t1) void WaveTrack::Silence(double t0, double t1)

View File

@ -107,7 +107,6 @@ int ExecCommand2(wxString *pIn, wxString *pOut)
CommandBuilder builder(*pIn); CommandBuilder builder(*pIn);
if (builder.WasValid()) if (builder.WasValid())
{ {
AudacityProject *project = GetActiveProject();
OldStyleCommandPointer cmd = builder.GetCommand(); OldStyleCommandPointer cmd = builder.GetCommand();
AppCommandEvent ev; AppCommandEvent ev;
ev.SetCommand(cmd); ev.SetCommand(cmd);

View File

@ -230,6 +230,7 @@ bool SelectTracksCommand::Apply(const CommandContext &context)
// Add 0.01 so we are free of rounding errors in comparisons. // Add 0.01 so we are free of rounding errors in comparisons.
constexpr double fudge = 0.01; constexpr double fudge = 0.01;
for (auto channel : channels) { for (auto channel : channels) {
(void)channel;// compiler food
double track = index + fudge + term; double track = index + fudge + term;
bool sel = first <= track && track <= last; bool sel = first <= track && track <= last;
if( mMode == 0 ){ // Set if( mMode == 0 ){ // Set

View File

@ -345,6 +345,7 @@ void ContrastDialog::OnGetForeground(wxCommandEvent & /*event*/)
AudacityProject *p = GetActiveProject(); AudacityProject *p = GetActiveProject();
for ( auto t : p->GetTracks()->Selected< const WaveTrack >() ) { for ( auto t : p->GetTracks()->Selected< const WaveTrack >() ) {
(void)t;// Compiler food;
mForegroundStartT->SetValue(p->mViewInfo.selectedRegion.t0()); mForegroundStartT->SetValue(p->mViewInfo.selectedRegion.t0());
mForegroundEndT->SetValue(p->mViewInfo.selectedRegion.t1()); mForegroundEndT->SetValue(p->mViewInfo.selectedRegion.t1());
} }
@ -360,6 +361,7 @@ void ContrastDialog::OnGetBackground(wxCommandEvent & /*event*/)
AudacityProject *p = GetActiveProject(); AudacityProject *p = GetActiveProject();
for ( auto t : p->GetTracks()->Selected< const WaveTrack >() ) { for ( auto t : p->GetTracks()->Selected< const WaveTrack >() ) {
(void)t;// Compiler food;
mBackgroundStartT->SetValue(p->mViewInfo.selectedRegion.t0()); mBackgroundStartT->SetValue(p->mViewInfo.selectedRegion.t0());
mBackgroundEndT->SetValue(p->mViewInfo.selectedRegion.t1()); mBackgroundEndT->SetValue(p->mViewInfo.selectedRegion.t1());
} }

View File

@ -194,7 +194,7 @@ bool EffectReverse::ProcessOneWave(int count, WaveTrack * track, sampleCount sta
// PRL: I don't think that matters, the sequence of storage of clips in the track // PRL: I don't think that matters, the sequence of storage of clips in the track
// is not elsewhere assumed to be by time // is not elsewhere assumed to be by time
{ {
for (auto it = revClips.rbegin(), end = revClips.rend(); it != end; ++it) for (auto it = revClips.rbegin(), revEnd = revClips.rend(); it != revEnd; ++it)
track->AddClip(std::move(*it)); track->AddClip(std::move(*it));
} }

View File

@ -1838,10 +1838,10 @@ bool LV2Effect::TransferDataToWindow()
return true; return true;
} }
for (size_t i = 0, cnt = mGroups.GetCount(); i < cnt; i++) for (size_t i = 0, groupCount = mGroups.GetCount(); i < GroupCount; i++)
{ {
const auto & params = mGroupMap[mGroups[i]]; const auto & params = mGroupMap[mGroups[i]];
for (size_t pi = 0, cnt = params.size(); pi < cnt; pi++) for (size_t pi = 0, ParamCount = params.size(); pi < ParamCount; pi++)
{ {
int p = params[pi]; int p = params[pi];
LV2Port & ctrl = mControls[p]; LV2Port & ctrl = mControls[p];

View File

@ -2134,7 +2134,7 @@ bool NyquistEffect::ParseProgram(wxInputStream & stream)
// The trick is that xgettext will not consider such lines comments // The trick is that xgettext will not consider such lines comments
// and will extract the strings they contain // and will extract the strings they contain
(line[0] == wxT(';') || (line[0] == wxT(';') ||
(dollar = (line[0] == wxT('$'))))) ((dollar = (line[0] == wxT('$'))))))
{ {
Tokenizer tzer; Tokenizer tzer;
unsigned nLines = 1; unsigned nLines = 1;

View File

@ -1775,7 +1775,7 @@ int ExportFFmpegOptions::FetchCompatibleFormatList(AVCodecID id, wxString *selfm
if (ofmt->audio_codec == id) if (ofmt->audio_codec == id)
{ {
wxString ofmtname = wxString::FromUTF8(ofmt->name); wxString ofmtname = wxString::FromUTF8(ofmt->name);
bool found = false; found = false;
for (unsigned int i = 0; i < FromList.GetCount(); i++) for (unsigned int i = 0; i < FromList.GetCount(); i++)
{ {
if (ofmtname.Cmp(FromList[i]) == 0) if (ofmtname.Cmp(FromList[i]) == 0)

View File

@ -388,8 +388,10 @@ namespace
break; break;
case TWINDOW: case TWINDOW:
NewWindowFunc(windowType, windowSize, extra, window.get() + padding); NewWindowFunc(windowType, windowSize, extra, window.get() + padding);
for (int ii = padding, multiplier = -(int)windowSize / 2; ii < (int)endOfWindow; ++ii, ++multiplier) {
window[ii] *= multiplier; for (int ii = padding, multiplier = -(int)windowSize / 2; ii < (int)endOfWindow; ++ii, ++multiplier)
window[ii] *= multiplier;
}
break; break;
case DWINDOW: case DWINDOW:
DerivativeOfWindowFunc(windowType, windowSize, extra, window.get() + padding); DerivativeOfWindowFunc(windowType, windowSize, extra, window.get() + padding);

View File

@ -876,6 +876,7 @@ void ToolBar::OnErase( wxEraseEvent & WXUNUSED(event) )
// //
void ToolBar::OnPaint( wxPaintEvent & event ) void ToolBar::OnPaint( wxPaintEvent & event )
{ {
(void)event;// compiler food.
//wxPaintDC dc( (wxWindow *) event.GetEventObject() ); //wxPaintDC dc( (wxWindow *) event.GetEventObject() );
wxPaintDC dc( this ); wxPaintDC dc( this );
// Start with a clean background // Start with a clean background

View File

@ -192,12 +192,12 @@ UIHandle::Result StretchHandle::Drag
const wxMouseEvent &event = evt.event; const wxMouseEvent &event = evt.event;
const int x = event.m_x; const int x = event.m_x;
Track *clickedTrack; Track *clickedTrack=nullptr;
if (evt.pCell) if (evt.pCell)
clickedTrack = clickedTrack =
static_cast<CommonTrackPanelCell*>(evt.pCell.get())->FindTrack().get(); static_cast<CommonTrackPanelCell*>(evt.pCell.get())->FindTrack().get();
if (clickedTrack == NULL && mpTrack != NULL) if (clickedTrack == nullptr && mpTrack != nullptr)
clickedTrack = mpTrack.get(); clickedTrack = mpTrack.get();
Stretch(pProject, x, mLeftEdge, clickedTrack); Stretch(pProject, x, mLeftEdge, clickedTrack);
return RefreshAll; return RefreshAll;

View File

@ -935,7 +935,6 @@ void WaveTrackMenuTable::OnSwapChannels(wxCommandEvent &)
Track *const focused = project->GetTrackPanel()->GetFocusedTrack(); Track *const focused = project->GetTrackPanel()->GetFocusedTrack();
const bool hasFocus = channels.contains( focused ); const bool hasFocus = channels.contains( focused );
auto first = *channels.begin();
auto partner = *channels.rbegin(); auto partner = *channels.rbegin();
SplitStereo(false); SplitStereo(false);

View File

@ -79,8 +79,8 @@ UIHandlePtr GainSliderHandle::HitTest
if ( TrackInfo::HideTopItem( rect, sliderRect)) if ( TrackInfo::HideTopItem( rect, sliderRect))
return {}; return {};
if (sliderRect.Contains(state.m_x, state.m_y)) { if (sliderRect.Contains(state.m_x, state.m_y)) {
wxRect sliderRect; wxRect sliderRect2;
TrackInfo::GetGainRect(rect.GetTopLeft(), sliderRect); TrackInfo::GetGainRect(rect.GetTopLeft(), sliderRect2);
auto sliderFn = auto sliderFn =
[]( AudacityProject *pProject, const wxRect &sliderRect, Track *pTrack ) { []( AudacityProject *pProject, const wxRect &sliderRect, Track *pTrack ) {
return TrackInfo::GainSlider return TrackInfo::GainSlider
@ -88,7 +88,7 @@ UIHandlePtr GainSliderHandle::HitTest
const_cast<TrackPanel*>(pProject->GetTrackPanel())); const_cast<TrackPanel*>(pProject->GetTrackPanel()));
}; };
auto result = auto result =
std::make_shared<GainSliderHandle>( sliderFn, sliderRect, pTrack ); std::make_shared<GainSliderHandle>( sliderFn, sliderRect2, pTrack );
result = AssignUIHandlePtr(holder, result); result = AssignUIHandlePtr(holder, result);
return result; return result;

View File

@ -50,7 +50,7 @@ std::vector<UIHandlePtr> WaveTrack::DetailedHitTest
// Some special targets are not drawn in spectrogram, // Some special targets are not drawn in spectrogram,
// so don't hit them in such views. // so don't hit them in such views.
else if (isWaveform) { else if (isWaveform) {
UIHandlePtr result;
if (NULL != (result = CutlineHandle::HitTest( if (NULL != (result = CutlineHandle::HitTest(
mCutlineHandle, st.state, st.rect, mCutlineHandle, st.state, st.rect,
pProject, Pointer<WaveTrack>(this)))) pProject, Pointer<WaveTrack>(this))))

View File

@ -536,6 +536,8 @@ namespace {
const ViewInfo &viewInfo, wxCoord xx, ClipMoveState &state, const ViewInfo &viewInfo, wxCoord xx, ClipMoveState &state,
double tolerance, double &desiredSlideAmount ) double tolerance, double &desiredSlideAmount )
{ {
(void)xx;// Compiler food
(void)viewInfo;// Compiler food
bool ok = true; bool ok = true;
double firstTolerance = tolerance; double firstTolerance = tolerance;

View File

@ -988,9 +988,7 @@ bool LWSlider::DoShowDialog(wxPoint pos)
if (pos == wxPoint(-1, -1)) { if (pos == wxPoint(-1, -1)) {
dlg.Center(); dlg.Center();
} }
float initialValue = mCurrentValue;
changed = (dlg.ShowModal() == wxID_OK); changed = (dlg.ShowModal() == wxID_OK);
if( changed ) if( changed )
value = dlg.Get(); value = dlg.Get();

View File

@ -2050,6 +2050,8 @@ public:
(const TrackPanelMouseState &state, const AudacityProject *pProject) (const TrackPanelMouseState &state, const AudacityProject *pProject)
override override
{ {
(void)pProject;// Compiler food
(void)state;// Compiler food
// May come here when recording is in progress, so hit tests are turned // May come here when recording is in progress, so hit tests are turned
// off. // off.
wxString tooltip; wxString tooltip;
@ -2068,6 +2070,8 @@ public:
(const wxRect &rect, (const wxRect &rect,
wxWindow *pParent, wxPoint *pPosition) final override wxWindow *pParent, wxPoint *pPosition) final override
{ {
(void)pParent;// Compiler food
(void)rect;// Compiler food
mParent->ShowContextMenu(mMenuChoice, pPosition); mParent->ShowContextMenu(mMenuChoice, pPosition);
return 0; return 0;
} }
@ -2125,6 +2129,7 @@ protected:
Result Cancel(AudacityProject *pProject) override Result Cancel(AudacityProject *pProject) override
{ {
(void)pProject;// Compiler food
return RefreshCode::DrawOverlays; return RefreshCode::DrawOverlays;
} }
@ -2230,6 +2235,7 @@ protected:
Result Click Result Click
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override (const TrackPanelMouseEvent &event, AudacityProject *pProject) override
{ {
(void)pProject;// Compiler food
if (event.event.LeftDClick()) { if (event.event.LeftDClick()) {
// Restore default position on double click // Restore default position on double click
TracksPrefs::SetPinnedHeadPositionPreference( 0.5, true ); TracksPrefs::SetPinnedHeadPositionPreference( 0.5, true );
@ -2255,6 +2261,9 @@ protected:
(const TrackPanelMouseState &state, const AudacityProject *pProject) (const TrackPanelMouseState &state, const AudacityProject *pProject)
override override
{ {
(void)pProject;// Compiler food
(void)state;// Compiler food
static wxCursor cursor{ wxCURSOR_SIZEWE }; static wxCursor cursor{ wxCURSOR_SIZEWE };
return { return {
_( "Click and drag to adjust, double-click to reset" ), _( "Click and drag to adjust, double-click to reset" ),
@ -2274,6 +2283,7 @@ protected:
Result Cancel(AudacityProject *pProject) override Result Cancel(AudacityProject *pProject) override
{ {
(void)pProject;// Compiler food
TracksPrefs::SetPinnedHeadPositionPreference( mOrigPreference ); TracksPrefs::SetPinnedHeadPositionPreference( mOrigPreference );
return RefreshCode::DrawOverlays; return RefreshCode::DrawOverlays;
} }
@ -2328,12 +2338,14 @@ std::vector<UIHandlePtr> AdornedRulerPanel::QPCell::HitTest
auto xx = state.state.m_x; auto xx = state.state.m_x;
#ifdef EXPERIMENTAL_DRAGGABLE_PLAY_HEAD #ifdef EXPERIMENTAL_DRAGGABLE_PLAY_HEAD
// Allow click and drag on the play head even while recording {
// Make this handle more prominent then the quick play handle // Allow click and drag on the play head even while recording
auto result = PlayheadHandle::HitTest( pProject, xx ); // Make this handle more prominent then the quick play handle
if (result) { auto result = PlayheadHandle::HitTest( pProject, xx );
result = AssignUIHandlePtr( mPlayheadHolder, result ); if (result) {
results.push_back( result ); result = AssignUIHandlePtr( mPlayheadHolder, result );
results.push_back( result );
}
} }
#endif #endif
@ -2461,6 +2473,7 @@ std::vector<UIHandlePtr> AdornedRulerPanel::ScrubbingCell::HitTest
(const TrackPanelMouseState &state, (const TrackPanelMouseState &state,
const AudacityProject *pProject) const AudacityProject *pProject)
{ {
(void)pProject;// Compiler food
// Creation of overlays on demand here -- constructor of AdornedRulerPanel // Creation of overlays on demand here -- constructor of AdornedRulerPanel
// is too early to do it // is too early to do it
mParent->CreateOverlays(); mParent->CreateOverlays();
@ -3037,6 +3050,7 @@ auto AdornedRulerPanel::ScrubbingHandle::Preview
(const TrackPanelMouseState &state, const AudacityProject *pProject) (const TrackPanelMouseState &state, const AudacityProject *pProject)
-> HitTestPreview -> HitTestPreview
{ {
(void)state;// Compiler food
const auto &scrubber = pProject->GetScrubber(); const auto &scrubber = pProject->GetScrubber();
auto message = ScrubbingMessage(scrubber, mClicked == Button::Left); auto message = ScrubbingMessage(scrubber, mClicked == Button::Left);
@ -3789,6 +3803,8 @@ void AdornedRulerPanel::ProcessUIHandleResult
(TrackPanelCell *pClickedTrack, TrackPanelCell *pLatestCell, (TrackPanelCell *pClickedTrack, TrackPanelCell *pLatestCell,
unsigned refreshResult) unsigned refreshResult)
{ {
(void)pLatestCell;// Compiler food
(void)pClickedTrack;// Compiler food
if (refreshResult & RefreshCode::DrawOverlays) if (refreshResult & RefreshCode::DrawOverlays)
DrawBothOverlays(); DrawBothOverlays();
} }