Skip to content

Commit

Permalink
debug build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
HertzDevil committed May 16, 2018
1 parent d7853f2 commit e643e8c
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 19 deletions.
10 changes: 1 addition & 9 deletions Source/FamiTrackerDocIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,6 @@ bool CFamiTrackerDocIO::Load(CFamiTrackerModule &modfile) {
{FILE_BLOCK_BOOKMARKS, &CFamiTrackerDocIO::LoadBookmarks}, // // //
};

#ifdef _DEBUG
int msgs_ = 0;
#endif

// This has to be done for older files
if (file_.GetFileVersion() < 0x0210)
(void)modfile.GetSong(0);
Expand All @@ -156,11 +152,7 @@ bool CFamiTrackerDocIO::Load(CFamiTrackerModule &modfile) {
(this->*FTM_READ_FUNC.at(BlockID))(modfile, file_.GetBlockVersion()); // // //
}
catch (std::out_of_range) {
#ifdef _DEBUG
// This shouldn't show up in release (debug only)
// if (++msgs_ < 5)
// AfxMessageBox(L"Unknown file block!");
#endif
DEBUG_BREAK();
if (file_.IsFileIncomplete())
ErrorFlag = true;
}
Expand Down
2 changes: 1 addition & 1 deletion Source/FamiTrackerView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@ void CFamiTrackerView::OnInitialUpdate()

CFrameEditor *pFrameEditor = GetFrameEditor();

TRACE(L"View: OnInitialUpdate (%s)\n", pDoc->GetTitle());
TRACE(L"View: OnInitialUpdate (%s)\n", (LPCWSTR)pDoc->GetTitle());

// Setup order window
pFrameEditor->AssignView(*this); // // //
Expand Down
2 changes: 1 addition & 1 deletion Source/InstrumentEditDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ void CInstrumentEditDlg::SwitchOnNote(int x, int y)
if (m_KeyboardRect.PtInRect({x, y})) {
int KeyPos = (x - m_KeyboardRect.left) % 70; // // //
int Octave = (x - m_KeyboardRect.left) / 70;
note_t Note; // // //
note_t Note = note_t::C; // // //

if (y > m_KeyboardRect.top + 38) {
// Only white keys
Expand Down
2 changes: 1 addition & 1 deletion Source/PCMImport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ bool CPCMImport::OpenWaveFile()
m_iWaveSize = 0;
m_ullSampleStart = 0;

TRACE(L"DPCM import: Loading wave file %s...\n", m_strPath);
TRACE(L"DPCM import: Loading wave file %s...\n", (LPCWSTR)m_strPath);

if (!m_fSampleFile.Open(m_strPath, CFile::modeRead, &ex)) {
WCHAR szCause[255] = { };
Expand Down
7 changes: 3 additions & 4 deletions Source/PatternEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1156,9 +1156,9 @@ void CPatternEditor::DrawRow(CDC &DC, int Row, int Line, int Frame, bool bPrevie
RowColorInfo_t colorInfo;
colorInfo.Note = TextColor;
switch (Highlight) {
case highlight_state_t::none: colorInfo.Back = pSettings->Appearance.iColBackground; break;
case highlight_state_t::beat: colorInfo.Back = pSettings->Appearance.iColBackgroundHilite; break;
case highlight_state_t::measure: colorInfo.Back = pSettings->Appearance.iColBackgroundHilite2; break;
case highlight_state_t::beat: colorInfo.Back = pSettings->Appearance.iColBackgroundHilite; break;
case highlight_state_t::measure: colorInfo.Back = pSettings->Appearance.iColBackgroundHilite2; break;
case highlight_state_t::none: default: colorInfo.Back = pSettings->Appearance.iColBackground; break;
}

colorInfo.Shaded = BLEND(TextColor, colorInfo.Back, SHADE_LEVEL::UNUSED);
Expand Down Expand Up @@ -1830,7 +1830,6 @@ cursor_column_t CPatternEditor::GetChannelColumns(int Channel) const
case 4: return cursor_column_t::EFF4_PARAM2;
default: return cursor_column_t::VOLUME; // // //
}
return cursor_column_t::NOTE;
}

int CPatternEditor::GetChannelCount() const
Expand Down
2 changes: 1 addition & 1 deletion Source/RegisterDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void CRegisterDisplay::Draw() {
GetRegs(sound_chip_t::APU, [&] (int x) { return 0x4000 + i * 4 + x; }, 4);
DrawReg(FormattedA("$%04X:", 0x4000 + i * 4), 4);

int period, vol;
int period = 0, vol = 0;
double freq = pSoundGen->GetChannelFrequency(sound_chip_t::APU, i); // // //
// dc.FillSolidRect(x + 200, y, x + 400, y + 18, m_colEmptyBg);

Expand Down
8 changes: 6 additions & 2 deletions libft0cc/include/ft0cc/enum_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,10 @@ template <typename EnumT REQUIRES_IsEnum(EnumT),
constexpr EnumT enum_min() noexcept {
if constexpr (details::enum_has_min_member<EnumT>::value)
return EnumT::min;
if constexpr (!details::is_enum_category_discrete<get_enum_category_t<EnumT>>::value)
else if constexpr (!details::is_enum_category_discrete<get_enum_category_t<EnumT>>::value)
return EnumT {std::numeric_limits<std::underlying_type_t<EnumT>>::min()};
else
static_assert(!sizeof(EnumT), "Minimum element of enum does not exist");
}

// Checks whether the given enumeration type has a maximum element.
Expand All @@ -226,8 +228,10 @@ template <typename EnumT REQUIRES_IsEnum(EnumT),
constexpr EnumT enum_max() noexcept {
if constexpr (details::enum_has_max_member<EnumT>::value)
return EnumT::max;
if constexpr (!details::is_enum_category_discrete<get_enum_category_t<EnumT>>::value)
else if constexpr (!details::is_enum_category_discrete<get_enum_category_t<EnumT>>::value)
return EnumT {std::numeric_limits<std::underlying_type_t<EnumT>>::max()};
else
static_assert(!sizeof(EnumT), "Maximum element of enum does not exist");
}


Expand Down

0 comments on commit e643e8c

Please sign in to comment.