Fix dead nested assignments in various modules

This commit is contained in:
Andrey Volk committed 2022-08-09 23:20:52 +03:00
1 parent e53e8a17c1
commit c47c16b1dd
34 files changed
+82 -120

No files matched your search

+2 -4
View File
@@ -241,7 +241,6 @@ static switch_xml_t lua_fetch(const char *section,
if (!zstr(globals.xml_handler)) {
L = lua_init();
const char *str;
int error;
mycmd = strdup(globals.xml_handler);
switch_assert(mycmd);
@@ -266,7 +265,7 @@ static switch_xml_t lua_fetch(const char *section,
mod_lua_conjure_event(L, params, "params", 1);
}
if((error = lua_parse_and_execute(L, mycmd, NULL))){
if(lua_parse_and_execute(L, mycmd, NULL)){
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "LUA script parse/execute error!\n");
goto end;
}
@@ -522,7 +521,6 @@ SWITCH_STANDARD_API(lua_api_function)
{
char *mycmd;
int error;
if (zstr(cmd)) {
stream->write_function(stream, "");
@@ -541,7 +539,7 @@ SWITCH_STANDARD_API(lua_api_function)
mod_lua_conjure_event(L, stream->param_event, "env", 1);
}
if ((error = lua_parse_and_execute(L, mycmd, session))) {
if (lua_parse_and_execute(L, mycmd, session)) {
char * http = switch_event_get_header(stream->param_event, "http-uri");
if (http && (!strncasecmp(http, "/api/", 5) || !strncasecmp(http, "/webapi/", 8))) {
/* api -> fs api streams the Content-Type e.g. text/html or text/xml */
@@ -144,7 +144,7 @@ void Session::check_hangup_hook()
void Session::do_hangup_hook()
{
PyObject *result, *arglist;
PyObject *arglist;
const char *what = hook_state == CS_HANGUP ? "hangup" : "transfer";
if (hh && !mark) {
@@ -167,7 +167,7 @@ void Session::do_hangup_hook()
arglist = Py_BuildValue("(Os)", Self, what);
}
if (!(result = PyEval_CallObject(hangup_func, arglist))) {
if (!PyEval_CallObject(hangup_func, arglist)) {
PyErr_Print();
}
+1 -2
View File
@@ -178,7 +178,6 @@ static void eval_some_python(const char *funcname, char *args, switch_core_sessi
PyThreadState *tstate = NULL;
char *dupargs = NULL;
char *argv[2] = { 0 };
int argc;
char *script = NULL;
PyObject *module_o = NULL, *module = NULL, *sp = NULL, *stp = NULL, *eve = NULL;
PyObject *function = NULL;
@@ -198,7 +197,7 @@ static void eval_some_python(const char *funcname, char *args, switch_core_sessi
assert(dupargs != NULL);
if (!(argc = switch_separate_string(dupargs, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) {
if (!switch_separate_string(dupargs, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "No module name specified!\n");
goto done;
}