From dd1e4e8b691c45669669503033b00c972335767b Mon Sep 17 00:00:00 2001 From: cc9cii Date: Sun, 19 Apr 2015 08:58:52 +1000 Subject: [PATCH] Remove gcc/clang warnings. --- .../model/world/nestedcoladapterimp.cpp | 56 ++++++------- .../model/world/nestedcoladapterimp.hpp | 84 +++++++++---------- .../model/world/nestedcolumnadapter.hpp | 14 ++-- .../opencs/model/world/nestedidcollection.hpp | 14 ++-- apps/opencs/model/world/refidadapterimp.hpp | 16 ++-- 5 files changed, 92 insertions(+), 92 deletions(-) diff --git a/apps/opencs/model/world/nestedcoladapterimp.cpp b/apps/opencs/model/world/nestedcoladapterimp.cpp index d974a34c7..bd6a5c449 100644 --- a/apps/opencs/model/world/nestedcoladapterimp.cpp +++ b/apps/opencs/model/world/nestedcoladapterimp.cpp @@ -10,7 +10,7 @@ namespace CSMWorld { PathgridPointListAdapter::PathgridPointListAdapter () {} - void PathgridPointListAdapter::addNestedRow(Record& record, int position) const + void PathgridPointListAdapter::addRow(Record& record, int position) const { Pathgrid pathgrid = record.get(); @@ -43,7 +43,7 @@ namespace CSMWorld record.setModified (pathgrid); } - void PathgridPointListAdapter::removeNestedRow(Record& record, int rowToRemove) const + void PathgridPointListAdapter::removeRow(Record& record, int rowToRemove) const { Pathgrid pathgrid = record.get(); @@ -78,7 +78,7 @@ namespace CSMWorld record.setModified (pathgrid); } - void PathgridPointListAdapter::setNestedTable(Record& record, + void PathgridPointListAdapter::setTable(Record& record, const NestedTableWrapperBase& nestedTable) const { Pathgrid pathgrid = record.get(); @@ -100,7 +100,7 @@ namespace CSMWorld return new PathgridPointsWrap(record.get()); } - QVariant PathgridPointListAdapter::getNestedData(const Record& record, + QVariant PathgridPointListAdapter::getData(const Record& record, int subRowIndex, int subColIndex) const { ESM::Pathgrid::Point point = record.get().mPoints[subRowIndex]; @@ -114,7 +114,7 @@ namespace CSMWorld } } - void PathgridPointListAdapter::setNestedData(Record& record, + void PathgridPointListAdapter::setData(Record& record, const QVariant& value, int subRowIndex, int subColIndex) const { Pathgrid pathgrid = record.get(); @@ -133,12 +133,12 @@ namespace CSMWorld record.setModified (pathgrid); } - int PathgridPointListAdapter::getNestedColumnsCount(const Record& record) const + int PathgridPointListAdapter::getColumnsCount(const Record& record) const { return 4; } - int PathgridPointListAdapter::getNestedRowsCount(const Record& record) const + int PathgridPointListAdapter::getRowsCount(const Record& record) const { return static_cast(record.get().mPoints.size()); } @@ -146,7 +146,7 @@ namespace CSMWorld PathgridEdgeListAdapter::PathgridEdgeListAdapter () {} // ToDo: seems to be auto-sorted in the dialog table display after insertion - void PathgridEdgeListAdapter::addNestedRow(Record& record, int position) const + void PathgridEdgeListAdapter::addRow(Record& record, int position) const { Pathgrid pathgrid = record.get(); @@ -167,7 +167,7 @@ namespace CSMWorld record.setModified (pathgrid); } - void PathgridEdgeListAdapter::removeNestedRow(Record& record, int rowToRemove) const + void PathgridEdgeListAdapter::removeRow(Record& record, int rowToRemove) const { Pathgrid pathgrid = record.get(); @@ -181,7 +181,7 @@ namespace CSMWorld record.setModified (pathgrid); } - void PathgridEdgeListAdapter::setNestedTable(Record& record, + void PathgridEdgeListAdapter::setTable(Record& record, const NestedTableWrapperBase& nestedTable) const { Pathgrid pathgrid = record.get(); @@ -198,7 +198,7 @@ namespace CSMWorld return new NestedTableWrapper(record.get().mEdges); } - QVariant PathgridEdgeListAdapter::getNestedData(const Record& record, + QVariant PathgridEdgeListAdapter::getData(const Record& record, int subRowIndex, int subColIndex) const { Pathgrid pathgrid = record.get(); @@ -217,7 +217,7 @@ namespace CSMWorld } // ToDo: detect duplicates in mEdges - void PathgridEdgeListAdapter::setNestedData(Record& record, + void PathgridEdgeListAdapter::setData(Record& record, const QVariant& value, int subRowIndex, int subColIndex) const { Pathgrid pathgrid = record.get(); @@ -239,19 +239,19 @@ namespace CSMWorld record.setModified (pathgrid); } - int PathgridEdgeListAdapter::getNestedColumnsCount(const Record& record) const + int PathgridEdgeListAdapter::getColumnsCount(const Record& record) const { return 3; } - int PathgridEdgeListAdapter::getNestedRowsCount(const Record& record) const + int PathgridEdgeListAdapter::getRowsCount(const Record& record) const { return static_cast(record.get().mEdges.size()); } FactionReactionsAdapter::FactionReactionsAdapter () {} - void FactionReactionsAdapter::addNestedRow(Record& record, int position) const + void FactionReactionsAdapter::addRow(Record& record, int position) const { ESM::Faction faction = record.get(); @@ -263,7 +263,7 @@ namespace CSMWorld record.setModified (faction); } - void FactionReactionsAdapter::removeNestedRow(Record& record, int rowToRemove) const + void FactionReactionsAdapter::removeRow(Record& record, int rowToRemove) const { ESM::Faction faction = record.get(); @@ -282,7 +282,7 @@ namespace CSMWorld record.setModified (faction); } - void FactionReactionsAdapter::setNestedTable(Record& record, + void FactionReactionsAdapter::setTable(Record& record, const NestedTableWrapperBase& nestedTable) const { ESM::Faction faction = record.get(); @@ -299,7 +299,7 @@ namespace CSMWorld return new NestedTableWrapper >(record.get().mReactions); } - QVariant FactionReactionsAdapter::getNestedData(const Record& record, + QVariant FactionReactionsAdapter::getData(const Record& record, int subRowIndex, int subColIndex) const { ESM::Faction faction = record.get(); @@ -322,7 +322,7 @@ namespace CSMWorld } } - void FactionReactionsAdapter::setNestedData(Record& record, + void FactionReactionsAdapter::setData(Record& record, const QVariant& value, int subRowIndex, int subColIndex) const { ESM::Faction faction = record.get(); @@ -360,19 +360,19 @@ namespace CSMWorld record.setModified (faction); } - int FactionReactionsAdapter::getNestedColumnsCount(const Record& record) const + int FactionReactionsAdapter::getColumnsCount(const Record& record) const { return 2; } - int FactionReactionsAdapter::getNestedRowsCount(const Record& record) const + int FactionReactionsAdapter::getRowsCount(const Record& record) const { return static_cast(record.get().mReactions.size()); } RegionSoundListAdapter::RegionSoundListAdapter () {} - void RegionSoundListAdapter::addNestedRow(Record& record, int position) const + void RegionSoundListAdapter::addRow(Record& record, int position) const { ESM::Region region = record.get(); @@ -388,7 +388,7 @@ namespace CSMWorld record.setModified (region); } - void RegionSoundListAdapter::removeNestedRow(Record& record, int rowToRemove) const + void RegionSoundListAdapter::removeRow(Record& record, int rowToRemove) const { ESM::Region region = record.get(); @@ -402,7 +402,7 @@ namespace CSMWorld record.setModified (region); } - void RegionSoundListAdapter::setNestedTable(Record& record, + void RegionSoundListAdapter::setTable(Record& record, const NestedTableWrapperBase& nestedTable) const { ESM::Region region = record.get(); @@ -419,7 +419,7 @@ namespace CSMWorld return new NestedTableWrapper >(record.get().mSoundList); } - QVariant RegionSoundListAdapter::getNestedData(const Record& record, + QVariant RegionSoundListAdapter::getData(const Record& record, int subRowIndex, int subColIndex) const { ESM::Region region = record.get(); @@ -438,7 +438,7 @@ namespace CSMWorld } } - void RegionSoundListAdapter::setNestedData(Record& record, + void RegionSoundListAdapter::setData(Record& record, const QVariant& value, int subRowIndex, int subColIndex) const { ESM::Region region = record.get(); @@ -461,12 +461,12 @@ namespace CSMWorld record.setModified (region); } - int RegionSoundListAdapter::getNestedColumnsCount(const Record& record) const + int RegionSoundListAdapter::getColumnsCount(const Record& record) const { return 2; } - int RegionSoundListAdapter::getNestedRowsCount(const Record& record) const + int RegionSoundListAdapter::getRowsCount(const Record& record) const { return static_cast(record.get().mSoundList.size()); } diff --git a/apps/opencs/model/world/nestedcoladapterimp.hpp b/apps/opencs/model/world/nestedcoladapterimp.hpp index 841c3955a..8d0b0ce7a 100644 --- a/apps/opencs/model/world/nestedcoladapterimp.hpp +++ b/apps/opencs/model/world/nestedcoladapterimp.hpp @@ -42,24 +42,24 @@ namespace CSMWorld public: PathgridPointListAdapter (); - virtual void addNestedRow(Record& record, int position) const; + virtual void addRow(Record& record, int position) const; - virtual void removeNestedRow(Record& record, int rowToRemove) const; + virtual void removeRow(Record& record, int rowToRemove) const; - virtual void setNestedTable(Record& record, + virtual void setTable(Record& record, const NestedTableWrapperBase& nestedTable) const; virtual NestedTableWrapperBase* nestedTable(const Record& record) const; - virtual QVariant getNestedData(const Record& record, + virtual QVariant getData(const Record& record, int subRowIndex, int subColIndex) const; - virtual void setNestedData(Record& record, + virtual void setData(Record& record, const QVariant& value, int subRowIndex, int subColIndex) const; - virtual int getNestedColumnsCount(const Record& record) const; + virtual int getColumnsCount(const Record& record) const; - virtual int getNestedRowsCount(const Record& record) const; + virtual int getRowsCount(const Record& record) const; }; class PathgridEdgeListAdapter : public NestedColumnAdapter @@ -67,24 +67,24 @@ namespace CSMWorld public: PathgridEdgeListAdapter (); - virtual void addNestedRow(Record& record, int position) const; + virtual void addRow(Record& record, int position) const; - virtual void removeNestedRow(Record& record, int rowToRemove) const; + virtual void removeRow(Record& record, int rowToRemove) const; - virtual void setNestedTable(Record& record, + virtual void setTable(Record& record, const NestedTableWrapperBase& nestedTable) const; virtual NestedTableWrapperBase* nestedTable(const Record& record) const; - virtual QVariant getNestedData(const Record& record, + virtual QVariant getData(const Record& record, int subRowIndex, int subColIndex) const; - virtual void setNestedData(Record& record, + virtual void setData(Record& record, const QVariant& value, int subRowIndex, int subColIndex) const; - virtual int getNestedColumnsCount(const Record& record) const; + virtual int getColumnsCount(const Record& record) const; - virtual int getNestedRowsCount(const Record& record) const; + virtual int getRowsCount(const Record& record) const; }; class FactionReactionsAdapter : public NestedColumnAdapter @@ -92,24 +92,24 @@ namespace CSMWorld public: FactionReactionsAdapter (); - virtual void addNestedRow(Record& record, int position) const; + virtual void addRow(Record& record, int position) const; - virtual void removeNestedRow(Record& record, int rowToRemove) const; + virtual void removeRow(Record& record, int rowToRemove) const; - virtual void setNestedTable(Record& record, + virtual void setTable(Record& record, const NestedTableWrapperBase& nestedTable) const; virtual NestedTableWrapperBase* nestedTable(const Record& record) const; - virtual QVariant getNestedData(const Record& record, + virtual QVariant getData(const Record& record, int subRowIndex, int subColIndex) const; - virtual void setNestedData(Record& record, + virtual void setData(Record& record, const QVariant& value, int subRowIndex, int subColIndex) const; - virtual int getNestedColumnsCount(const Record& record) const; + virtual int getColumnsCount(const Record& record) const; - virtual int getNestedRowsCount(const Record& record) const; + virtual int getRowsCount(const Record& record) const; }; class RegionSoundListAdapter : public NestedColumnAdapter @@ -117,24 +117,24 @@ namespace CSMWorld public: RegionSoundListAdapter (); - virtual void addNestedRow(Record& record, int position) const; + virtual void addRow(Record& record, int position) const; - virtual void removeNestedRow(Record& record, int rowToRemove) const; + virtual void removeRow(Record& record, int rowToRemove) const; - virtual void setNestedTable(Record& record, + virtual void setTable(Record& record, const NestedTableWrapperBase& nestedTable) const; virtual NestedTableWrapperBase* nestedTable(const Record& record) const; - virtual QVariant getNestedData(const Record& record, + virtual QVariant getData(const Record& record, int subRowIndex, int subColIndex) const; - virtual void setNestedData(Record& record, + virtual void setData(Record& record, const QVariant& value, int subRowIndex, int subColIndex) const; - virtual int getNestedColumnsCount(const Record& record) const; + virtual int getColumnsCount(const Record& record) const; - virtual int getNestedRowsCount(const Record& record) const; + virtual int getRowsCount(const Record& record) const; }; template @@ -143,7 +143,7 @@ namespace CSMWorld public: SpellListAdapter () {} - virtual void addNestedRow(Record& record, int position) const + virtual void addRow(Record& record, int position) const { ESXRecordT raceOrBthSgn = record.get(); @@ -157,7 +157,7 @@ namespace CSMWorld record.setModified (raceOrBthSgn); } - virtual void removeNestedRow(Record& record, int rowToRemove) const + virtual void removeRow(Record& record, int rowToRemove) const { ESXRecordT raceOrBthSgn = record.get(); @@ -171,7 +171,7 @@ namespace CSMWorld record.setModified (raceOrBthSgn); } - virtual void setNestedTable(Record& record, const NestedTableWrapperBase& nestedTable) const + virtual void setTable(Record& record, const NestedTableWrapperBase& nestedTable) const { ESXRecordT raceOrBthSgn = record.get(); @@ -187,7 +187,7 @@ namespace CSMWorld return new NestedTableWrapper >(record.get().mPowers.mList); } - virtual QVariant getNestedData(const Record& record, int subRowIndex, int subColIndex) const + virtual QVariant getData(const Record& record, int subRowIndex, int subColIndex) const { ESXRecordT raceOrBthSgn = record.get(); @@ -204,7 +204,7 @@ namespace CSMWorld } } - virtual void setNestedData(Record& record, const QVariant& value, + virtual void setData(Record& record, const QVariant& value, int subRowIndex, int subColIndex) const { ESXRecordT raceOrBthSgn = record.get(); @@ -226,12 +226,12 @@ namespace CSMWorld record.setModified (raceOrBthSgn); } - virtual int getNestedColumnsCount(const Record& record) const + virtual int getColumnsCount(const Record& record) const { return 1; } - virtual int getNestedRowsCount(const Record& record) const + virtual int getRowsCount(const Record& record) const { return static_cast(record.get().mPowers.mList.size()); } @@ -243,7 +243,7 @@ namespace CSMWorld public: EffectsListAdapter () {} - virtual void addNestedRow(Record& record, int position) const + virtual void addRow(Record& record, int position) const { ESXRecordT magic = record.get(); @@ -265,7 +265,7 @@ namespace CSMWorld record.setModified (magic); } - virtual void removeNestedRow(Record& record, int rowToRemove) const + virtual void removeRow(Record& record, int rowToRemove) const { ESXRecordT magic = record.get(); @@ -279,7 +279,7 @@ namespace CSMWorld record.setModified (magic); } - virtual void setNestedTable(Record& record, const NestedTableWrapperBase& nestedTable) const + virtual void setTable(Record& record, const NestedTableWrapperBase& nestedTable) const { ESXRecordT magic = record.get(); @@ -295,7 +295,7 @@ namespace CSMWorld return new NestedTableWrapper >(record.get().mEffects.mList); } - virtual QVariant getNestedData(const Record& record, int subRowIndex, int subColIndex) const + virtual QVariant getData(const Record& record, int subRowIndex, int subColIndex) const { ESXRecordT magic = record.get(); @@ -331,7 +331,7 @@ namespace CSMWorld } } - virtual void setNestedData(Record& record, const QVariant& value, + virtual void setData(Record& record, const QVariant& value, int subRowIndex, int subColIndex) const { ESXRecordT magic = record.get(); @@ -376,12 +376,12 @@ namespace CSMWorld record.setModified (magic); } - virtual int getNestedColumnsCount(const Record& record) const + virtual int getColumnsCount(const Record& record) const { return 8; } - virtual int getNestedRowsCount(const Record& record) const + virtual int getRowsCount(const Record& record) const { return static_cast(record.get().mEffects.mList.size()); } diff --git a/apps/opencs/model/world/nestedcolumnadapter.hpp b/apps/opencs/model/world/nestedcolumnadapter.hpp index e7e66ed4d..5e7256fa7 100644 --- a/apps/opencs/model/world/nestedcolumnadapter.hpp +++ b/apps/opencs/model/world/nestedcolumnadapter.hpp @@ -19,21 +19,21 @@ namespace CSMWorld virtual ~NestedColumnAdapter() {} - virtual void addNestedRow(Record& record, int position) const = 0; + virtual void addRow(Record& record, int position) const = 0; - virtual void removeNestedRow(Record& record, int rowToRemove) const = 0; + virtual void removeRow(Record& record, int rowToRemove) const = 0; - virtual void setNestedTable(Record& record, const NestedTableWrapperBase& nestedTable) const = 0; + virtual void setTable(Record& record, const NestedTableWrapperBase& nestedTable) const = 0; virtual NestedTableWrapperBase* nestedTable(const Record& record) const = 0; - virtual QVariant getNestedData(const Record& record, int subRowIndex, int subColIndex) const = 0; + virtual QVariant getData(const Record& record, int subRowIndex, int subColIndex) const = 0; - virtual void setNestedData(Record& record, const QVariant& value, int subRowIndex, int subColIndex) const = 0; + virtual void setData(Record& record, const QVariant& value, int subRowIndex, int subColIndex) const = 0; - virtual int getNestedColumnsCount(const Record& record) const = 0; + virtual int getColumnsCount(const Record& record) const = 0; - virtual int getNestedRowsCount(const Record& record) const = 0; + virtual int getRowsCount(const Record& record) const = 0; }; } diff --git a/apps/opencs/model/world/nestedidcollection.hpp b/apps/opencs/model/world/nestedidcollection.hpp index 0cf51b9d8..2b795f9c6 100644 --- a/apps/opencs/model/world/nestedidcollection.hpp +++ b/apps/opencs/model/world/nestedidcollection.hpp @@ -93,7 +93,7 @@ namespace CSMWorld Record record; record.assign(Collection::getRecord(row)); - getAdapter(Collection::getColumn(column)).addNestedRow(record, position); + getAdapter(Collection::getColumn(column)).addRow(record, position); Collection::setRecord(row, record); } @@ -104,7 +104,7 @@ namespace CSMWorld Record record; record.assign(Collection::getRecord(row)); - getAdapter(Collection::getColumn(column)).removeNestedRow(record, subRow); + getAdapter(Collection::getColumn(column)).removeRow(record, subRow); Collection::setRecord(row, record); } @@ -113,7 +113,7 @@ namespace CSMWorld QVariant NestedIdCollection::getNestedData (int row, int column, int subRow, int subColumn) const { - return getAdapter(Collection::getColumn(column)).getNestedData( + return getAdapter(Collection::getColumn(column)).getData( Collection::getRecord(row), subRow, subColumn); } @@ -124,7 +124,7 @@ namespace CSMWorld Record record; record.assign(Collection::getRecord(row)); - getAdapter(Collection::getColumn(column)).setNestedData( + getAdapter(Collection::getColumn(column)).setData( record, data, subRow, subColumn); Collection::setRecord(row, record); @@ -145,7 +145,7 @@ namespace CSMWorld Record record; record.assign(Collection::getRecord(row)); - getAdapter(Collection::getColumn(column)).setNestedTable( + getAdapter(Collection::getColumn(column)).setTable( record, nestedTable); Collection::setRecord(row, record); @@ -154,14 +154,14 @@ namespace CSMWorld template int NestedIdCollection::getNestedRowsCount(int row, int column) const { - return getAdapter(Collection::getColumn(column)).getNestedRowsCount( + return getAdapter(Collection::getColumn(column)).getRowsCount( Collection::getRecord(row)); } template int NestedIdCollection::getNestedColumnsCount(int row, int column) const { - return getAdapter(Collection::getColumn(column)).getNestedColumnsCount( + return getAdapter(Collection::getColumn(column)).getColumnsCount( Collection::getRecord(row)); } diff --git a/apps/opencs/model/world/refidadapterimp.hpp b/apps/opencs/model/world/refidadapterimp.hpp index 5fd888441..9556c83e3 100644 --- a/apps/opencs/model/world/refidadapterimp.hpp +++ b/apps/opencs/model/world/refidadapterimp.hpp @@ -867,7 +867,7 @@ namespace CSMWorld { Record& record = static_cast&> (data.getRecord (RefIdData::LocalIndex (index, mType))); - EffectsListAdapter::addNestedRow(record, position); + EffectsListAdapter::addRow(record, position); } using NestedRefIdAdapterBase::removeNestedRow; @@ -876,7 +876,7 @@ namespace CSMWorld { Record& record = static_cast&> (data.getRecord (RefIdData::LocalIndex (index, mType))); - EffectsListAdapter::removeNestedRow(record, rowToRemove); + EffectsListAdapter::removeRow(record, rowToRemove); } using NestedRefIdAdapterBase::setNestedTable; @@ -885,7 +885,7 @@ namespace CSMWorld { Record& record = static_cast&> (data.getRecord (RefIdData::LocalIndex (index, mType))); - EffectsListAdapter::setNestedTable(record, nestedTable); + EffectsListAdapter::setTable(record, nestedTable); } using NestedRefIdAdapterBase::nestedTable; @@ -903,7 +903,7 @@ namespace CSMWorld { const Record& record = static_cast&> (data.getRecord (RefIdData::LocalIndex (index, mType))); - return EffectsListAdapter::getNestedData(record, subRowIndex, subColIndex); + return EffectsListAdapter::getData(record, subRowIndex, subColIndex); } using NestedRefIdAdapterBase::setNestedData; @@ -912,14 +912,14 @@ namespace CSMWorld { Record& record = static_cast&> (data.getRecord (RefIdData::LocalIndex (row, mType))); - EffectsListAdapter::setNestedData(record, value, subRowIndex, subColIndex); + EffectsListAdapter::setData(record, value, subRowIndex, subColIndex); } using NestedRefIdAdapterBase::getNestedColumnsCount; virtual int getNestedColumnsCount(const RefIdColumn *column, const RefIdData& data) const { const Record record; // not used, just a dummy - return EffectsListAdapter::getNestedColumnsCount(record); + return EffectsListAdapter::getColumnsCount(record); } using NestedRefIdAdapterBase::getNestedRowsCount; @@ -927,7 +927,7 @@ namespace CSMWorld { const Record& record = static_cast&> (data.getRecord (RefIdData::LocalIndex (index, mType))); - return EffectsListAdapter::getNestedRowsCount(record); + return EffectsListAdapter::getRowsCount(record); } }; @@ -1731,7 +1731,7 @@ namespace CSMWorld { case 0: { - if (content.mPart >=0 && content.mPart < ESM::PRT_Count) + if (content.mPart < ESM::PRT_Count) return content.mPart; else throw std::runtime_error("Part Reference Type unexpected value");