Skip to content

Commit

Permalink
Merge pull request #271 from richardapowell/fix_some_compile_warnings
Browse files Browse the repository at this point in the history
Fix some compile warnings.
  • Loading branch information
sheikyabooti authored Jun 7, 2018
2 parents 647008a + c40bc0c commit d9ba0a3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 2 additions & 0 deletions include/sc2api/sc2_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ enum class ClientError {
//! A set of common events a user can override in their derived bot or replay observer class.
class ClientEvents {
public:
virtual ~ClientEvents() {}

//! Called when a game is started after a load. Fast restarting will not call this.
virtual void OnGameFullStart() {}

Expand Down
1 change: 1 addition & 0 deletions include/sc2utils/sc2_simple_serialization.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <fstream>
#include <iostream>
#include <set>
#include <typeinfo>

namespace sc2 {

Expand Down
2 changes: 1 addition & 1 deletion src/sc2api/sc2_connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ static void ConnectionClosedHandler(const struct mg_connection* conn, void *) {
}

Connection::Connection() :
verbose_(false),
connection_(nullptr),
verbose_(false),
queue_(),
mutex_(),
condition_(),
Expand Down
6 changes: 2 additions & 4 deletions src/sc2api/sc2_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ void AbilityData::ReadFromProto(const SC2APIProtocol::AbilityData& ability_data)
target = Target::PointOrNone;
break;
}
case SC2APIProtocol::AbilityData_Target_None: {
}
case SC2APIProtocol::AbilityData_Target_None:
default: {
target = Target::None;
break;
Expand Down Expand Up @@ -159,8 +158,7 @@ std::string AbilityData::Log() const {
str_out += " Target: Point or unit\n";
break;
}
case Target::None: {
}
case Target::None:
default: {
str_out += " Target: None\n";
break;
Expand Down
4 changes: 2 additions & 2 deletions src/sc2api/sc2_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ static void SendMessage(mg_connection* conn, std::queue<T>& message_queue) {

google::protobuf::Message* message = message_queue.front().second;
size_t size = message->ByteSize();
void* bytes = new char[size];
char* bytes = new char[size];
message->SerializeToArray(bytes, (int)size);
mg_websocket_write(
conn,
Expand All @@ -95,7 +95,7 @@ static void SendMessage(mg_connection* conn, std::queue<T>& message_queue) {
size
);
message_queue.pop();
delete bytes;
delete [] bytes;
delete message;
}

Expand Down

0 comments on commit d9ba0a3

Please sign in to comment.