Permalink
Browse files

STARTREK: Silence most Visual Studio warnings

Enums are signed in at least Visual Studio, and it was generating
many warnings of the cast to byte in the Action constructor was
losing precision. Likewise, there were some cases of -1 being
passed as a parameter to Action. This resolves these warnings by
making the constructor parameters int
  • Loading branch information...
dreammaster authored and sev- committed Jun 20, 2018
1 parent dc1e44e commit 7d110de48f8aa0af09b34fa1741eaf992b1201c8
Showing with 9 additions and 5 deletions.
  1. +9 −5 engines/startrek/action.h
@@ -25,6 +25,8 @@

#include "common/serializer.h"

namespace StarTrek {

enum Acton {
ACTION_TICK = 0,

@@ -49,11 +51,11 @@ struct Action : Common::Serializable {
byte b3;

Action() {}
Action(byte _type, byte _b1, byte _b2, byte _b3)
: type(_type),
b1(_b1),
b2(_b2),
b3(_b3) {}
Action(int _type, int _b1, int _b2, int _b3)
: type((byte)_type),
b1((byte)_b1),
b2((byte)_b2),
b3((byte)_b3) {}


// ACTION_USE, ACTION_GET, ACTION_LOOK, ACTION_TALK
@@ -89,4 +91,6 @@ struct Action : Common::Serializable {
}
};

}

#endif

0 comments on commit 7d110de

Please sign in to comment.