Skip to content

Commit

Permalink
move semantics, clang++ warnings fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Kraynyukhov committed Jun 16, 2019
1 parent 726a075 commit 44a0d82
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions include/ServiceRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ namespace LAppS
}
retobj->push_back(j);
}
return std::move(retobj);
return retobj;
}

void clear()
Expand Down Expand Up @@ -249,7 +249,7 @@ namespace LAppS
{
retobj->push_back(std::move(*(instances.second.list())));
}
return std::move(retobj);
return retobj;
}
};
using SServiceRegistry=itc::Singleton<ServiceRegistry>;
Expand Down
22 changes: 11 additions & 11 deletions include/WSStreamClientParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,18 +206,18 @@ namespace WSStreamProcessing
reset();
case WSStreamProcessing::State::HEADER_1ST_BYTE:
{
auto result=std::move(getHeader1stByte(stream,limit,cursor));
auto result{getHeader1stByte(stream,limit,cursor)};
if(result.directive != WSStreamProcessing::CONTINUE )
{
return std::move(result);
return result;
}
}
case WSStreamProcessing::State::HEADER_2DN_BYTE:
{
auto result=std::move(getHeader2ndByte(stream,limit,cursor));
auto result{getHeader2ndByte(stream,limit,cursor)};
if(result.directive != WSStreamProcessing::Directive::CONTINUE)
{
return std::move(result);
return result;
}
}
case WSStreamProcessing::State::READ_SHORT_SIZE_0:
Expand All @@ -231,10 +231,10 @@ namespace WSStreamProcessing
case WSStreamProcessing::State::READ_LONG_SIZE_6:
case WSStreamProcessing::State::READ_LONG_SIZE_7:
{
auto result=std::move(readSIZE(stream,limit,cursor));
auto result{readSIZE(stream,limit,cursor)};
if(result.directive != WSStreamProcessing::Directive::CONTINUE)
{
return std::move(result);
return result;
}
}
case WSStreamProcessing::State::READ_MASK_0:
Expand All @@ -244,22 +244,22 @@ namespace WSStreamProcessing
mState=WSStreamProcessing::State::VALIDATE;
case WSStreamProcessing::State::VALIDATE:
{
auto result=std::move(validateHeader());
auto result{validateHeader()};
if(result.directive != WSStreamProcessing::Directive::CONTINUE)
{
return std::move(result);
return result;
}
}
case WSStreamProcessing::State::PAYLOAD:
{
auto result=std::move(processPayload(stream,limit,cursor));
auto result{processPayload(stream,limit,cursor)};
if(result.directive != WSStreamProcessing::Directive::CONTINUE)
{
return std::move(result);
return result;
}
}
case WSStreamProcessing::State::DONE:
return std::move(decideOnDone(stream,limit,cursor));
return decideOnDone(stream,limit,cursor);
default:
throw std::logic_error("WSStreamParser::parse() - switch case is out of options. Never should have happened. Blame the programmer");
}
Expand Down
26 changes: 13 additions & 13 deletions include/WSStreamServerParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -337,18 +337,18 @@ namespace WSStreamProcessing
reset();
case WSStreamProcessing::State::HEADER_1ST_BYTE:
{
auto result=std::move(getHeader1stByte(stream,limit,cursor));
auto result{getHeader1stByte(stream,limit,cursor)};
if(result.directive != WSStreamProcessing::CONTINUE )
{
return std::move(result);
return result;
}
}
case WSStreamProcessing::State::HEADER_2DN_BYTE:
{
auto result=std::move(getHeader2ndByte(stream,limit,cursor));
auto result{getHeader2ndByte(stream,limit,cursor)};
if(result.directive != WSStreamProcessing::Directive::CONTINUE)
{
return std::move(result);
return result;
}
}
case WSStreamProcessing::State::READ_SHORT_SIZE_0:
Expand All @@ -362,41 +362,41 @@ namespace WSStreamProcessing
case WSStreamProcessing::State::READ_LONG_SIZE_6:
case WSStreamProcessing::State::READ_LONG_SIZE_7:
{
auto result=std::move(readSIZE(stream,limit,cursor));
auto result{readSIZE(stream,limit,cursor)};
if(result.directive != WSStreamProcessing::Directive::CONTINUE)
{
return std::move(result);
return result;
}
}
case WSStreamProcessing::State::READ_MASK_0:
case WSStreamProcessing::State::READ_MASK_1:
case WSStreamProcessing::State::READ_MASK_2:
case WSStreamProcessing::State::READ_MASK_3:
{
auto result=std::move(readMASK(stream,limit,cursor));
auto result{readMASK(stream,limit,cursor)};
if(result.directive != WSStreamProcessing::Directive::CONTINUE)
{
return std::move(result);
return result;
}
}
case WSStreamProcessing::State::VALIDATE:
{
auto result=std::move(validateHeader());
auto result{validateHeader()};
if(result.directive != WSStreamProcessing::Directive::CONTINUE)
{
return std::move(result);
return result;
}
}
case WSStreamProcessing::State::PAYLOAD:
{
auto result=std::move(processPayload(stream,limit,cursor));
auto result{processPayload(stream,limit,cursor)};
if(result.directive != WSStreamProcessing::Directive::CONTINUE)
{
return std::move(result);
return result;
}
}
case WSStreamProcessing::State::DONE:
return std::move(decideOnDone(stream,limit,cursor));
return decideOnDone(stream,limit,cursor);
default:
throw std::logic_error("WSStreamParser::parse() - switch case is out of options. Never should have happened. Blame the programmer");
}
Expand Down
4 changes: 2 additions & 2 deletions include/modules/mqr.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ extern "C" {
auto udjsptr=static_cast<UDJSPTR**>(lua_newuserdata(L,sizeof(UDJSPTR*)));
(*udjsptr)=new UDJSPTR(SHARED_PTR,new JSPTR());

if(queue->tryRecv(*((*udjsptr)->ptr)))
if(queue->try_recv(*((*udjsptr)->ptr)))
{
luaL_getmetatable(L, "nljson");
lua_pushcfunction(L, destroy_nljson_object);
Expand Down Expand Up @@ -207,7 +207,7 @@ extern "C" {
try{
auto udjsptr=static_cast<UDJSPTR**>(lua_newuserdata(L,sizeof(UDJSPTR*)));
(*udjsptr)=new UDJSPTR(SHARED_PTR,new JSPTR());
(*((*udjsptr)->ptr))=std::move(queue->recv());
(*((*udjsptr)->ptr))=queue->recv();

luaL_getmetatable(L, "nljson");
lua_pushcfunction(L, destroy_nljson_object);
Expand Down

0 comments on commit 44a0d82

Please # to comment.