Fix Gcc Warning:

/libresapi/src/api/RsControlModule.cpp:588: warning: no return statement
in function returning non-void [-Wreturn-type]
This commit is contained in:
Phenom 2018-09-30 14:31:53 +02:00
parent 6ef72f551d
commit d401fdfb40
2 changed files with 6 additions and 6 deletions

View File

@ -486,7 +486,7 @@ void RsControlModule::handleCreateLocation(Request &req, Response &resp)
resp.setFail("hidden_port out of range. It must fit into uint16!");
return;
}
hidden_port = p;
hidden_port = static_cast<uint16_t>(p);
}
RsPgpId pgp_id;
@ -527,7 +527,7 @@ void RsControlModule::handleCreateLocation(Request &req, Response &resp)
RsInit::SetHiddenLocation(hidden_address, hidden_port, false);
}
std::string ssl_password = RSRandom::random_alphaNumericString(RsInit::getSslPwdLen()) ;
std::string ssl_password = RSRandom::random_alphaNumericString(static_cast<uint32_t>(RsInit::getSslPwdLen())) ;
/* GenerateSSLCertificate - selects the PGP Account */
//RsInit::SelectGPGAccount(PGPId);
@ -581,7 +581,7 @@ bool RsControlModule::askForDeferredSelfSignature(const void *data, const uint32
}
}
bool RsControlModule::requestShutdown()
void RsControlModule::requestShutdown()
{
RS_STACK_MUTEX(mExitFlagMtx);
mProcessShouldExit = true;

View File

@ -50,7 +50,7 @@ public:
// full_control: set to true if this module should handle rsinit and login
// set to false if rsinit is handled by the Qt gui
RsControlModule(int argc, char **argv, StateTokenServer* sts, ApiServer* apiserver, bool full_control);
~RsControlModule();
~RsControlModule() override;
// returns true if the process should terminate
bool processShouldExit();
@ -62,12 +62,12 @@ public:
virtual bool askForPassword(const std::string &title, const std::string& key_details, bool prev_is_bad , std::string& password,bool& canceled) override;
virtual bool askForDeferredSelfSignature(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen,int& signature_result, std::string reason = "") override;
virtual bool requestShutdown();
virtual void requestShutdown();
protected:
// from RsThread
// wee need a thread to call into things which block like askForPassword()
virtual void run();
virtual void run() override;
private:
void handleRunState(Request& req, Response& resp);