diff --git a/apps/dsm/DSMCoreModule.cpp b/apps/dsm/DSMCoreModule.cpp index 874b62e5..7f4f5718 100644 --- a/apps/dsm/DSMCoreModule.cpp +++ b/apps/dsm/DSMCoreModule.cpp @@ -171,7 +171,7 @@ DSMCondition* DSMCoreModule::getCondition(const string& from_str) { DSMCondition* c = new DSMCondition(); c->name = "key pressed: " + params; c->type = DSMCondition::Key; - c->params["key"] = params; + c->params["key"] = std::move(params); return c; } @@ -1046,7 +1046,7 @@ EXEC_ACTION_START(SCGetErrorCodePlaybackAction) { string current_var = pair.substr(0, separator_pos); string current_val = pair.substr(separator_pos + 1); if (current_var == pattern) { - result = current_val; + result = std::move(current_val); break; } } @@ -1054,7 +1054,7 @@ EXEC_ACTION_START(SCGetErrorCodePlaybackAction) { } /* rewrite only if we got something */ if (!result.empty()) - sc_sess->var[destination_variable] = result; + sc_sess->var[std::move(destination_variable)] = std::move(result); } EXEC_ACTION_END; CONST_ACTION_2P(SCAppendAction,',', false); @@ -1616,7 +1616,7 @@ EXEC_ACTION_START(SCB2BGetHeaderReplyAction) { /* write only if we got something */ if (!result.empty()) - sc_sess->var[destination_variable] = result; + sc_sess->var[std::move(destination_variable)] = std::move(result); else DBG("No header with name '%s' found.\n", hdr_name.c_str()); } EXEC_ACTION_END; @@ -1632,7 +1632,7 @@ EXEC_ACTION_START(SCB2BGetHeaderParamReplyAction) { sc_sess->B2BgetHeaderParamReply(hdr_name, param_name, result); /* write only if we got something */ if (!result.empty()) - sc_sess->var[destination_variable] = result; + sc_sess->var[std::move(destination_variable)] = std::move(result); else DBG("No header param with name '%s' found.\n", hdr_name.c_str()); } EXEC_ACTION_END; diff --git a/apps/dsm/DSMStateEngine.cpp b/apps/dsm/DSMStateEngine.cpp index e9d255a8..96c9237f 100644 --- a/apps/dsm/DSMStateEngine.cpp +++ b/apps/dsm/DSMStateEngine.cpp @@ -499,7 +499,7 @@ bool DSMStateEngine::runactions(vector::iterator from, // restore the counter[s] if (k_exists) - sc_sess->var[k_name] = k_save; + sc_sess->var[k_name] = std::move(k_save); else sc_sess->var.erase(k_name); diff --git a/apps/dsm/mods/mod_dlg/ModDlg.cpp b/apps/dsm/mods/mod_dlg/ModDlg.cpp index 84fffe4f..eb25abb1 100644 --- a/apps/dsm/mods/mod_dlg/ModDlg.cpp +++ b/apps/dsm/mods/mod_dlg/ModDlg.cpp @@ -339,7 +339,7 @@ EXEC_ACTION_START(DLGDialoutAction) { string new_sess_tag = AmUAC::dialout(user, app_name, r_uri, from, from_uri, to, ltag, hdrs, sess_params); if (!new_sess_tag.empty()) { - sc_sess->var[arrayname + "_ltag"] = new_sess_tag; + sc_sess->var[arrayname + "_ltag"] = std::move(new_sess_tag); } else { sc_sess->var[arrayname + "_ltag"] = ""; sc_sess->SET_ERRNO(DSM_ERRNO_GENERAL); diff --git a/apps/dsm/mods/mod_sys/ModSys.cpp b/apps/dsm/mods/mod_sys/ModSys.cpp index 578d7bf5..abc68285 100644 --- a/apps/dsm/mods/mod_sys/ModSys.cpp +++ b/apps/dsm/mods/mod_sys/ModSys.cpp @@ -309,7 +309,7 @@ EXEC_ACTION_START(SCPopenAction) { res += string(buf, rlen); } - sc_sess->var[dst_var] = res; + sc_sess->var[dst_var] = std::move(res); int status = pclose(fp); if (status==-1) { diff --git a/apps/dsm/mods/mod_utils/ModUtils.cpp b/apps/dsm/mods/mod_utils/ModUtils.cpp index 86e044e0..5268c151 100644 --- a/apps/dsm/mods/mod_utils/ModUtils.cpp +++ b/apps/dsm/mods/mod_utils/ModUtils.cpp @@ -597,7 +597,7 @@ EXEC_ACTION_START(SCUSAddAction) { DBG("setting var[%s] = %s + %s = %s\n", varname.c_str(), n1.c_str(), n2.c_str(), res.c_str()); - sc_sess->var[varname] = res; + sc_sess->var[std::move(varname)] = std::move(res); } EXEC_ACTION_END; @@ -615,7 +615,7 @@ EXEC_ACTION_START(SCUSSubAction) { DBG("setting var[%s] = %s - %s = %s\n", varname.c_str(), n1.c_str(), n2.c_str(), res.c_str()); - sc_sess->var[varname] = res; + sc_sess->var[std::move(varname)] = std::move(res); } EXEC_ACTION_END; diff --git a/apps/sbc/CallLeg.cpp b/apps/sbc/CallLeg.cpp index 4960d147..16961ea3 100644 --- a/apps/sbc/CallLeg.cpp +++ b/apps/sbc/CallLeg.cpp @@ -1539,7 +1539,7 @@ void CallLeg::replaceExistingLeg(const string &session_tag, const AmSipRequest & return; } - other_legs.push_back(b); + other_legs.push_back(std::move(b)); if (call_status == Disconnected) updateCallStatus(NoReply); // we are something like connected to another leg } @@ -1573,7 +1573,7 @@ void CallLeg::replaceExistingLeg(const string &session_tag, const string &hdrs) return; } - other_legs.push_back(b); + other_legs.push_back(std::move(b)); if (call_status == Disconnected) updateCallStatus(NoReply); // we are something like connected to another leg } diff --git a/apps/sbc/HeaderFilter.cpp b/apps/sbc/HeaderFilter.cpp index 3ece0603..d74dbd86 100644 --- a/apps/sbc/HeaderFilter.cpp +++ b/apps/sbc/HeaderFilter.cpp @@ -83,10 +83,10 @@ bool readFilter(AmConfigReader& cfg, const char* cfg_key_filter, const char* cfg for (vector::iterator it=elems.begin(); it != elems.end(); it++) { string c = *it; std::transform(c.begin(), c.end(), c.begin(), ::tolower); - hf.filter_list.insert(c); + hf.filter_list.insert(std::move(c)); } - filter_list.push_back(hf); + filter_list.push_back(std::move(hf)); return true; } diff --git a/apps/sbc/RegisterDialog.cpp b/apps/sbc/RegisterDialog.cpp index aee04971..318f63dc 100644 --- a/apps/sbc/RegisterDialog.cpp +++ b/apps/sbc/RegisterDialog.cpp @@ -50,7 +50,7 @@ int RegisterDialog::parseContacts(const string& contacts, vector& c DBG("successfully parsed contact %s@%s\n", contact.uri_user.c_str(), contact.uri_host.c_str()); - cv.push_back(contact); + cv.push_back(std::move(contact)); } } @@ -333,7 +333,7 @@ int RegisterDialog::removeTransport(AmUriParser& uri) } free_gen_params(&uri_params); - uri.uri_param = new_params; + uri.uri_param = std::move(new_params); return 0; } @@ -485,7 +485,7 @@ void RegisterDialog::onSipReply(const AmSipRequest& req, if(!orig_expires || (expires < orig_expires)) { orig_expires = expires; - orig_expires_str = expires_str; + orig_expires_str = std::move(expires_str); } if(max_ua_expire && (orig_expires > max_ua_expire)) { @@ -498,7 +498,7 @@ void RegisterDialog::onSipReply(const AmSipRequest& req, // -> use the original // } - it->params["expires"] = orig_expires_str; + it->params["expires"] = std::move(orig_expires_str); // Update global reg cache & alias map // with new 'expire' value and new entries diff --git a/apps/sbc/SBCCallProfile.cpp b/apps/sbc/SBCCallProfile.cpp index 8758dc19..51e238a8 100644 --- a/apps/sbc/SBCCallProfile.cpp +++ b/apps/sbc/SBCCallProfile.cpp @@ -953,7 +953,7 @@ int SBCCallProfile::apply_a_routing(ParamReplacerCtx& ctx, if (!aleg_outbound_proxy.empty()) { string aleg_op = ctx.replaceParameters(aleg_outbound_proxy, "aleg_outbound_proxy", req); - dlg.outbound_proxy = aleg_op; + dlg.outbound_proxy = std::move(aleg_op); dlg.force_outbound_proxy = aleg_force_outbound_proxy; } @@ -989,7 +989,7 @@ int SBCCallProfile::apply_b_routing(ParamReplacerCtx& ctx, if (!outbound_proxy.empty()) { string op = ctx.replaceParameters(outbound_proxy, "outbound_proxy", req); - dlg.outbound_proxy = op; + dlg.outbound_proxy = std::move(op); dlg.force_outbound_proxy = force_outbound_proxy; } @@ -1291,7 +1291,7 @@ string SBCCallProfile::retarget(const string& alias) nh += ":" + int2str(alias_entry.source_port); DBG("setting from registration cache: next_hop='%s'\n", nh.c_str()); - next_hop = nh; + next_hop = std::move(nh); // sticky interface DBG("setting from registration cache: outbound_interface='%s'\n", diff --git a/apps/sbc/call_control/registrar/Registrar.cpp b/apps/sbc/call_control/registrar/Registrar.cpp index 065165ba..23205b90 100644 --- a/apps/sbc/call_control/registrar/Registrar.cpp +++ b/apps/sbc/call_control/registrar/Registrar.cpp @@ -196,7 +196,7 @@ bool retarget(const string& r_uri, const AmArg& values, SBCCallProfile* call_pro string out_if = AmConfig::SIP_Ifs[alias_entry.local_if].name; DBG("out_if = '%s'",out_if.c_str()); - call_profile->outbound_interface = out_if; + call_profile->outbound_interface = std::move(out_if); DBG("setting from registration cache: outbound_interface='%s'\n", call_profile->outbound_interface.c_str()); } diff --git a/apps/sbc/call_control/syslog_cdr/SyslogCDR.cpp b/apps/sbc/call_control/syslog_cdr/SyslogCDR.cpp index b90a57e7..ac05332c 100644 --- a/apps/sbc/call_control/syslog_cdr/SyslogCDR.cpp +++ b/apps/sbc/call_control/syslog_cdr/SyslogCDR.cpp @@ -332,7 +332,7 @@ void SyslogCDR::end(const string& ltag, SBCCallProfile* call_profile, AmArg* v = &var_it->second; if (!prop.empty()) { try { - v = &var_it->second[prop]; + v = &var_it->second[std::move(prop)]; } catch(...) { } } if (isArgCStr((*v))) { diff --git a/core/AmConfig.cpp b/core/AmConfig.cpp index f0c6fd65..9d26bb71 100644 --- a/core/AmConfig.cpp +++ b/core/AmConfig.cpp @@ -1019,7 +1019,7 @@ static bool fillSysIntfList() AmConfig::SysIfs.resize(sys_if_idx+1); intf_it = AmConfig::SysIfs.begin() + sys_if_idx; - intf_it->name = iface_name; + intf_it->name = std::move(iface_name); intf_it->flags = p_if->ifa_flags; struct ifreq ifr; @@ -1195,7 +1195,7 @@ int AmConfig::finalizeIPConfig() ERROR("could not determine default signaling IP."); return -1; } - SIP_Ifs.push_back(intf); + SIP_Ifs.push_back(std::move(intf)); SIP_If_names["default"] = 0; } @@ -1206,7 +1206,7 @@ int AmConfig::finalizeIPConfig() ERROR("could not determine default media IP."); return -1; } - RTP_Ifs.push_back(intf); + RTP_Ifs.push_back(std::move(intf)); RTP_If_names["default"] = 0; } diff --git a/core/AmConfigReader.cpp b/core/AmConfigReader.cpp index e3c692b9..08148fcd 100644 --- a/core/AmConfigReader.cpp +++ b/core/AmConfigReader.cpp @@ -165,7 +165,7 @@ int AmConfigReader::loadFile(const string& path) // small hack to make include work with right path if (keyname == "plugin_config_path") - AmConfig::ModConfigPath = val; + AmConfig::ModConfigPath = std::move(val); } else goto syntax_error; @@ -321,7 +321,7 @@ int AmConfigReader::loadString(const char* cfg_lines, size_t cfg_len) val.c_str()); } - keys[keyname] = val; + keys[std::move(keyname)] = std::move(val); } else goto syntax_error; } diff --git a/core/AmSdp.cpp b/core/AmSdp.cpp index 0bd475aa..27e28bd8 100644 --- a/core/AmSdp.cpp +++ b/core/AmSdp.cpp @@ -430,7 +430,7 @@ void AmSdp::print(string& body) const } } - body = out_buf; + body = std::move(out_buf); } const SdpPayload* AmSdp::telephoneEventPayload() const @@ -1080,7 +1080,7 @@ static char* parse_sdp_attr(AmSdp* sdp_msg, char* s) if(contains(s, line_end, '/')){ next = parse_until(attr_line, '/'); string enc_name(attr_line, int(next-attr_line)-1); - encoding_name = enc_name; + encoding_name = std::move(enc_name); attr_line = next; rtpmap_st = CLK_RATE; break; @@ -1270,7 +1270,7 @@ static void parse_sdp_origin(AmSdp* sdp_msg, char* s) break; } string user(origin_line, int(next-origin_line)-1); - origin.user = user; + origin.user = std::move(user); origin_line = next; origin_st = ID; break; diff --git a/core/AmUriParser.cpp b/core/AmUriParser.cpp index 19549353..27413afe 100644 --- a/core/AmUriParser.cpp +++ b/core/AmUriParser.cpp @@ -436,7 +436,7 @@ string AmUriParser::add_param_to_param_list(const string& param_name, // if param_string empty - set it if (list_of_params.empty()) { - list_of_params = param; + list_of_params = std::move(param); } else { // check if parameter already exists; if yes - replace it diff --git a/core/AmUtils.cpp b/core/AmUtils.cpp index c1638c79..56d272f7 100644 --- a/core/AmUtils.cpp +++ b/core/AmUtils.cpp @@ -1096,7 +1096,7 @@ std::vector explode(const string& s, const string& delim, subend = search(substart, s.end(), delim.begin(), delim.end()); string temp(substart, subend); if (keep_empty || !temp.empty()) { - result.push_back(temp); + result.push_back(std::move(temp)); } if (subend == s.end()) { break; diff --git a/core/plug-in/uac_auth/UACAuth.cpp b/core/plug-in/uac_auth/UACAuth.cpp index cf06255d..d07e62d8 100644 --- a/core/plug-in/uac_auth/UACAuth.cpp +++ b/core/plug-in/uac_auth/UACAuth.cpp @@ -206,7 +206,7 @@ bool UACAuth::onSipReply(const AmSipRequest& req, const AmSipReply& reply, } if (hdrs == "\r\n" || hdrs == "\r" || hdrs == "\n") - hdrs = result; + hdrs = std::move(result); else hdrs += result; @@ -274,7 +274,7 @@ bool UACAuth::onSendRequest(AmSipRequest& req, int& flags) req.method, dlg->getRemoteUri(), &req.body, result)) { // add headers if (req.hdrs == "\r\n" || req.hdrs == "\r" || req.hdrs == "\n") - req.hdrs = result; + req.hdrs = std::move(result); else req.hdrs += result; diff --git a/core/sems.cpp b/core/sems.cpp index 9b155138..983878c1 100644 --- a/core/sems.cpp +++ b/core/sems.cpp @@ -149,7 +149,7 @@ static void set_default_interface(const string& iface_name) if(if_it == AmConfig::SIP_If_names.end()) { AmConfig::SIP_interface intf; intf.name = "default"; - AmConfig::SIP_Ifs.push_back(intf); + AmConfig::SIP_Ifs.push_back(std::move(intf)); AmConfig::SIP_If_names["default"] = AmConfig::SIP_Ifs.size()-1; idx = AmConfig::SIP_Ifs.size()-1; }