[asterisk-dev] [Code Review] Const-ify the world (or at least a good part of it)
Kevin Fleming
kpfleming at digium.com
Thu May 21 15:58:07 CDT 2009
> On 2009-05-21 15:34:16, Russell Bryant wrote:
> > /trunk/apps/app_macro.c, lines 453-466
> > <http://reviewboard.digium.com/r/251/diff/2/?file=5311#file5311line453>
> >
> > Hm, but it looks like tmp3 isn't actually declared as const. So, is the cast needed?
Correct; that's a left-over comment from when I had made more const changes (specifically to the return type of ast_str_buffer()). I'll remove the comment before committing.
> On 2009-05-21 15:34:16, Russell Bryant wrote:
> > /trunk/apps/app_osplookup.c, line 1300
> > <http://reviewboard.digium.com/r/251/diff/2/?file=5320#file5320line1300>
> >
> > It looks like the changes in this file didn't get updated for "const char *"
Yep; will fix during commit.
- Kevin
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.digium.com/r/251/#review789
-----------------------------------------------------------
On 2009-05-21 13:42:55, Kevin Fleming wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.digium.com/r/251/
> -----------------------------------------------------------
>
> (Updated 2009-05-21 13:42:55)
>
>
> Review request for Asterisk Developers.
>
>
> Summary
> -------
>
> This patch adds 'const' tags to a number of Asterisk APIs where they are appropriate (where the API already demanded that the function argument not be modified, but the compiler was not informed of that fact). The list includes:
>
> - CLI command handlers
> - CLI command handler arguments
> - AGI command handlers
> - AGI command handler arguments
> - Dialplan application handler arguments
> - Speech engine API function arguments
>
> In addition, various file-scope and function-scope constant arrays got 'const' and/or 'static' qualifiers where they were missing.
>
>
> Diffs
> -----
>
> /trunk/apps/app_adsiprog.c 195989
> /trunk/apps/app_alarmreceiver.c 195989
> /trunk/apps/app_amd.c 195989
> /trunk/apps/app_authenticate.c 195989
> /trunk/apps/app_cdr.c 195989
> /trunk/apps/app_chanisavail.c 195989
> /trunk/apps/app_channelredirect.c 195989
> /trunk/apps/app_chanspy.c 195989
> /trunk/apps/app_confbridge.c 195989
> /trunk/apps/app_controlplayback.c 195989
> /trunk/apps/app_dahdibarge.c 195989
> /trunk/apps/app_dahdiras.c 195989
> /trunk/apps/app_db.c 195989
> /trunk/apps/app_dial.c 195989
> /trunk/apps/app_dictate.c 195989
> /trunk/apps/app_directed_pickup.c 195989
> /trunk/apps/app_directory.c 195989
> /trunk/apps/app_disa.c 195989
> /trunk/apps/app_dumpchan.c 195989
> /trunk/apps/app_echo.c 195989
> /trunk/apps/app_exec.c 195989
> /trunk/apps/app_externalivr.c 195989
> /trunk/apps/app_fax.c 195989
> /trunk/apps/app_festival.c 195989
> /trunk/apps/app_flash.c 195989
> /trunk/apps/app_followme.c 195989
> /trunk/apps/app_forkcdr.c 195989
> /trunk/apps/app_getcpeid.c 195989
> /trunk/apps/app_ices.c 195989
> /trunk/apps/app_image.c 195989
> /trunk/apps/app_ivrdemo.c 195989
> /trunk/apps/app_jack.c 195989
> /trunk/apps/app_macro.c 195989
> /trunk/apps/app_meetme.c 195989
> /trunk/apps/app_milliwatt.c 195989
> /trunk/apps/app_minivm.c 195989
> /trunk/apps/app_mixmonitor.c 195989
> /trunk/apps/app_morsecode.c 195989
> /trunk/apps/app_mp3.c 195989
> /trunk/apps/app_nbscat.c 195989
> /trunk/apps/app_originate.c 195989
> /trunk/apps/app_osplookup.c 195989
> /trunk/apps/app_page.c 195989
> /trunk/apps/app_parkandannounce.c 195989
> /trunk/apps/app_playback.c 195989
> /trunk/apps/app_playtones.c 195989
> /trunk/apps/app_privacy.c 195989
> /trunk/apps/app_queue.c 195989
> /trunk/apps/app_read.c 195989
> /trunk/apps/app_readexten.c 195989
> /trunk/apps/app_readfile.c 195989
> /trunk/apps/app_record.c 195989
> /trunk/apps/app_rpt.c 195989
> /trunk/apps/app_sayunixtime.c 195989
> /trunk/apps/app_senddtmf.c 195989
> /trunk/apps/app_sendtext.c 195989
> /trunk/apps/app_setcallerid.c 195989
> /trunk/apps/app_skel.c 195989
> /trunk/apps/app_sms.c 195989
> /trunk/apps/app_softhangup.c 195989
> /trunk/apps/app_speech_utils.c 195989
> /trunk/apps/app_stack.c 195989
> /trunk/apps/app_system.c 195989
> /trunk/apps/app_talkdetect.c 195989
> /trunk/apps/app_test.c 195989
> /trunk/apps/app_transfer.c 195989
> /trunk/apps/app_url.c 195989
> /trunk/apps/app_userevent.c 195989
> /trunk/apps/app_verbose.c 195989
> /trunk/apps/app_voicemail.c 195989
> /trunk/apps/app_waitforring.c 195989
> /trunk/apps/app_waitforsilence.c 195989
> /trunk/apps/app_waituntil.c 195989
> /trunk/apps/app_while.c 195989
> /trunk/apps/app_zapateller.c 195989
> /trunk/cdr/cdr_adaptive_odbc.c 195989
> /trunk/cdr/cdr_sqlite.c 195989
> /trunk/cdr/cdr_sqlite3_custom.c 195989
> /trunk/channels/chan_agent.c 195989
> /trunk/channels/chan_alsa.c 195989
> /trunk/channels/chan_console.c 195989
> /trunk/channels/chan_dahdi.c 195989
> /trunk/channels/chan_iax2.c 195989
> /trunk/channels/chan_mgcp.c 195989
> /trunk/channels/chan_misdn.c 195989
> /trunk/channels/chan_nbs.c 195989
> /trunk/channels/chan_oss.c 195989
> /trunk/channels/chan_sip.c 195989
> /trunk/channels/chan_skinny.c 195989
> /trunk/channels/chan_unistim.c 195989
> /trunk/channels/console_gui.c 195989
> /trunk/channels/iax2-parser.c 195989
> /trunk/channels/misdn/chan_misdn_config.h 195989
> /trunk/channels/misdn_config.c 195989
> /trunk/channels/vcodecs.c 195989
> /trunk/formats/format_gsm.c 195989
> /trunk/funcs/func_devstate.c 195989
> /trunk/funcs/func_odbc.c 195989
> /trunk/funcs/func_strings.c 195989
> /trunk/include/asterisk/abstract_jb.h 195989
> /trunk/include/asterisk/agi.h 195989
> /trunk/include/asterisk/app.h 195989
> /trunk/include/asterisk/cli.h 195989
> /trunk/include/asterisk/extconf.h 195989
> /trunk/include/asterisk/features.h 195989
> /trunk/include/asterisk/image.h 195989
> /trunk/include/asterisk/module.h 195989
> /trunk/include/asterisk/pbx.h 195989
> /trunk/include/asterisk/speech.h 195989
> /trunk/include/asterisk/strings.h 195989
> /trunk/include/asterisk/taskprocessor.h 195989
> /trunk/include/asterisk/utils.h 195989
> /trunk/main/abstract_jb.c 195989
> /trunk/main/app.c 195989
> /trunk/main/ast_expr2.fl 195989
> /trunk/main/asterisk.c 195989
> /trunk/main/astobj2.c 195989
> /trunk/main/cdr.c 195989
> /trunk/main/channel.c 195989
> /trunk/main/cli.c 195989
> /trunk/main/dsp.c 195989
> /trunk/main/features.c 195989
> /trunk/main/frame.c 195989
> /trunk/main/image.c 195989
> /trunk/main/loader.c 195989
> /trunk/main/manager.c 195989
> /trunk/main/pbx.c 195989
> /trunk/main/taskprocessor.c 195989
> /trunk/main/udptl.c 195989
> /trunk/main/ulaw.c 195989
> /trunk/main/utils.c 195989
> /trunk/pbx/dundi-parser.c 195989
> /trunk/pbx/pbx_ael.c 195989
> /trunk/pbx/pbx_config.c 195989
> /trunk/res/res_agi.c 195989
> /trunk/res/res_clioriginate.c 195989
> /trunk/res/res_jabber.c 195989
> /trunk/res/res_limit.c 195989
> /trunk/res/res_monitor.c 195989
> /trunk/res/res_musiconhold.c 195989
> /trunk/res/res_odbc.c 195989
> /trunk/res/res_rtp_asterisk.c 195989
> /trunk/res/res_speech.c 195989
> /trunk/utils/conf2ael.c 195989
> /trunk/utils/extconf.c 195989
>
> Diff: http://reviewboard.digium.com/r/251/diff
>
>
> Testing
> -------
>
> Compiles and Asterisk starts up with all modules loaded that I can load (which is nearly all of them).
>
>
> Thanks,
>
> Kevin
>
>
More information about the asterisk-dev
mailing list