fix some warnings

This commit is contained in:
Wolfgang Thaller 2018-12-25 22:20:00 +01:00
parent 2e2a734403
commit a726045d54
7 changed files with 10 additions and 5 deletions

View File

@ -211,6 +211,9 @@ void Section::FixRelocs(bool allowDirectCodeRefs)
case SectionKind::bss: case SectionKind::bss:
relocBase = RelocBase::bss; relocBase = RelocBase::bss;
break; break;
case SectionKind::undefined:
assert(false);
break;
} }
rela.relocBase = relocBase; rela.relocBase = relocBase;

View File

@ -1,6 +1,7 @@
#include "ReliableStream.h" #include "ReliableStream.h"
#include <iterator> #include <iterator>
#include "CRC32.h" #include "CRC32.h"
#include <cassert>
using std::begin; using std::begin;
using std::end; using std::end;
@ -460,4 +461,5 @@ size_t ReliableStream::onReceive(const uint8_t* p, size_t n)
} }
break; break;
} }
assert(false);
} }

View File

@ -45,7 +45,7 @@ class ReliableStream : public StreamWrapper
bool resetResponse = false; bool resetResponse = false;
bool flushRequested = false; bool flushRequested = false;
virtual size_t onReceive(const uint8_t* p, size_t n); virtual size_t onReceive(const uint8_t* p, size_t n) override;
public: public:
explicit ReliableStream(Stream* stream); explicit ReliableStream(Stream* stream);
void reset(int sendReset); void reset(int sendReset);

View File

@ -84,4 +84,5 @@ StreamWrapper& StreamWrapper::operator=(StreamWrapper&& other)
if(underlying_) if(underlying_)
underlying_->setListener(this); underlying_->setListener(this);
other.underlying_ = nullptr; other.underlying_ = nullptr;
return *this;
} }

View File

@ -47,6 +47,8 @@ class Field
public: public:
yy::location location; yy::location location;
virtual ~Field() = default;
virtual bool needsValue() { return true; } virtual bool needsValue() { return true; }
virtual void compile(ExprPtr expr, ResourceCompiler *compiler, bool prePass) = 0; virtual void compile(ExprPtr expr, ResourceCompiler *compiler, bool prePass) = 0;

View File

@ -166,7 +166,7 @@ RezLexer::WaveToken RezLexer::nextWave()
return tok; return tok;
} }
} }
catch(preprocess_exception e) catch(const preprocess_exception& e)
{ {
curFile = e.file_name(); curFile = e.file_name();
auto yypos = yy::position(&curFile, e.line_no(), e.column_no()); auto yypos = yy::position(&curFile, e.line_no(), e.column_no());

View File

@ -52,9 +52,6 @@
# define rwlock_unlock(lock) ((void) (lock)) # define rwlock_unlock(lock) ((void) (lock))
#endif /* USE_LOCKS */ #endif /* USE_LOCKS */
/* gettext helper macro. */
#define N_(Str) Str
/* Compiler-specific definitions. */ /* Compiler-specific definitions. */
//#define strong_alias(name, aliasname) \ //#define strong_alias(name, aliasname) \
// extern __typeof (name) aliasname __attribute__ ((alias (#name))); // extern __typeof (name) aliasname __attribute__ ((alias (#name)));