Skip to content

Commit

Permalink
Fix some compile warnings.
Browse files Browse the repository at this point in the history
richardapowell authored and Richard Powell committed Jun 5, 2018
1 parent 647008a commit c40bc0c
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
@@ -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() {}

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

namespace sc2 {

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

Connection::Connection() :
verbose_(false),
connection_(nullptr),
verbose_(false),
queue_(),
mutex_(),
condition_(),
6 changes: 2 additions & 4 deletions src/sc2api/sc2_data.cc
Original file line number Diff line number Diff line change
@@ -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;
@@ -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;
4 changes: 2 additions & 2 deletions src/sc2api/sc2_server.cc
Original file line number Diff line number Diff line change
@@ -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,
@@ -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;
}

0 comments on commit c40bc0c

Please sign in to comment.