[nostalgia] Enable and fix -Wextra warnings

This commit is contained in:
Gary Talent 2019-03-30 17:30:56 -05:00
parent 5afe78d015
commit 23b662c2aa
9 changed files with 22 additions and 24 deletions

View File

@ -29,7 +29,7 @@ endif()
if(NOT MSVC) if(NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wcast-align") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wcast-align")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wdouble-promotion") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wdouble-promotion")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat=2") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat=2")

View File

@ -10,22 +10,22 @@
namespace nostalgia::core { namespace nostalgia::core {
ox::Error initGfx(Context *ctx) { ox::Error initGfx(Context*) {
return 1; return 1;
} }
ox::Error initConsole(Context *ctx) { ox::Error initConsole(Context*) {
return 1; return 1;
} }
ox::Error loadTileSheet(Context *ctx, InodeId_t inode) { ox::Error loadTileSheet(Context*, InodeId_t) {
return 1; return 1;
} }
void puts(Context *ctx, int loc, const char *str) { void puts(Context*, int, const char*) {
} }
void setTile(Context *ctx, int layer, int column, int row, uint8_t tile) { void setTile(Context*, int, int, int, uint8_t) {
} }
} }

View File

@ -51,7 +51,7 @@ Error model(T *io, TestStruct *obj) {
return err; return err;
} }
int main(int argc, char **args) { int main() {
int err = 0; int err = 0;
QString json; QString json;
TestStruct ts = { TestStruct ts = {

View File

@ -26,7 +26,7 @@ OxFSFile::OxFSFile(PassThroughFS *fs, QString path, OxFSFile *parentItem) {
auto stat = fs->stat(static_cast<const char*>(m_path.toUtf8())); auto stat = fs->stat(static_cast<const char*>(m_path.toUtf8()));
if (!stat.error) { if (!stat.error) {
if (stat.value.fileType == FileType_Directory) { if (stat.value.fileType == FileType_Directory) {
fs->ls(m_path.toUtf8(), [&ls](const char *name, ox::InodeId_t inode) { fs->ls(m_path.toUtf8(), [&ls](const char *name, ox::InodeId_t) {
ls.push_back(name); ls.push_back(name);
return OxError(0); return OxError(0);
}); });
@ -115,7 +115,7 @@ QString OxFSFile::name() const {
// OxFSModel // OxFSModel
OxFSModel::OxFSModel(PassThroughFS *fs, QObject *parent) { OxFSModel::OxFSModel(PassThroughFS *fs, QObject*) {
m_rootItem = new OxFSFile(fs, ""); m_rootItem = new OxFSFile(fs, "");
} }
@ -213,7 +213,7 @@ void OxFSModel::updateFile(QString path) {
m_rootItem->appendChild(this, pathItems, ""); m_rootItem->appendChild(this, pathItems, "");
} }
void OxFSModel::setupModelData(const QStringList &lines, OxFSFile *parent) { void OxFSModel::setupModelData(const QStringList&, OxFSFile*) {
} }
} }

View File

@ -11,15 +11,15 @@
namespace nostalgia { namespace nostalgia {
namespace studio { namespace studio {
QVector<WizardMaker> Plugin::newWizards(const Context *ctx) { QVector<WizardMaker> Plugin::newWizards(const Context*) {
return {}; return {};
} }
QVector<WizardMaker> Plugin::importWizards(const Context *ctx) { QVector<WizardMaker> Plugin::importWizards(const Context*) {
return {}; return {};
} }
QWidget *Plugin::makeEditor(QString path, const Context *ctx) { QWidget *Plugin::makeEditor(QString, const Context*) {
return nullptr; return nullptr;
} }

View File

@ -190,7 +190,7 @@ QAction *MainWindow::addAction(QMenu *menu, QString text, QString toolTip,
return action; return action;
} }
int MainWindow::readState(QString path) { int MainWindow::readState(QString) {
int err = 0; int err = 0;
QSettings settings(m_profile.orgName, m_profile.appName); QSettings settings(m_profile.orgName, m_profile.appName);
@ -206,7 +206,7 @@ int MainWindow::readState(QString path) {
return err; return err;
} }
int MainWindow::writeState(QString path) { int MainWindow::writeState(QString) {
int err = 0; int err = 0;
// generate JSON for application specific state info // generate JSON for application specific state info

View File

@ -19,18 +19,18 @@ namespace nostalgia {
} }
// stub for now // stub for now
ox::Error pathToInode(std::vector<char> *buff) { ox::Error pathToInode(std::vector<char>*) {
return OxError(0); return OxError(0);
} }
// stub for now // stub for now
ox::Error toMetalClaw(std::vector<char> *buff) { ox::Error toMetalClaw(std::vector<char>*) {
return OxError(0); return OxError(0);
} }
ox::Error copy(ox::PassThroughFS *src, ox::FileSystem32 *dest, std::string path) { ox::Error copy(ox::PassThroughFS *src, ox::FileSystem32 *dest, std::string path) {
// copy // copy
src->ls(path.c_str(), [src, dest, path](const char *name, ox::InodeId_t inode) { src->ls(path.c_str(), [src, dest, path](const char *name, ox::InodeId_t) {
auto stat = src->stat(path.c_str()); auto stat = src->stat(path.c_str());
oxReturnError(stat.error); oxReturnError(stat.error);
if (stat.value.fileType == ox::FileType_Directory) { if (stat.value.fileType == ox::FileType_Directory) {

View File

@ -8,13 +8,11 @@
#include "worldeditor.hpp" #include "worldeditor.hpp"
namespace nostalgia { namespace nostalgia::world {
namespace world {
using namespace studio; using namespace studio;
WorldEditor::WorldEditor(QString path, const Context *ctx) { WorldEditor::WorldEditor(QString, const Context*) {
} }
} }
}

View File

@ -94,14 +94,14 @@ struct Region {
}; };
template<typename T> template<typename T>
ox::Error modelRead(T *io, Region *obj) { ox::Error modelRead(T *io, Region*) {
ox::Error err = 0; ox::Error err = 0;
io->setTypeInfo("nostalgia::World::Region", Region::Fields); io->setTypeInfo("nostalgia::World::Region", Region::Fields);
return err; return err;
} }
template<typename T> template<typename T>
ox::Error modelWrite(T *io, Region *obj) { ox::Error modelWrite(T *io, Region*) {
ox::Error err = 0; ox::Error err = 0;
io->setTypeInfo("nostalgia::World::Region", Region::Fields); io->setTypeInfo("nostalgia::World::Region", Region::Fields);
return err; return err;