Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some compile warnings. #271

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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