aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_queue.c
diff options
context:
space:
mode:
authorseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-01 15:42:48 +0000
committerseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-01 15:42:48 +0000
commit59db0291707517eea353f901b25b18acf0e290b8 (patch)
treef77a2ab1d5d589eca57dfbfcc5404ea6ffe2079c /apps/app_queue.c
parent96d67c9f1667d3ebe04cdebb05b4db72bf884542 (diff)
Move the defintion of the a couple arrays out of loops.
According to Kevin, it is unspecified as to whether a variable defined inside a block is allocated once by the compiler or for each pass through the block (loops being the only interesting case), so just define these before we get into our loop to be sure. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@191422 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r--apps/app_queue.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 1af667097..867bfb6c0 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -594,13 +594,13 @@ static int update_status(const char *interface, const int status)
struct member *cur;
struct ao2_iterator mem_iter;
struct call_queue *q;
+ char tmp_interface[80];
AST_LIST_LOCK(&queues);
AST_LIST_TRAVERSE(&queues, q, list) {
ast_mutex_lock(&q->lock);
mem_iter = ao2_iterator_init(q->members, 0);
while ((cur = ao2_iterator_next(&mem_iter))) {
- char tmp_interface[80];
char *slash_pos;
ast_copy_string(tmp_interface, cur->state_interface, sizeof(tmp_interface));
if ((slash_pos = strchr(tmp_interface, '/')))
@@ -647,6 +647,7 @@ static void *handle_statechange(struct statechange *sc)
struct member_interface *curint;
char *loc;
char *technology;
+ char interface[80];
technology = ast_strdupa(sc->dev);
loc = strchr(technology, '/');
@@ -658,7 +659,6 @@ static void *handle_statechange(struct statechange *sc)
AST_LIST_LOCK(&interfaces);
AST_LIST_TRAVERSE(&interfaces, curint, list) {
- char interface[80];
char *slash_pos;
ast_copy_string(interface, curint->interface, sizeof(interface));
if ((slash_pos = strchr(interface, '/')))