[asterisk-commits] seanbright: branch seanbright/resolve-shadow-warnings r114313 - in /team/sean...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sat Apr 19 18:50:40 CDT 2008
Author: seanbright
Date: Sat Apr 19 18:50:40 2008
New Revision: 114313
URL: http://svn.digium.com/view/asterisk?view=rev&rev=114313
Log:
Welp, that's everything that I can compile on my machine.
Modified:
team/seanbright/resolve-shadow-warnings/main/abstract_jb.c
team/seanbright/resolve-shadow-warnings/main/acl.c
team/seanbright/resolve-shadow-warnings/main/app.c
team/seanbright/resolve-shadow-warnings/main/asterisk.c
team/seanbright/resolve-shadow-warnings/main/audiohook.c
team/seanbright/resolve-shadow-warnings/main/callerid.c
team/seanbright/resolve-shadow-warnings/main/cdr.c
team/seanbright/resolve-shadow-warnings/main/channel.c
team/seanbright/resolve-shadow-warnings/main/cli.c
team/seanbright/resolve-shadow-warnings/main/config.c
team/seanbright/resolve-shadow-warnings/main/db1-ast/btree/bt_delete.c
team/seanbright/resolve-shadow-warnings/main/db1-ast/btree/bt_put.c
team/seanbright/resolve-shadow-warnings/main/db1-ast/recno/rec_delete.c
team/seanbright/resolve-shadow-warnings/main/db1-ast/recno/rec_put.c
team/seanbright/resolve-shadow-warnings/main/event.c
team/seanbright/resolve-shadow-warnings/main/features.c
team/seanbright/resolve-shadow-warnings/main/file.c
team/seanbright/resolve-shadow-warnings/main/frame.c
team/seanbright/resolve-shadow-warnings/main/http.c
team/seanbright/resolve-shadow-warnings/main/indications.c
team/seanbright/resolve-shadow-warnings/main/jitterbuf.c
team/seanbright/resolve-shadow-warnings/main/logger.c
team/seanbright/resolve-shadow-warnings/main/manager.c
team/seanbright/resolve-shadow-warnings/main/pbx.c
team/seanbright/resolve-shadow-warnings/main/rtp.c
team/seanbright/resolve-shadow-warnings/main/say.c
team/seanbright/resolve-shadow-warnings/main/sched.c
team/seanbright/resolve-shadow-warnings/main/tdd.c
team/seanbright/resolve-shadow-warnings/main/udptl.c
Modified: team/seanbright/resolve-shadow-warnings/main/abstract_jb.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/main/abstract_jb.c?view=diff&rev=114313&r1=114312&r2=114313
==============================================================================
--- team/seanbright/resolve-shadow-warnings/main/abstract_jb.c (original)
+++ team/seanbright/resolve-shadow-warnings/main/abstract_jb.c Sat Apr 19 18:50:40 2008
@@ -546,16 +546,16 @@
}
-static long get_now(struct ast_jb *jb, struct timeval *tv)
+static long get_now(struct ast_jb *jb, struct timeval *when)
{
struct timeval now;
- if (!tv) {
- tv = &now;
- gettimeofday(tv, NULL);
- }
-
- return ast_tvdiff_ms(*tv, jb->timebase);
+ if (!when) {
+ when = &now;
+ gettimeofday(when, NULL);
+ }
+
+ return ast_tvdiff_ms(*when, jb->timebase);
}
Modified: team/seanbright/resolve-shadow-warnings/main/acl.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/main/acl.c?view=diff&rev=114313&r1=114312&r2=114313
==============================================================================
--- team/seanbright/resolve-shadow-warnings/main/acl.c (original)
+++ team/seanbright/resolve-shadow-warnings/main/acl.c Sat Apr 19 18:50:40 2008
@@ -246,18 +246,18 @@
{
struct ast_ha *start = original;
struct ast_ha *ret = NULL;
- struct ast_ha *link, *prev = NULL;
+ struct ast_ha *current, *prev = NULL;
while (start) {
- link = ast_duplicate_ha(start); /* Create copy of this object */
+ current = ast_duplicate_ha(start); /* Create copy of this object */
if (prev)
- prev->next = link; /* Link previous to this object */
+ prev->next = current; /* Link previous to this object */
if (!ret)
- ret = link; /* Save starting point */
+ ret = current; /* Save starting point */
start = start->next; /* Go to next object */
- prev = link; /* Save pointer to this object */
+ prev = current; /* Save pointer to this object */
}
return ret; /* Return start of list */
}
Modified: team/seanbright/resolve-shadow-warnings/main/app.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/main/app.c?view=diff&rev=114313&r1=114312&r2=114313
==============================================================================
--- team/seanbright/resolve-shadow-warnings/main/app.c (original)
+++ team/seanbright/resolve-shadow-warnings/main/app.c Sat Apr 19 18:50:40 2008
@@ -406,7 +406,7 @@
int ast_control_streamfile(struct ast_channel *chan, const char *file,
const char *fwd, const char *rev,
- const char *stop, const char *pause,
+ const char *stop, const char *suspend,
const char *restart, int skipms, long *offsetms)
{
char *breaks = NULL;
@@ -421,8 +421,8 @@
if (stop)
blen += strlen(stop);
- if (pause)
- blen += strlen(pause);
+ if (suspend)
+ blen += strlen(suspend);
if (restart)
blen += strlen(restart);
@@ -431,8 +431,8 @@
breaks[0] = '\0';
if (stop)
strcat(breaks, stop);
- if (pause)
- strcat(breaks, pause);
+ if (suspend)
+ strcat(breaks, suspend);
if (restart)
strcat(breaks, restart);
}
@@ -482,17 +482,17 @@
continue;
}
- if (pause && strchr(pause, res)) {
+ if (suspend && strchr(suspend, res)) {
pause_restart_point = ast_tellstream(chan->stream);
for (;;) {
ast_stopstream(chan);
res = ast_waitfordigit(chan, 1000);
if (!res)
continue;
- else if (res == -1 || strchr(pause, res) || (stop && strchr(stop, res)))
+ else if (res == -1 || strchr(suspend, res) || (stop && strchr(stop, res)))
break;
}
- if (res == *pause) {
+ if (res == *suspend) {
res = 0;
continue;
}
Modified: team/seanbright/resolve-shadow-warnings/main/asterisk.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/main/asterisk.c?view=diff&rev=114313&r1=114312&r2=114313
==============================================================================
--- team/seanbright/resolve-shadow-warnings/main/asterisk.c (original)
+++ team/seanbright/resolve-shadow-warnings/main/asterisk.c Sat Apr 19 18:50:40 2008
@@ -640,14 +640,14 @@
ast_cli(a->fd, "%6s %8s %10s %12s %12s %s\n", "ID", "Scale", "Events",
"Value", "Average", "Name");
for (i = min; i < max; i++) {
- struct profile_entry *e = &prof_data->e[i];
- if (!search || strstr(prof_data->e[i].name, search))
+ struct profile_entry *entry = &prof_data->e[i];
+ if (!search || strstr(entry->name, search))
ast_cli(a->fd, "%6d: [%8ld] %10ld %12lld %12lld %s\n",
i,
- (long)e->scale,
- (long)e->events, (long long)e->value,
- (long long)(e->events ? e->value / e->events : e->value),
- e->name);
+ (long)entry->scale,
+ (long)entry->events, (long long)entry->value,
+ (long long)(entry->events ? entry->value / entry->events : entry->value),
+ entry->name);
}
return CLI_SUCCESS;
}
@@ -806,7 +806,7 @@
}
/*! \brief NULL handler so we can collect the child exit status */
-static void null_sig_handler(int signal)
+static void null_sig_handler(int sig)
{
}
@@ -1295,7 +1295,7 @@
AST_RWLIST_UNLOCK(&atexits);
}
-static void quit_handler(int num, int nice, int safeshutdown, int restart)
+static void quit_handler(int num, int niceness, int safeshutdown, int restart)
{
char filename[80] = "";
time_t s,e;
@@ -1304,7 +1304,7 @@
ast_cdr_engine_term();
if (safeshutdown) {
shuttingdown = 1;
- if (!nice) {
+ if (!niceness) {
/* Begin shutdown routine, hanging up active channels */
ast_begin_shutdown(1);
if (option_verbose && ast_opt_console)
@@ -1323,7 +1323,7 @@
usleep(100000);
}
} else {
- if (nice < 2)
+ if (niceness < 2)
ast_begin_shutdown(0);
if (option_verbose && ast_opt_console)
ast_verbose("Waiting for inactivity to perform %s...\n", restart ? "restart" : "halt");
@@ -1342,7 +1342,7 @@
return;
}
- if (nice)
+ if (niceness)
ast_module_shutdown();
}
if (ast_opt_console || ast_opt_remote) {
@@ -1858,7 +1858,7 @@
#endif /* ! LOW_MEMORY */
};
-static int ast_el_read_char(EditLine *el, char *cp)
+static int ast_el_read_char(EditLine *editline, char *cp)
{
int num_read = 0;
int lastpos = 0;
@@ -1940,7 +1940,7 @@
return (0);
}
-static char *cli_prompt(EditLine *el)
+static char *cli_prompt(EditLine *editline)
{
static char prompt[200];
char *pfmt;
@@ -2176,7 +2176,7 @@
}
-static char *cli_complete(EditLine *el, int ch)
+static char *cli_complete(EditLine *editline, int ch)
{
int len = 0;
char *ptr;
@@ -2186,7 +2186,7 @@
char buf[2048];
int res;
- LineInfo *lf = (LineInfo *)el_line(el);
+ LineInfo *lf = (LineInfo *)el_line(editline);
*(char *)lf->cursor = '\0';
ptr = (char *)lf->cursor;
@@ -2253,14 +2253,14 @@
int matches_num, maxlen, match_len;
if (matches[0][0] != '\0') {
- el_deletestr(el, (int) len);
- el_insertstr(el, matches[0]);
+ el_deletestr(editline, (int) len);
+ el_insertstr(editline, matches[0]);
retval = CC_REFRESH;
}
if (nummatches == 1) {
/* Found an exact match */
- el_insertstr(el, " ");
+ el_insertstr(editline, " ");
retval = CC_REFRESH;
} else {
/* Must be more than one match */
@@ -2275,7 +2275,7 @@
ast_cli_display_match_list(matches, nummatches, maxlen);
retval = CC_REDISPLAY;
} else {
- el_insertstr(el," ");
+ el_insertstr(editline," ");
retval = CC_REFRESH;
}
}
@@ -2722,15 +2722,15 @@
static void *canary_thread(void *unused)
{
struct stat canary_stat;
- struct timeval tv;
+ struct timeval now;
/* Give the canary time to sing */
sleep(120);
for (;;) {
stat(canary_filename, &canary_stat);
- tv = ast_tvnow();
- if (tv.tv_sec > canary_stat.st_mtime + 60) {
+ now = ast_tvnow();
+ if (now.tv_sec > canary_stat.st_mtime + 60) {
ast_log(LOG_WARNING, "The canary is no more. He has ceased to be! He's expired and gone to meet his maker! He's a stiff! Bereft of life, he rests in peace. His metabolic processes are now history! He's off the twig! He's kicked the bucket. He's shuffled off his mortal coil, run down the curtain, and joined the bleeding choir invisible!! THIS is an EX-CANARY. (Reducing priority)\n");
ast_set_priority(0);
pthread_exit(NULL);
@@ -3186,18 +3186,19 @@
#ifdef HAVE_ZAPTEL
{
int fd;
- int x = 160;
+ int period = 160;
+
fd = open("/dev/zap/timer", O_RDWR);
if (fd >= 0) {
- if (ioctl(fd, ZT_TIMERCONFIG, &x)) {
+ if (ioctl(fd, ZT_TIMERCONFIG, &period)) {
ast_log(LOG_ERROR, "You have Zaptel built and drivers loaded, but the Zaptel timer test failed to set ZT_TIMERCONFIG to %d.\n", x);
exit(1);
}
- if ((x = ast_wait_for_input(fd, 300)) < 0) {
+ if ((period = ast_wait_for_input(fd, 300)) < 0) {
ast_log(LOG_ERROR, "You have Zaptel built and drivers loaded, but the Zaptel timer could not be polled during the Zaptel timer test.\n");
exit(1);
}
- if (!x) {
+ if (!period) {
const char zaptel_timer_error[] = {
"Asterisk has detected a problem with your Zaptel configuration and will shutdown for your protection. You have options:"
"\n\t1. You only have to compile Zaptel support into Asterisk if you need it. One option is to recompile without Zaptel support."
Modified: team/seanbright/resolve-shadow-warnings/main/audiohook.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/main/audiohook.c?view=diff&rev=114313&r1=114312&r2=114313
==============================================================================
--- team/seanbright/resolve-shadow-warnings/main/audiohook.c (original)
+++ team/seanbright/resolve-shadow-warnings/main/audiohook.c Sat Apr 19 18:50:40 2008
@@ -122,13 +122,13 @@
{
struct ast_slinfactory *factory = (direction == AST_AUDIOHOOK_DIRECTION_READ ? &audiohook->read_factory : &audiohook->write_factory);
struct ast_slinfactory *other_factory = (direction == AST_AUDIOHOOK_DIRECTION_READ ? &audiohook->write_factory : &audiohook->read_factory);
- struct timeval *time = (direction == AST_AUDIOHOOK_DIRECTION_READ ? &audiohook->read_time : &audiohook->write_time), previous_time = *time;
+ struct timeval *rwtime = (direction == AST_AUDIOHOOK_DIRECTION_READ ? &audiohook->read_time : &audiohook->write_time), previous_time = *rwtime;
/* Update last feeding time to be current */
- *time = ast_tvnow();
+ *rwtime = ast_tvnow();
/* If we are using a sync trigger and this factory suddenly got audio fed in after a lapse, then flush both factories to ensure they remain in sync */
- if (ast_test_flag(audiohook, AST_AUDIOHOOK_TRIGGER_SYNC) && ast_slinfactory_available(other_factory) && (ast_tvdiff_ms(*time, previous_time) > (ast_slinfactory_available(other_factory) / 8))) {
+ if (ast_test_flag(audiohook, AST_AUDIOHOOK_TRIGGER_SYNC) && ast_slinfactory_available(other_factory) && (ast_tvdiff_ms(*rwtime, previous_time) > (ast_slinfactory_available(other_factory) / 8))) {
if (option_debug)
ast_log(LOG_DEBUG, "Flushing audiohook %p so it remains in sync\n", audiohook);
ast_slinfactory_flush(factory);
@@ -630,12 +630,12 @@
*/
void ast_audiohook_trigger_wait(struct ast_audiohook *audiohook)
{
- struct timeval tv;
+ struct timeval wait;
struct timespec ts;
- tv = ast_tvadd(ast_tvnow(), ast_samp2tv(50000, 1000));
- ts.tv_sec = tv.tv_sec;
- ts.tv_nsec = tv.tv_usec * 1000;
+ wait = ast_tvadd(ast_tvnow(), ast_samp2tv(50000, 1000));
+ ts.tv_sec = wait.tv_sec;
+ ts.tv_nsec = wait.tv_usec * 1000;
ast_cond_timedwait(&audiohook->trigger, &audiohook->lock, &ts);
Modified: team/seanbright/resolve-shadow-warnings/main/callerid.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/main/callerid.c?view=diff&rev=114313&r1=114312&r2=114313
==============================================================================
--- team/seanbright/resolve-shadow-warnings/main/callerid.c (original)
+++ team/seanbright/resolve-shadow-warnings/main/callerid.c Sat Apr 19 18:50:40 2008
@@ -700,14 +700,14 @@
static int callerid_genmsg(char *msg, int size, const char *number, const char *name, int flags)
{
- struct timeval tv = ast_tvnow();
+ struct timeval now = ast_tvnow();
struct ast_tm tm;
char *ptr;
int res;
int i, x;
/* Get the time */
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&now, &tm, NULL);
ptr = msg;
Modified: team/seanbright/resolve-shadow-warnings/main/cdr.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/main/cdr.c?view=diff&rev=114313&r1=114312&r2=114313
==============================================================================
--- team/seanbright/resolve-shadow-warnings/main/cdr.c (original)
+++ team/seanbright/resolve-shadow-warnings/main/cdr.c Sat Apr 19 18:50:40 2008
@@ -196,15 +196,15 @@
return NULL;
}
-static void cdr_get_tv(struct timeval tv, const char *fmt, char *buf, int bufsize)
+static void cdr_get_tv(struct timeval when, const char *fmt, char *buf, int bufsize)
{
if (fmt == NULL) { /* raw mode */
- snprintf(buf, bufsize, "%ld.%06ld", (long)tv.tv_sec, (long)tv.tv_usec);
+ snprintf(buf, bufsize, "%ld.%06ld", (long)when.tv_sec, (long)when.tv_usec);
} else {
- if (tv.tv_sec) {
+ if (when.tv_sec) {
struct ast_tm tm;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
ast_strftime(buf, bufsize, fmt, &tm);
}
}
@@ -1007,7 +1007,7 @@
void ast_cdr_reset(struct ast_cdr *cdr, struct ast_flags *_flags)
{
- struct ast_cdr *dup;
+ struct ast_cdr *duplicate;
struct ast_flags flags = { 0 };
if (_flags)
@@ -1018,8 +1018,8 @@
if (ast_test_flag(&flags, AST_CDR_FLAG_LOCKED) || !ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
if (ast_test_flag(&flags, AST_CDR_FLAG_POSTED)) {
ast_cdr_end(cdr);
- if ((dup = ast_cdr_dup(cdr))) {
- ast_cdr_detach(dup);
+ if ((duplicate = ast_cdr_dup(cdr))) {
+ ast_cdr_detach(duplicate);
}
ast_set_flag(cdr, AST_CDR_FLAG_POSTED);
}
@@ -1102,7 +1102,7 @@
return NULL;
}
-void ast_cdr_submit_batch(int shutdown)
+void ast_cdr_submit_batch(int do_shutdown)
{
struct ast_cdr_batch_item *oldbatchitems = NULL;
pthread_t batch_post_thread = AST_PTHREADT_NULL;
@@ -1119,7 +1119,7 @@
/* if configured, spawn a new thread to post these CDRs,
also try to save as much as possible if we are shutting down safely */
- if (batchscheduleronly || shutdown) {
+ if (batchscheduleronly || do_shutdown) {
ast_debug(1, "CDR single-threaded batch processing begins now\n");
do_batch_backend_process(oldbatchitems);
} else {
Modified: team/seanbright/resolve-shadow-warnings/main/channel.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/main/channel.c?view=diff&rev=114313&r1=114312&r2=114313
==============================================================================
--- team/seanbright/resolve-shadow-warnings/main/channel.c (original)
+++ team/seanbright/resolve-shadow-warnings/main/channel.c Sat Apr 19 18:50:40 2008
@@ -1535,16 +1535,16 @@
return res;
}
-static void free_translation(struct ast_channel *clone)
-{
- if (clone->writetrans)
- ast_translator_free_path(clone->writetrans);
- if (clone->readtrans)
- ast_translator_free_path(clone->readtrans);
- clone->writetrans = NULL;
- clone->readtrans = NULL;
- clone->rawwriteformat = clone->nativeformats;
- clone->rawreadformat = clone->nativeformats;
+static void free_translation(struct ast_channel *clonechan)
+{
+ if (clonechan->writetrans)
+ ast_translator_free_path(clonechan->writetrans);
+ if (clonechan->readtrans)
+ ast_translator_free_path(clonechan->readtrans);
+ clonechan->writetrans = NULL;
+ clonechan->readtrans = NULL;
+ clonechan->rawwriteformat = clonechan->nativeformats;
+ clonechan->rawreadformat = clonechan->nativeformats;
}
/*! \brief Hangup a channel */
@@ -3580,17 +3580,17 @@
return rc;
}
-int ast_channel_masquerade(struct ast_channel *original, struct ast_channel *clone)
+int ast_channel_masquerade(struct ast_channel *original, struct ast_channel *clonechan)
{
int res = -1;
struct ast_channel *final_orig, *final_clone, *base;
retrymasq:
final_orig = original;
- final_clone = clone;
+ final_clone = clonechan;
ast_channel_lock(original);
- while (ast_channel_trylock(clone)) {
+ while (ast_channel_trylock(clonechan)) {
ast_channel_unlock(original);
usleep(1);
ast_channel_lock(original);
@@ -3601,59 +3601,59 @@
if (original->_bridge && (original->_bridge != ast_bridged_channel(original)) && (original->_bridge->_bridge != original))
final_orig = original->_bridge;
- if (clone->_bridge && (clone->_bridge != ast_bridged_channel(clone)) && (clone->_bridge->_bridge != clone))
- final_clone = clone->_bridge;
+ if (clonechan->_bridge && (clonechan->_bridge != ast_bridged_channel(clonechan)) && (clonechan->_bridge->_bridge != clonechan))
+ final_clone = clonechan->_bridge;
if (final_clone->tech->get_base_channel && (base = final_clone->tech->get_base_channel(final_clone))) {
final_clone = base;
}
- if ((final_orig != original) || (final_clone != clone)) {
+ if ((final_orig != original) || (final_clone != clonechan)) {
/* Lots and lots of deadlock avoidance. The main one we're competing with
* is ast_write(), which locks channels recursively, when working with a
* proxy channel. */
if (ast_channel_trylock(final_orig)) {
- ast_channel_unlock(clone);
+ ast_channel_unlock(clonechan);
ast_channel_unlock(original);
goto retrymasq;
}
if (ast_channel_trylock(final_clone)) {
ast_channel_unlock(final_orig);
- ast_channel_unlock(clone);
+ ast_channel_unlock(clonechan);
ast_channel_unlock(original);
goto retrymasq;
}
- ast_channel_unlock(clone);
+ ast_channel_unlock(clonechan);
ast_channel_unlock(original);
original = final_orig;
- clone = final_clone;
- }
-
- if (original == clone) {
+ clonechan = final_clone;
+ }
+
+ if (original == clonechan) {
ast_log(LOG_WARNING, "Can't masquerade channel '%s' into itself!\n", original->name);
- ast_channel_unlock(clone);
+ ast_channel_unlock(clonechan);
ast_channel_unlock(original);
return -1;
}
ast_debug(1, "Planning to masquerade channel %s into the structure of %s\n",
- clone->name, original->name);
+ clonechan->name, original->name);
if (original->masq) {
ast_log(LOG_WARNING, "%s is already going to masquerade as %s\n",
original->masq->name, original->name);
- } else if (clone->masqr) {
+ } else if (clonechan->masqr) {
ast_log(LOG_WARNING, "%s is already going to masquerade as %s\n",
- clone->name, clone->masqr->name);
+ clonechan->name, clonechan->masqr->name);
} else {
- original->masq = clone;
- clone->masqr = original;
+ original->masq = clonechan;
+ clonechan->masqr = original;
ast_queue_frame(original, &ast_null_frame);
- ast_queue_frame(clone, &ast_null_frame);
- ast_debug(1, "Done planning to masquerade channel %s into the structure of %s\n", clone->name, original->name);
+ ast_queue_frame(clonechan, &ast_null_frame);
+ ast_debug(1, "Done planning to masquerade channel %s into the structure of %s\n", clonechan->name, original->name);
res = 0;
}
- ast_channel_unlock(clone);
+ ast_channel_unlock(clonechan);
ast_channel_unlock(original);
return res;
@@ -3714,20 +3714,20 @@
\note Assumes locks will be in place on both channels when called.
*/
-static void clone_variables(struct ast_channel *original, struct ast_channel *clone)
+static void clone_variables(struct ast_channel *original, struct ast_channel *clonechan)
{
struct ast_var_t *current, *newvar;
/* Append variables from clone channel into original channel */
/* XXX Is this always correct? We have to in order to keep MACROS working XXX */
- if (AST_LIST_FIRST(&clone->varshead))
- AST_LIST_APPEND_LIST(&original->varshead, &clone->varshead, entries);
+ if (AST_LIST_FIRST(&clonechan->varshead))
+ AST_LIST_APPEND_LIST(&original->varshead, &clonechan->varshead, entries);
/* then, dup the varshead list into the clone */
AST_LIST_TRAVERSE(&original->varshead, current, entries) {
newvar = ast_var_assign(current->name, current->value);
if (newvar)
- AST_LIST_INSERT_TAIL(&clone->varshead, newvar, entries);
+ AST_LIST_INSERT_TAIL(&clonechan->varshead, newvar, entries);
}
}
@@ -3741,11 +3741,11 @@
int x,i;
int res=0;
int origstate;
- struct ast_frame *cur;
+ struct ast_frame *current;
const struct ast_channel_tech *t;
void *t_pvt;
struct ast_callerid tmpcid;
- struct ast_channel *clone = original->masq;
+ struct ast_channel *clonechan = original->masq;
struct ast_cdr *cdr;
int rformat = original->readformat;
int wformat = original->writeformat;
@@ -3755,10 +3755,10 @@
char zombn[AST_CHANNEL_NAME];
ast_debug(4, "Actually Masquerading %s(%d) into the structure of %s(%d)\n",
- clone->name, clone->_state, original->name, original->_state);
+ clonechan->name, clonechan->_state, original->name, original->_state);
manager_event(EVENT_FLAG_CALL, "Masquerade", "Clone: %s\r\nCloneState: %s\r\nOriginal: %s\r\nOriginalState: %s\r\n",
- clone->name, ast_state2str(clone->_state), original->name, ast_state2str(original->_state));
+ clonechan->name, ast_state2str(clonechan->_state), original->name, ast_state2str(original->_state));
/* XXX This is a seriously wacked out operation. We're essentially putting the guts of
the clone channel into the original channel. Start by killing off the original
@@ -3766,24 +3766,24 @@
while the features are nice, the cost is very high in terms of pure nastiness. XXX */
/* We need the clone's lock, too */
- ast_channel_lock(clone);
-
- ast_debug(2, "Got clone lock for masquerade on '%s' at %p\n", clone->name, &clone->lock_dont_use);
+ ast_channel_lock(clonechan);
+
+ ast_debug(2, "Got clone lock for masquerade on '%s' at %p\n", clonechan->name, &clonechan->lock_dont_use);
/* Having remembered the original read/write formats, we turn off any translation on either
one */
- free_translation(clone);
+ free_translation(clonechan);
free_translation(original);
/* Unlink the masquerade */
original->masq = NULL;
- clone->masqr = NULL;
+ clonechan->masqr = NULL;
/* Save the original name */
ast_copy_string(orig, original->name, sizeof(orig));
/* Save the new name */
- ast_copy_string(newn, clone->name, sizeof(newn));
+ ast_copy_string(newn, clonechan->name, sizeof(newn));
/* Create the masq name */
snprintf(masqn, sizeof(masqn), "%s<MASQ>", newn);
@@ -3791,31 +3791,31 @@
ast_string_field_set(original, name, newn);
/* Mangle the name of the clone channel */
- ast_string_field_set(clone, name, masqn);
+ ast_string_field_set(clonechan, name, masqn);
/* Notify any managers of the change, first the masq then the other */
- manager_event(EVENT_FLAG_CALL, "Rename", "Channel: %s\r\nNewname: %s\r\nUniqueid: %s\r\n", newn, masqn, clone->uniqueid);
+ manager_event(EVENT_FLAG_CALL, "Rename", "Channel: %s\r\nNewname: %s\r\nUniqueid: %s\r\n", newn, masqn, clonechan->uniqueid);
manager_event(EVENT_FLAG_CALL, "Rename", "Channel: %s\r\nNewname: %s\r\nUniqueid: %s\r\n", orig, newn, original->uniqueid);
/* Swap the technologies */
t = original->tech;
- original->tech = clone->tech;
- clone->tech = t;
+ original->tech = clonechan->tech;
+ clonechan->tech = t;
/* Swap the cdrs */
cdr = original->cdr;
- original->cdr = clone->cdr;
- clone->cdr = cdr;
+ original->cdr = clonechan->cdr;
+ clonechan->cdr = cdr;
t_pvt = original->tech_pvt;
- original->tech_pvt = clone->tech_pvt;
- clone->tech_pvt = t_pvt;
+ original->tech_pvt = clonechan->tech_pvt;
+ clonechan->tech_pvt = t_pvt;
/* Swap the alertpipes */
for (i = 0; i < 2; i++) {
x = original->alertpipe[i];
- original->alertpipe[i] = clone->alertpipe[i];
- clone->alertpipe[i] = x;
+ original->alertpipe[i] = clonechan->alertpipe[i];
+ clonechan->alertpipe[i] = x;
}
/*
@@ -3834,10 +3834,10 @@
AST_LIST_HEAD_SET_NOLOCK(&tmp_readq, NULL);
AST_LIST_APPEND_LIST(&tmp_readq, &original->readq, frame_list);
- AST_LIST_APPEND_LIST(&original->readq, &clone->readq, frame_list);
-
- while ((cur = AST_LIST_REMOVE_HEAD(&tmp_readq, frame_list))) {
- AST_LIST_INSERT_TAIL(&original->readq, cur, frame_list);
+ AST_LIST_APPEND_LIST(&original->readq, &clonechan->readq, frame_list);
+
+ while ((current = AST_LIST_REMOVE_HEAD(&tmp_readq, frame_list))) {
+ AST_LIST_INSERT_TAIL(&original->readq, current, frame_list);
if (original->alertpipe[1] > -1) {
int poke = 0;
write(original->alertpipe[1], &poke, sizeof(poke));
@@ -3847,77 +3847,77 @@
/* Swap the raw formats */
x = original->rawreadformat;
- original->rawreadformat = clone->rawreadformat;
- clone->rawreadformat = x;
+ original->rawreadformat = clonechan->rawreadformat;
+ clonechan->rawreadformat = x;
x = original->rawwriteformat;
- original->rawwriteformat = clone->rawwriteformat;
- clone->rawwriteformat = x;
-
- clone->_softhangup = AST_SOFTHANGUP_DEV;
+ original->rawwriteformat = clonechan->rawwriteformat;
+ clonechan->rawwriteformat = x;
+
+ clonechan->_softhangup = AST_SOFTHANGUP_DEV;
/* And of course, so does our current state. Note we need not
call ast_setstate since the event manager doesn't really consider
these separate. We do this early so that the clone has the proper
state of the original channel. */
origstate = original->_state;
- original->_state = clone->_state;
- clone->_state = origstate;
-
- if (clone->tech->fixup){
- res = clone->tech->fixup(original, clone);
+ original->_state = clonechan->_state;
+ clonechan->_state = origstate;
+
+ if (clonechan->tech->fixup){
+ res = clonechan->tech->fixup(original, clonechan);
if (res)
- ast_log(LOG_WARNING, "Fixup failed on channel %s, strange things may happen.\n", clone->name);
+ ast_log(LOG_WARNING, "Fixup failed on channel %s, strange things may happen.\n", clonechan->name);
}
/* Start by disconnecting the original's physical side */
- if (clone->tech->hangup)
- res = clone->tech->hangup(clone);
+ if (clonechan->tech->hangup)
+ res = clonechan->tech->hangup(clonechan);
if (res) {
ast_log(LOG_WARNING, "Hangup failed! Strange things may happen!\n");
- ast_channel_unlock(clone);
+ ast_channel_unlock(clonechan);
return -1;
}
snprintf(zombn, sizeof(zombn), "%s<ZOMBIE>", orig);
/* Mangle the name of the clone channel */
- ast_string_field_set(clone, name, zombn);
- manager_event(EVENT_FLAG_CALL, "Rename", "Channel: %s\r\nNewname: %s\r\nUniqueid: %s\r\n", masqn, zombn, clone->uniqueid);
+ ast_string_field_set(clonechan, name, zombn);
+ manager_event(EVENT_FLAG_CALL, "Rename", "Channel: %s\r\nNewname: %s\r\nUniqueid: %s\r\n", masqn, zombn, clonechan->uniqueid);
/* Update the type. */
t_pvt = original->monitor;
- original->monitor = clone->monitor;
- clone->monitor = t_pvt;
+ original->monitor = clonechan->monitor;
+ clonechan->monitor = t_pvt;
/* Keep the same language. */
- ast_string_field_set(original, language, clone->language);
+ ast_string_field_set(original, language, clonechan->language);
/* Copy the FD's other than the generator fd */
for (x = 0; x < AST_MAX_FDS; x++) {
if (x != AST_GENERATOR_FD)
- ast_channel_set_fd(original, x, clone->fds[x]);
- }
-
- ast_app_group_update(clone, original);
+ ast_channel_set_fd(original, x, clonechan->fds[x]);
+ }
+
+ ast_app_group_update(clonechan, original);
/* Move data stores over */
- if (AST_LIST_FIRST(&clone->datastores)) {
+ if (AST_LIST_FIRST(&clonechan->datastores)) {
struct ast_datastore *ds;
- AST_LIST_APPEND_LIST(&original->datastores, &clone->datastores, entry);
+ AST_LIST_APPEND_LIST(&original->datastores, &clonechan->datastores, entry);
AST_LIST_TRAVERSE(&original->datastores, ds, entry) {
if (ds->info->chan_fixup)
- ds->info->chan_fixup(ds->data, clone, original);
- }
- }
-
- clone_variables(original, clone);
+ ds->info->chan_fixup(ds->data, clonechan, original);
+ }
+ }
+
+ clone_variables(original, clonechan);
/* Presense of ADSI capable CPE follows clone */
- original->adsicpe = clone->adsicpe;
+ original->adsicpe = clonechan->adsicpe;
/* Bridge remains the same */
/* CDR fields remain the same */
/* XXX What about blocking, softhangup, blocker, and lock and blockproc? XXX */
/* Application and data remain the same */
/* Clone exception becomes real one, as with fdno */
- ast_copy_flags(original, clone, AST_FLAG_EXCEPTION);
- original->fdno = clone->fdno;
+ ast_copy_flags(original, clonechan, AST_FLAG_EXCEPTION);
+ original->fdno = clonechan->fdno;
/* Schedule context remains the same */
/* Stream stuff stays the same */
/* Keep the original state. The fixup code will need to work with it most likely */
@@ -3925,14 +3925,14 @@
/* Just swap the whole structures, nevermind the allocations, they'll work themselves
out. */
tmpcid = original->cid;
- original->cid = clone->cid;
- clone->cid = tmpcid;
+ original->cid = clonechan->cid;
+ clonechan->cid = tmpcid;
/* Restore original timing file descriptor */
ast_channel_set_fd(original, AST_TIMING_FD, original->timingfd);
/* Our native formats are different now */
- original->nativeformats = clone->nativeformats;
+ original->nativeformats = clonechan->nativeformats;
/* Context, extension, priority, app data, jump table, remain the same */
/* pvt switches. pbx stays the same, as does next */
@@ -3944,18 +3944,18 @@
ast_set_read_format(original, rformat);
/* Copy the music class */
- ast_string_field_set(original, musicclass, clone->musicclass);
+ ast_string_field_set(original, musicclass, clonechan->musicclass);
ast_debug(1, "Putting channel %s in %d/%d formats\n", original->name, wformat, rformat);
/* Okay. Last thing is to let the channel driver know about all this mess, so he
can fix up everything as best as possible */
if (original->tech->fixup) {
- res = original->tech->fixup(clone, original);
+ res = original->tech->fixup(clonechan, original);
if (res) {
ast_log(LOG_WARNING, "Channel for type '%s' could not fixup channel %s\n",
original->tech->type, original->name);
- ast_channel_unlock(clone);
+ ast_channel_unlock(clonechan);
return -1;
}
} else
@@ -3969,25 +3969,25 @@
/* Now, at this point, the "clone" channel is totally F'd up. We mark it as
a zombie so nothing tries to touch it. If it's already been marked as a
zombie, then free it now (since it already is considered invalid). */
- if (ast_test_flag(clone, AST_FLAG_ZOMBIE)) {
- ast_debug(1, "Destroying channel clone '%s'\n", clone->name);
- ast_channel_unlock(clone);
+ if (ast_test_flag(clonechan, AST_FLAG_ZOMBIE)) {
+ ast_debug(1, "Destroying channel clone '%s'\n", clonechan->name);
+ ast_channel_unlock(clonechan);
manager_event(EVENT_FLAG_CALL, "Hangup",
"Channel: %s\r\n"
"Uniqueid: %s\r\n"
"Cause: %d\r\n"
"Cause-txt: %s\r\n",
- clone->name,
- clone->uniqueid,
- clone->hangupcause,
- ast_cause2str(clone->hangupcause)
+ clonechan->name,
+ clonechan->uniqueid,
+ clonechan->hangupcause,
+ ast_cause2str(clonechan->hangupcause)
);
- ast_channel_free(clone);
+ ast_channel_free(clonechan);
} else {
- ast_debug(1, "Released clone lock on '%s'\n", clone->name);
- ast_set_flag(clone, AST_FLAG_ZOMBIE);
- ast_queue_frame(clone, &ast_null_frame);
- ast_channel_unlock(clone);
+ ast_debug(1, "Released clone lock on '%s'\n", clonechan->name);
+ ast_set_flag(clonechan, AST_FLAG_ZOMBIE);
+ ast_queue_frame(clonechan, &ast_null_frame);
+ ast_channel_unlock(clonechan);
}
/* Signal any blocker */
Modified: team/seanbright/resolve-shadow-warnings/main/cli.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/main/cli.c?view=diff&rev=114313&r1=114312&r2=114313
==============================================================================
--- team/seanbright/resolve-shadow-warnings/main/cli.c (original)
+++ team/seanbright/resolve-shadow-warnings/main/cli.c Sat Apr 19 18:50:40 2008
@@ -1625,7 +1625,7 @@
static char *parse_args(const char *s, int *argc, char *argv[], int max, int *trailingwhitespace)
{
- char *dup, *cur;
+ char *duplicate, *cur;
int x = 0;
int quoted = 0;
int escaped = 0;
@@ -1638,10 +1638,10 @@
if (s == NULL) /* invalid, though! */
return NULL;
/* make a copy to store the parsed string */
- if (!(dup = ast_strdup(s)))
- return NULL;
-
- cur = dup;
+ if (!(duplicate = ast_strdup(s)))
+ return NULL;
+
+ cur = duplicate;
/* scan the original string copying into cur when needed */
for (; *s ; s++) {
if (x >= max - 1) {
@@ -1685,7 +1685,7 @@
argv[x] = NULL;
*argc = x;
*trailingwhitespace = whitespace;
- return dup;
+ return duplicate;
}
/*! \brief Return the number of unique matches for the generator */
@@ -1777,9 +1777,9 @@
char matchstr[80] = "";
int tws = 0;
/* Split the argument into an array of words */
- char *dup = parse_args(text, &x, argv, sizeof(argv) / sizeof(argv[0]), &tws);
-
- if (!dup) /* malloc error */
+ char *duplicate = parse_args(text, &x, argv, sizeof(argv) / sizeof(argv[0]), &tws);
+
+ if (!duplicate) /* malloc error */
return NULL;
/* Compute the index of the last argument (could be an empty string) */
@@ -1844,7 +1844,7 @@
}
if (lock)
AST_RWLIST_UNLOCK(&helpers);
- ast_free(dup);
+ ast_free(duplicate);
return ret;
}
@@ -1858,12 +1858,12 @@
char *args[AST_MAX_ARGS + 1];
struct ast_cli_entry *e;
int x;
- char *dup = parse_args(s, &x, args + 1, AST_MAX_ARGS, NULL);
+ char *duplicate = parse_args(s, &x, args + 1, AST_MAX_ARGS, NULL);
char *retval = NULL;
struct ast_cli_args a = {
.fd = fd, .argc = x, .argv = args+1 };
- if (dup == NULL)
+ if (duplicate == NULL)
return -1;
if (x < 1) /* We need at least one entry, otherwise ignore */
@@ -1904,7 +1904,7 @@
}
ast_atomic_fetchadd_int(&e->inuse, -1);
done:
- ast_free(dup);
+ ast_free(duplicate);
return 0;
}
Modified: team/seanbright/resolve-shadow-warnings/main/config.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/main/config.c?view=diff&rev=114313&r1=114312&r2=114313
==============================================================================
--- team/seanbright/resolve-shadow-warnings/main/config.c (original)
+++ team/seanbright/resolve-shadow-warnings/main/config.c Sat Apr 19 18:50:40 2008
@@ -1223,17 +1223,17 @@
* incorrectly cause no reload to be necessary. */
char fn2[256];
#ifdef AST_INCLUDE_GLOB
- int glob_ret;
- glob_t globbuf = { .gl_offs = 0 };
- glob_ret = glob(cfinclude->include, MY_GLOB_FLAGS, NULL, &globbuf);
+ int glob_return;
+ glob_t glob_buf = { .gl_offs = 0 };
+ glob_return = glob(cfinclude->include, MY_GLOB_FLAGS, NULL, &glob_buf);
/* On error, we reparse */
- if (glob_ret == GLOB_NOSPACE || glob_ret == GLOB_ABORTED)
+ if (glob_return == GLOB_NOSPACE || glob_return == GLOB_ABORTED)
unchanged = 0;
else {
/* loop over expanded files */
int j;
- for (j = 0; j < globbuf.gl_pathc; j++) {
- ast_copy_string(fn2, globbuf.gl_pathv[j], sizeof(fn2));
+ for (j = 0; j < glob_buf.gl_pathc; j++) {
+ ast_copy_string(fn2, glob_buf.gl_pathv[j], sizeof(fn2));
#else
ast_copy_string(fn2, cfinclude->include);
#endif
@@ -1350,9 +1350,9 @@
}
if (process_buf) {
- char *buf = ast_strip(process_buf);
- if (!ast_strlen_zero(buf)) {
- if (process_text_line(cfg, &cat, buf, lineno, fn, flags, comment_buffer, lline_buffer, suggested_include_file, &last_cat, &last_var, who_asked)) {
+ char *buffer = ast_strip(process_buf);
+ if (!ast_strlen_zero(buffer)) {
+ if (process_text_line(cfg, &cat, buffer, lineno, fn, flags, comment_buffer, lline_buffer, suggested_include_file, &last_cat, &last_var, who_asked)) {
cfg = NULL;
break;
}
Modified: team/seanbright/resolve-shadow-warnings/main/db1-ast/btree/bt_delete.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/main/db1-ast/btree/bt_delete.c?view=diff&rev=114313&r1=114312&r2=114313
==============================================================================
--- team/seanbright/resolve-shadow-warnings/main/db1-ast/btree/bt_delete.c (original)
+++ team/seanbright/resolve-shadow-warnings/main/db1-ast/btree/bt_delete.c Sat Apr 19 18:50:40 2008
@@ -150,7 +150,7 @@
EPG *e;
EPGNO *parent;
PAGE *h;
- indx_t index = 0;
+ indx_t idx = 0;
pgno_t pgno;
recno_t nextpg, prevpg;
int exact, level;
@@ -188,8 +188,8 @@
/* Move to the next index. */
if (parent->index != NEXTINDEX(h) - 1) {
- index = parent->index + 1;
- BT_PUSH(t, h->pgno, index);
+ idx = parent->index + 1;
+ BT_PUSH(t, h->pgno, idx);
break;
}
mpool_put(t->bt_mp, h, 0);
@@ -198,7 +198,7 @@
/* Restore the stack. */
while (level--) {
/* Push the next level down onto the stack. */
- bi = GETBINTERNAL(h, index);
+ bi = GETBINTERNAL(h, idx);
pgno = bi->pgno;
BT_PUSH(t, pgno, 0);
@@ -208,7 +208,7 @@
/* Get the next level down. */
if ((h = mpool_get(t->bt_mp, pgno, 0)) == NULL)
return (1);
- index = 0;
+ idx = 0;
}
mpool_put(t->bt_mp, h, 0);
if ((h = mpool_get(t->bt_mp, nextpg, 0)) == NULL)
@@ -243,8 +243,8 @@
/* Move to the next index. */
if (parent->index != 0) {
- index = parent->index - 1;
- BT_PUSH(t, h->pgno, index);
+ idx = parent->index - 1;
+ BT_PUSH(t, h->pgno, idx);
break;
}
mpool_put(t->bt_mp, h, 0);
@@ -253,7 +253,7 @@
/* Restore the stack. */
while (level--) {
/* Push the next level down onto the stack. */
- bi = GETBINTERNAL(h, index);
+ bi = GETBINTERNAL(h, idx);
pgno = bi->pgno;
/* Lose the currently pinned page. */
@@ -263,8 +263,8 @@
if ((h = mpool_get(t->bt_mp, pgno, 0)) == NULL)
return (1);
[... 3187 lines stripped ...]
More information about the asterisk-commits
mailing list