mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-18 15:49:56 +00:00
Avoid cppcheck warnings; removing unused vars and a bit of cleanup.
Patch by: junky Review: https://reviewboard.asterisk.org/r/1743/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362307 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user