[Home]

Summary:ASTERISK-05907: [patch] canonicize ast_walk*() loops
Reporter:Luigi Rizzo (rizzo)Labels:
Date Opened:2005-12-26 12:19:24.000-0600Date Closed:2008-01-15 16:09:18.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) walk.diff
Description:the canonical form for loops using ast_walk_*() is one of the following:

 struct foo *p = NULL;

 p = NULL; /* can be merged with the definition, if nearby */
 while ((p = ast_walk_foo(p)) {
    ...
 }

or

 for (p = NULL; (p = ast_walk_foo(p)); ) {
     ...
 }

Following the recent commit that normalizes some while loops,
the attached patch normalizes this code in pbx.c.
On passing, it simplifies some loops, and replaces some if/then/else
with conditional expressions.
removes some duplications on loop exits
Comments:By: Russell Bryant (russell) 2005-12-26 14:39:20.000-0600

merged into the trunk, thanks!

By: Digium Subversion (svnbot) 2008-01-15 16:09:05.000-0600

Repository: asterisk
Revision: 7639

U   trunk/pbx.c

------------------------------------------------------------------------
r7639 | russell | 2008-01-15 16:09:04 -0600 (Tue, 15 Jan 2008) | 5 lines

- normalize some loops
- simplify and reduce code by keeping track of return value
- replace some simple if/then sections with conditional expressions
(issue ASTERISK-5907)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=7639

By: Digium Subversion (svnbot) 2008-01-15 16:09:18.000-0600

Repository: asterisk
Revision: 7653

_U  team/russell/ast_malloc/
U   team/russell/ast_malloc/Makefile
U   team/russell/ast_malloc/UPGRADE.txt
U   team/russell/ast_malloc/apps/app_chanspy.c
U   team/russell/ast_malloc/apps/app_externalivr.c
U   team/russell/ast_malloc/apps/app_queue.c
U   team/russell/ast_malloc/apps/app_sms.c
U   team/russell/ast_malloc/apps/app_voicemail.c
U   team/russell/ast_malloc/asterisk.c
U   team/russell/ast_malloc/cdr/cdr_tds.c
U   team/russell/ast_malloc/channels/chan_agent.c
U   team/russell/ast_malloc/channels/chan_iax2.c
U   team/russell/ast_malloc/channels/chan_sip.c
U   team/russell/ast_malloc/channels/chan_zap.c
U   team/russell/ast_malloc/cli.c
U   team/russell/ast_malloc/config.c
U   team/russell/ast_malloc/configs/extconfig.conf.sample
U   team/russell/ast_malloc/configs/func_odbc.conf.sample
U   team/russell/ast_malloc/configs/zapata.conf.sample
U   team/russell/ast_malloc/funcs/func_odbc.c
U   team/russell/ast_malloc/funcs/func_strings.c
U   team/russell/ast_malloc/include/asterisk/logger.h
U   team/russell/ast_malloc/logger.c
U   team/russell/ast_malloc/pbx/pbx_dundi.c
U   team/russell/ast_malloc/pbx.c
U   team/russell/ast_malloc/res/res_monitor.c

------------------------------------------------------------------------
r7653 | russell | 2008-01-15 16:09:17 -0600 (Tue, 15 Jan 2008) | 78 lines

Merged revisions 7633,7635-7636,7638-7640,7642-7643,7646-7649 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r7633 | tilghman | 2005-12-26 11:48:12 -0500 (Mon, 26 Dec 2005) | 2 lines

Bug 6057 - Deprecate builtins that have been replaced by functions

................
r7635 | russell | 2005-12-26 13:35:28 -0500 (Mon, 26 Dec 2005) | 10 lines

Merged revisions 7634 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r7634 | russell | 2005-12-26 13:19:12 -0500 (Mon, 26 Dec 2005) | 2 lines

cast time_t to an int in printf/scanf (issue ASTERISK-5487)

........

................
r7636 | jdixon | 2005-12-26 15:01:35 -0500 (Mon, 26 Dec 2005) | 3 lines

Added support for Feature Group C CAMA trunks (both DP and MF), and support
for Feature Group D Tamdem trunks inbound (outbound was already there)

................
r7638 | tilghman | 2005-12-26 15:34:46 -0500 (Mon, 26 Dec 2005) | 3 lines

Merged revisions 7637 via svnmerge from
/branches/1.2

................
r7639 | russell | 2005-12-26 16:38:50 -0500 (Mon, 26 Dec 2005) | 5 lines

- normalize some loops
- simplify and reduce code by keeping track of return value
- replace some simple if/then sections with conditional expressions
(issue ASTERISK-5907)

................
r7640 | markster | 2005-12-26 18:56:44 -0500 (Mon, 26 Dec 2005) | 2 lines

Don't do DTMF detect on pseudo's!

................
r7642 | tilghman | 2005-12-26 21:02:23 -0500 (Mon, 26 Dec 2005) | 2 lines

Add SQL_ESC to allow single ticks to be escaped

................
r7643 | tilghman | 2005-12-26 21:05:56 -0500 (Mon, 26 Dec 2005) | 2 lines

Reduce warnings on signedness conversions

................
r7646 | tilghman | 2005-12-27 01:24:28 -0500 (Tue, 27 Dec 2005) | 2 lines

Bug 5183 - Inline stack backtraces

................
r7647 | tilghman | 2005-12-27 01:42:29 -0500 (Tue, 27 Dec 2005) | 2 lines

Bug 5854 - Allow quotation of the second field in extconfig, for the purpose of including commas (for LDAP configuration)

................
r7648 | tilghman | 2005-12-27 01:50:25 -0500 (Tue, 27 Dec 2005) | 2 lines

Bug 5906 - ARRAY dialplan function

................
r7649 | tilghman | 2005-12-27 02:13:37 -0500 (Tue, 27 Dec 2005) | 2 lines

Bug 5382 - Allow VM_CATEGORY in voicemail emails

................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=7653