1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-07 03:12:36 +01:00

Fix compiler warnings

This commit is contained in:
Daniel Evans 2014-06-10 17:51:55 +01:00
parent 34478b6651
commit 04de3c1a8f
7 changed files with 8 additions and 9 deletions

View File

@ -45,6 +45,8 @@ public:
CharacterController(CharacterObject* character); CharacterController(CharacterObject* character);
virtual ~CharacterController() { }
Activity* getCurrentActivity() { return _currentActivity; } Activity* getCurrentActivity() { return _currentActivity; }
Activity* getNextActivity() { return _nextActivity; } Activity* getNextActivity() { return _nextActivity; }

View File

@ -41,7 +41,7 @@ void AIGraph::createPathNodes(const glm::vec3& position, const glm::quat& rotati
} }
for(size_t pn = 0; pn < path.nodes.size(); ++pn) { for(size_t pn = 0; pn < path.nodes.size(); ++pn) {
if(path.nodes[pn].next > -1 && path.nodes[pn].next < realNodes.size()) { if(path.nodes[pn].next >= 0 && (unsigned) path.nodes[pn].next < realNodes.size()) {
auto node = nodes[realNodes[pn]]; auto node = nodes[realNodes[pn]];
node->connections.push_back(nodes[realNodes[path.nodes[pn].next]]); node->connections.push_back(nodes[realNodes[path.nodes[pn].next]]);
nodes[realNodes[path.nodes[pn].next]]->connections.push_back(node); nodes[realNodes[path.nodes[pn].next]]->connections.push_back(node);

View File

@ -75,7 +75,7 @@ public:
i < entries.size(); i < entries.size();
++i) ++i)
{ {
if(activeEntry >= 0 && i == activeEntry) { if(activeEntry >= 0 && i == (unsigned) activeEntry) {
sf::RectangleShape rs(sf::Vector2f(250.f, entries[i]->getHeight())); sf::RectangleShape rs(sf::Vector2f(250.f, entries[i]->getHeight()));
rs.setPosition(basis.x, basis.y); rs.setPosition(basis.x, basis.y);
rs.setFillColor(sf::Color::Cyan); rs.setFillColor(sf::Color::Cyan);
@ -122,7 +122,7 @@ public:
// Activates the menu entry at the current active index. // Activates the menu entry at the current active index.
void activate() void activate()
{ {
if(activeEntry < entries.size()) { if(activeEntry >= 0 && (unsigned) activeEntry < entries.size()) {
entries[activeEntry]->activate(0.f, 0.f); entries[activeEntry]->activate(0.f, 0.f);
} }
} }

View File

@ -3,7 +3,7 @@
QVariant AnimationListModel::data(const QModelIndex& index, int role) const QVariant AnimationListModel::data(const QModelIndex& index, int role) const
{ {
if(role == Qt::DisplayRole) { if(role == Qt::DisplayRole) {
if(index.row() < animations.size()) { if(index.row() >= 0 && (unsigned) index.row() < animations.size()) {
auto& f = animations.at(index.row()); auto& f = animations.at(index.row());
if(index.column() == 0) { if(index.column() == 0) {
return QString(f.first.c_str()); return QString(f.first.c_str());

View File

@ -36,7 +36,7 @@ void AnimationListWidget::setAnimations(const AnimationList& archive)
void AnimationListWidget::selectedIndexChanged(const QModelIndex& current) void AnimationListWidget::selectedIndexChanged(const QModelIndex& current)
{ {
auto mts = filter->mapToSource(current); auto mts = filter->mapToSource(current);
if(mts.row() < model->getAnimations().size()) { if(mts.row() >= 0 && (unsigned) mts.row() < model->getAnimations().size()) {
auto& f = model->getAnimations().at(mts.row()); auto& f = model->getAnimations().at(mts.row());
emit selectedAnimationChanged(f.second); emit selectedAnimationChanged(f.second);
} }

View File

@ -3,7 +3,7 @@
QVariant IMGArchiveModel::data(const QModelIndex& index, int role) const QVariant IMGArchiveModel::data(const QModelIndex& index, int role) const
{ {
if(role == Qt::DisplayRole) { if(role == Qt::DisplayRole) {
if(index.row() < archive.getAssetCount()) { if(index.row() >= 0 && (unsigned) index.row() < archive.getAssetCount()) {
auto& f = archive.getAssetInfoByIndex(index.row()); auto& f = archive.getAssetInfoByIndex(index.row());
if(index.column() == 0) { if(index.column() == 0) {
return QString(f.name); return QString(f.name);

View File

@ -6,9 +6,6 @@ int main(int argc, char *argv[])
{ {
QApplication app(argc, argv); QApplication app(argc, argv);
/* HACK until Qt curve supports Qt5 */
QApplication::setStyle(QStyleFactory::create("GTK+"));
ViewerWindow viewer; ViewerWindow viewer;
viewer.show(); viewer.show();