diff options
Diffstat (limited to 'funcs')
-rw-r--r-- | funcs/func_callerid.c | 6 | ||||
-rw-r--r-- | funcs/func_env.c | 2 | ||||
-rw-r--r-- | funcs/func_groupcount.c | 2 | ||||
-rw-r--r-- | funcs/func_odbc.c | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/funcs/func_callerid.c b/funcs/func_callerid.c index 8e8335221..067628353 100644 --- a/funcs/func_callerid.c +++ b/funcs/func_callerid.c @@ -869,7 +869,6 @@ static int callerpres_write(struct ast_channel *chan, const char *cmd, char *dat */ static int callerid_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) { - enum ID_FIELD_STATUS status; char *parms; struct ast_party_members member; AST_DECLARE_APP_ARGS(args, @@ -914,6 +913,7 @@ static int callerid_read(struct ast_channel *chan, const char *cmd, char *data, ast_log(LOG_ERROR, "Unknown callerid data type '%s'.\n", data); } } else { + enum ID_FIELD_STATUS status; ast_channel_lock(chan); if (member.argc == 1 && !strcasecmp("rdnis", member.argv[0])) { @@ -1181,7 +1181,6 @@ static int connectedline_read(struct ast_channel *chan, const char *cmd, char *d { struct ast_party_members member; char *read_what; - enum ID_FIELD_STATUS status; /* Ensure that the buffer is empty */ *buf = 0; @@ -1202,6 +1201,7 @@ static int connectedline_read(struct ast_channel *chan, const char *cmd, char *d if (member.argc == 1 && !strcasecmp("source", member.argv[0])) { ast_copy_string(buf, ast_connected_line_source_name(ast_channel_connected(chan)->source), len); } else { + enum ID_FIELD_STATUS status; status = party_id_read(buf, len, member.argc, member.argv, &ast_channel_connected(chan)->id); switch (status) { case ID_FIELD_VALID: @@ -1233,7 +1233,6 @@ static int connectedline_read(struct ast_channel *chan, const char *cmd, char *d static int connectedline_write(struct ast_channel *chan, const char *cmd, char *data, const char *value) { struct ast_party_connected_line connected; - enum ID_FIELD_STATUS status; char *val; char *parms; void (*set_it)(struct ast_channel *chan, const struct ast_party_connected_line *connected, const struct ast_set_party_connected_line *update); @@ -1296,6 +1295,7 @@ static int connectedline_write(struct ast_channel *chan, const char *cmd, char * set_it(chan, &connected, NULL); } } else { + enum ID_FIELD_STATUS status; status = party_id_write(&connected.id, member.argc, member.argv, value); switch (status) { case ID_FIELD_VALID: diff --git a/funcs/func_env.c b/funcs/func_env.c index 2e10fc228..e849816c3 100644 --- a/funcs/func_env.c +++ b/funcs/func_env.c @@ -600,7 +600,7 @@ static int file_read(struct ast_channel *chan, const char *cmd, char *data, stru ast_log(LOG_ERROR, "Cannot seek to offset %" PRId64 ": %s\n", i, strerror(errno)); } end = fread(fbuf, 1, sizeof(fbuf), ff); - for (pos = end < sizeof(fbuf) ? fbuf + end - 1 : fbuf + sizeof(fbuf) - 1; pos > fbuf - 1; pos--) { + for (pos = (end < sizeof(fbuf) ? fbuf + end - 1 : fbuf + sizeof(fbuf) - 1); pos > fbuf - 1; pos--) { LINE_COUNTER(pos, format, count); if (length < 0 && count * -1 == length) { diff --git a/funcs/func_groupcount.c b/funcs/func_groupcount.c index 255a28d69..95ee0cde6 100644 --- a/funcs/func_groupcount.c +++ b/funcs/func_groupcount.c @@ -146,7 +146,6 @@ static int group_match_count_function_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) { - int count; char group[80] = ""; char category[80] = ""; @@ -154,6 +153,7 @@ static int group_match_count_function_read(struct ast_channel *chan, sizeof(category)); if (!ast_strlen_zero(group)) { + int count; count = ast_app_group_match_get_count(group, category); snprintf(buf, len, "%d", count); return 0; diff --git a/funcs/func_odbc.c b/funcs/func_odbc.c index f86f7608a..1ee9771ad 100644 --- a/funcs/func_odbc.c +++ b/funcs/func_odbc.c @@ -714,9 +714,9 @@ end_acf_read: pbx_builtin_setvar_helper(chan, "ODBCSTATUS", status); pbx_builtin_setvar_helper(chan, "~ODBCFIELDS~", ast_str_buffer(colnames)); if (resultset) { - int uid; struct ast_datastore *odbc_store; if (multirow) { + int uid; uid = ast_atomic_fetchadd_int(&resultcount, +1) + 1; snprintf(buf, len, "%d", uid); } else { |