Skip to content

Fix warnings in sio_message.h #441

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
53 changes: 26 additions & 27 deletions src/sio_message.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ namespace sio
return ptr(new bool_message(v));
}

bool get_bool() const
bool get_bool() const override
{
return _v;
}
Expand All @@ -164,14 +164,14 @@ namespace sio
return ptr(new int_message(v));
}

int64_t get_int() const
int64_t get_int() const override
{
return _v;
}

double get_double() const//add double accessor for integer.
double get_double() const override
{
return static_cast<double>(_v);
return static_cast<double>(_v);//add double accessor for integer.
}
};

Expand All @@ -189,7 +189,7 @@ namespace sio
return ptr(new double_message(v));
}

double get_double() const
double get_double() const override
{
return _v;
}
Expand Down Expand Up @@ -218,7 +218,7 @@ namespace sio
return ptr(new string_message(std::move(v)));
}

std::string const& get_string() const
std::string const& get_string() const override
{
return _v;
}
Expand All @@ -237,7 +237,7 @@ namespace sio
return ptr(new binary_message(v));
}

std::shared_ptr<const std::string> const& get_binary() const
std::shared_ptr<const std::string> const& get_binary() const override
{
return _v;
}
Expand All @@ -256,10 +256,10 @@ namespace sio
return ptr(new array_message());
}

void push(message::ptr const& message)
void push(message::ptr const& msg)
{
if(message)
_v.push_back(message);
if(msg)
_v.push_back(msg);
}

void push(const std::string& text)
Expand All @@ -284,9 +284,9 @@ namespace sio
_v.push_back(binary_message::create(binary));
}

void insert(size_t pos,message::ptr const& message)
void insert(size_t pos,message::ptr const& msg)
{
_v.insert(_v.begin()+pos, message);
_v.insert(_v.begin()+pos, msg);
}

void insert(size_t pos,const std::string& text)
Expand Down Expand Up @@ -326,12 +326,12 @@ namespace sio
return _v[i];
}

std::vector<ptr>& get_vector()
std::vector<ptr>& get_vector() override
{
return _v;
}

const std::vector<ptr>& get_vector() const
const std::vector<ptr>& get_vector() const override
{
return _v;
}
Expand All @@ -349,9 +349,9 @@ namespace sio
return ptr(new object_message());
}

void insert(const std::string & key,message::ptr const& message)
void insert(const std::string & key,message::ptr const& msg)
{
_v[key] = message;
_v[key] = msg;
}

void insert(const std::string & key,const std::string& text)
Expand Down Expand Up @@ -400,12 +400,12 @@ namespace sio
return _v.find(key) != _v.end();
}

std::map<std::string,message::ptr>& get_map()
std::map<std::string,message::ptr>& get_map() override
{
return _v;
}

const std::map<std::string,message::ptr>& get_map() const
const std::map<std::string,message::ptr>& get_map() const override
{
return _v;
}
Expand Down Expand Up @@ -447,11 +447,10 @@ namespace sio

}

list(message::ptr const& message)
list(message::ptr const& msg)
{
if(message)
m_vector.push_back(message);

if(msg)
m_vector.push_back(msg);
}

list(const std::string& text)
Expand All @@ -476,10 +475,10 @@ namespace sio
m_vector.push_back(binary_message::create(binary));
}

void push(message::ptr const& message)
void push(message::ptr const& msg)
{
if(message)
m_vector.push_back(message);
if(msg)
m_vector.push_back(msg);
}

void push(const std::string& text)
Expand All @@ -504,9 +503,9 @@ namespace sio
m_vector.push_back(binary_message::create(binary));
}

void insert(size_t pos,message::ptr const& message)
void insert(size_t pos,message::ptr const& msg)
{
m_vector.insert(m_vector.begin()+pos, message);
m_vector.insert(m_vector.begin()+pos, msg);
}

void insert(size_t pos,const std::string& text)
Expand Down