1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-20 17:41:13 +02:00

fixed some warnings in debug mode (GCC/Linux)

This commit is contained in:
andheh
2018-03-21 22:44:55 +01:00
committed by James Crook
parent 1cda717a14
commit b56059a77c
3 changed files with 4 additions and 3 deletions

View File

@@ -45,6 +45,7 @@
#include <algorithm> #include <algorithm>
#include <wx/string.h> #include <wx/string.h>
#include <wx/arrstr.h> #include <wx/arrstr.h>
#include <type_traits>
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// TODO: I'd imagine this header may be replaced by other public headers. But, // TODO: I'd imagine this header may be replaced by other public headers. But,
@@ -90,7 +91,7 @@ public:
size_t as_size_t() const { size_t as_size_t() const {
wxASSERT(value >= 0); wxASSERT(value >= 0);
wxASSERT(value <= std::numeric_limits<size_t>::max()); wxASSERT(static_cast<std::make_unsigned<type>::type>(value) <= std::numeric_limits<size_t>::max());
return value; return value;
} }

View File

@@ -704,7 +704,7 @@ bool MacroCommands::ApplyEffectCommand(
const wxString & command, const wxString & params, const wxString & command, const wxString & params,
const CommandContext & Context) const CommandContext & Context)
{ {
(void*)&command;//compiler food. static_cast<void>(command);//compiler food.
//Possibly end processing here, if in batch-debug //Possibly end processing here, if in batch-debug
if( ReportAndSkip(friendlyCommand, params)) if( ReportAndSkip(friendlyCommand, params))

View File

@@ -90,7 +90,7 @@ void ReverseSamples(samplePtr dst, sampleFormat format,
samplePtr first = dst + start * size; samplePtr first = dst + start * size;
samplePtr last = dst + (start + len - 1) * size; samplePtr last = dst + (start + len - 1) * size;
enum : size_t { fixedSize = SAMPLE_SIZE(floatSample) }; enum : size_t { fixedSize = SAMPLE_SIZE(floatSample) };
wxASSERT(size <= fixedSize); wxASSERT(static_cast<size_t>(size) <= fixedSize);
char temp[fixedSize]; char temp[fixedSize];
while (first < last) { while (first < last) {
memcpy(temp, first, size); memcpy(temp, first, size);