[asterisk-commits] russell: trunk r199479 - /trunk/apps/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sun Jun 7 09:56:00 CDT 2009
Author: russell
Date: Sun Jun 7 09:55:51 2009
New Revision: 199479
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=199479
Log:
Global var cleanup - constification and removing unused vars.
Modified:
trunk/apps/app_adsiprog.c
trunk/apps/app_alarmreceiver.c
trunk/apps/app_amd.c
trunk/apps/app_authenticate.c
trunk/apps/app_chanisavail.c
trunk/apps/app_channelredirect.c
trunk/apps/app_chanspy.c
trunk/apps/app_confbridge.c
trunk/apps/app_controlplayback.c
trunk/apps/app_dahdibarge.c
trunk/apps/app_dahdiras.c
trunk/apps/app_db.c
trunk/apps/app_dial.c
trunk/apps/app_dictate.c
trunk/apps/app_directed_pickup.c
trunk/apps/app_directory.c
trunk/apps/app_disa.c
trunk/apps/app_dumpchan.c
trunk/apps/app_echo.c
trunk/apps/app_exec.c
trunk/apps/app_fax.c
Modified: trunk/apps/app_adsiprog.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_adsiprog.c?view=diff&rev=199479&r1=199478&r2=199479
==============================================================================
--- trunk/apps/app_adsiprog.c (original)
+++ trunk/apps/app_adsiprog.c Sun Jun 7 09:55:51 2009
@@ -45,7 +45,7 @@
#include "asterisk/utils.h"
#include "asterisk/lock.h"
-static char *app = "ADSIProg";
+static const char app[] = "ADSIProg";
/*** DOCUMENTATION
<application name="ADSIProg" language="en_US">
@@ -71,7 +71,7 @@
struct adsi_event {
int id;
- char *name;
+ const char *name;
};
static const struct adsi_event events[] = {
Modified: trunk/apps/app_alarmreceiver.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_alarmreceiver.c?view=diff&rev=199479&r1=199478&r2=199479
==============================================================================
--- trunk/apps/app_alarmreceiver.c (original)
+++ trunk/apps/app_alarmreceiver.c Sun Jun 7 09:55:51 2009
@@ -62,7 +62,7 @@
typedef struct event_node event_node_t;
-static char *app = "AlarmReceiver";
+static const char app[] = "AlarmReceiver";
/*** DOCUMENTATION
<application name="AlarmReceiver" language="en_US">
<synopsis>
Modified: trunk/apps/app_amd.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_amd.c?view=diff&rev=199479&r1=199478&r2=199479
==============================================================================
--- trunk/apps/app_amd.c (original)
+++ trunk/apps/app_amd.c Sun Jun 7 09:55:51 2009
@@ -124,7 +124,7 @@
***/
-static char *app = "AMD";
+static const char app[] = "AMD";
#define STATE_IN_WORD 1
#define STATE_IN_SILENCE 2
Modified: trunk/apps/app_authenticate.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_authenticate.c?view=diff&rev=199479&r1=199478&r2=199479
==============================================================================
--- trunk/apps/app_authenticate.c (original)
+++ trunk/apps/app_authenticate.c Sun Jun 7 09:55:51 2009
@@ -43,7 +43,7 @@
OPT_DATABASE = (1 << 1),
OPT_MULTIPLE = (1 << 3),
OPT_REMOVE = (1 << 4),
-} auth_option_flags;
+};
AST_APP_OPTIONS(auth_app_options, {
AST_APP_OPTION('a', OPT_ACCOUNT),
@@ -53,7 +53,7 @@
});
-static char *app = "Authenticate";
+static const char app[] = "Authenticate";
/*** DOCUMENTATION
<application name="Authenticate" language="en_US">
<synopsis>
Modified: trunk/apps/app_chanisavail.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_chanisavail.c?view=diff&rev=199479&r1=199478&r2=199479
==============================================================================
--- trunk/apps/app_chanisavail.c (original)
+++ trunk/apps/app_chanisavail.c Sun Jun 7 09:55:51 2009
@@ -41,7 +41,7 @@
#include "asterisk/app.h"
#include "asterisk/devicestate.h"
-static char *app = "ChanIsAvail";
+static const char app[] = "ChanIsAvail";
/*** DOCUMENTATION
<application name="ChanIsAvail" language="en_US">
Modified: trunk/apps/app_channelredirect.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_channelredirect.c?view=diff&rev=199479&r1=199478&r2=199479
==============================================================================
--- trunk/apps/app_channelredirect.c (original)
+++ trunk/apps/app_channelredirect.c Sun Jun 7 09:55:51 2009
@@ -60,7 +60,7 @@
</description>
</application>
***/
-static char *app = "ChannelRedirect";
+static const char app[] = "ChannelRedirect";
static int asyncgoto_exec(struct ast_channel *chan, const char *data)
{
Modified: trunk/apps/app_chanspy.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_chanspy.c?view=diff&rev=199479&r1=199478&r2=199479
==============================================================================
--- trunk/apps/app_chanspy.c (original)
+++ trunk/apps/app_chanspy.c Sun Jun 7 09:55:51 2009
@@ -325,11 +325,11 @@
</application>
***/
-static const char * const app_chan = "ChanSpy";
-
-static const char * const app_ext = "ExtenSpy";
-
-static const char * const app_dahdiscan = "DAHDIScan";
+static const char app_chan[] = "ChanSpy";
+
+static const char app_ext[] = "ExtenSpy";
+
+static const char app_dahdiscan[] = "DAHDIScan";
enum {
OPTION_QUIET = (1 << 0), /* Quiet, no announcement */
@@ -349,7 +349,7 @@
OPTION_DTMF_EXIT = (1 << 14), /* Set DTMF to exit, added for DAHDIScan integration */
OPTION_DTMF_CYCLE = (1 << 15), /* Custom DTMF for cycling next avaliable channel, (default is '*') */
OPTION_DAHDI_SCAN = (1 << 16), /* Scan groups in DAHDIScan mode */
-} chanspy_opt_flags;
+};
enum {
OPT_ARG_VOLUME = 0,
@@ -360,7 +360,7 @@
OPT_ARG_EXIT,
OPT_ARG_CYCLE,
OPT_ARG_ARRAY_SIZE,
-} chanspy_opt_args;
+};
AST_APP_OPTIONS(spy_opts, {
AST_APP_OPTION('q', OPTION_QUIET),
Modified: trunk/apps/app_confbridge.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_confbridge.c?view=diff&rev=199479&r1=199478&r2=199479
==============================================================================
--- trunk/apps/app_confbridge.c (original)
+++ trunk/apps/app_confbridge.c Sun Jun 7 09:55:51 2009
@@ -111,7 +111,7 @@
* bridge lock if it is important.
*/
-static const char * const app = "ConfBridge";
+static const char app[] = "ConfBridge";
enum {
OPTION_ADMIN = (1 << 0), /*!< Set if the caller is an administrator */
Modified: trunk/apps/app_controlplayback.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_controlplayback.c?view=diff&rev=199479&r1=199478&r2=199479
==============================================================================
--- trunk/apps/app_controlplayback.c (original)
+++ trunk/apps/app_controlplayback.c Sun Jun 7 09:55:51 2009
@@ -92,7 +92,7 @@
</description>
</application>
***/
-static const char * const app = "ControlPlayback";
+static const char app[] = "ControlPlayback";
enum {
OPT_OFFSET = (1 << 1),
Modified: trunk/apps/app_dahdibarge.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_dahdibarge.c?view=diff&rev=199479&r1=199478&r2=199479
==============================================================================
--- trunk/apps/app_dahdibarge.c (original)
+++ trunk/apps/app_dahdibarge.c Sun Jun 7 09:55:51 2009
@@ -70,7 +70,7 @@
</description>
</application>
***/
-static char *app = "DAHDIBarge";
+static const char app[] = "DAHDIBarge";
#define CONF_SIZE 160
Modified: trunk/apps/app_dahdiras.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_dahdiras.c?view=diff&rev=199479&r1=199478&r2=199479
==============================================================================
--- trunk/apps/app_dahdiras.c (original)
+++ trunk/apps/app_dahdiras.c Sun Jun 7 09:55:51 2009
@@ -73,7 +73,7 @@
***/
-static char *app = "DAHDIRAS";
+static const char app[] = "DAHDIRAS";
#define PPP_MAX_ARGS 32
#define PPP_EXEC "/usr/sbin/pppd"
Modified: trunk/apps/app_db.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_db.c?view=diff&rev=199479&r1=199478&r2=199479
==============================================================================
--- trunk/apps/app_db.c (original)
+++ trunk/apps/app_db.c Sun Jun 7 09:55:51 2009
@@ -79,9 +79,8 @@
</application>
***/
-/*! \todo XXX Remove this application after 1.4 is relased */
-static char *d_app = "DBdel";
-static char *dt_app = "DBdeltree";
+static const char d_app[] = "DBdel";
+static const char dt_app[] = "DBdeltree";
static int deltree_exec(struct ast_channel *chan, const char *data)
{
Modified: trunk/apps/app_dial.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_dial.c?view=diff&rev=199479&r1=199478&r2=199479
==============================================================================
--- trunk/apps/app_dial.c (original)
+++ trunk/apps/app_dial.c Sun Jun 7 09:55:51 2009
@@ -465,8 +465,8 @@
</application>
***/
-static char *app = "Dial";
-static char *rapp = "RetryDial";
+static const char app[] = "Dial";
+static const char rapp[] = "RetryDial";
enum {
OPT_ANNOUNCE = (1 << 0),
Modified: trunk/apps/app_dictate.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_dictate.c?view=diff&rev=199479&r1=199478&r2=199479
==============================================================================
--- trunk/apps/app_dictate.c (original)
+++ trunk/apps/app_dictate.c Sun Jun 7 09:55:51 2009
@@ -55,7 +55,7 @@
</application>
***/
-static char *app = "Dictate";
+static const char app[] = "Dictate";
typedef enum {
DFLAG_RECORD = (1 << 0),
Modified: trunk/apps/app_directed_pickup.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_directed_pickup.c?view=diff&rev=199479&r1=199478&r2=199479
==============================================================================
--- trunk/apps/app_directed_pickup.c (original)
+++ trunk/apps/app_directed_pickup.c Sun Jun 7 09:55:51 2009
@@ -84,8 +84,8 @@
</application>
***/
-static const char * const app = "Pickup";
-static const char * const app2 = "PickupChan";
+static const char app[] = "Pickup";
+static const char app2[] = "PickupChan";
/*! \todo This application should return a result code, like PICKUPRESULT */
/* Perform actual pickup between two channels */
Modified: trunk/apps/app_directory.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_directory.c?view=diff&rev=199479&r1=199478&r2=199479
==============================================================================
--- trunk/apps/app_directory.c (original)
+++ trunk/apps/app_directory.c Sun Jun 7 09:55:51 2009
@@ -113,7 +113,7 @@
</application>
***/
-static char *app = "Directory";
+static const char app[] = "Directory";
/* For simplicity, I'm keeping the format compatible with the voicemail config,
but i'm open to suggestions for isolating it */
@@ -128,7 +128,7 @@
OPT_LISTBYLASTNAME = (1 << 4),
OPT_LISTBYEITHER = OPT_LISTBYFIRSTNAME | OPT_LISTBYLASTNAME,
OPT_PAUSE = (1 << 5),
-} directory_option_flags;
+};
enum {
OPT_ARG_FIRSTNAME = 0,
Modified: trunk/apps/app_disa.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_disa.c?view=diff&rev=199479&r1=199478&r2=199479
==============================================================================
--- trunk/apps/app_disa.c (original)
+++ trunk/apps/app_disa.c Sun Jun 7 09:55:51 2009
@@ -110,12 +110,12 @@
</see-also>
</application>
***/
-static char *app = "DISA";
+static const char app[] = "DISA";
enum {
NOANSWER_FLAG = (1 << 0),
POUND_TO_END_FLAG = (1 << 1),
-} option_flags;
+};
AST_APP_OPTIONS(app_opts, {
AST_APP_OPTION('n', NOANSWER_FLAG),
Modified: trunk/apps/app_dumpchan.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_dumpchan.c?view=diff&rev=199479&r1=199478&r2=199479
==============================================================================
--- trunk/apps/app_dumpchan.c (original)
+++ trunk/apps/app_dumpchan.c Sun Jun 7 09:55:51 2009
@@ -60,7 +60,7 @@
</application>
***/
-static char *app = "DumpChan";
+static const char app[] = "DumpChan";
static int serialize_showchan(struct ast_channel *c, char *buf, size_t size)
{
Modified: trunk/apps/app_echo.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_echo.c?view=diff&rev=199479&r1=199478&r2=199479
==============================================================================
--- trunk/apps/app_echo.c (original)
+++ trunk/apps/app_echo.c Sun Jun 7 09:55:51 2009
@@ -46,7 +46,7 @@
</application>
***/
-static char *app = "Echo";
+static const char app[] = "Echo";
static int echo_exec(struct ast_channel *chan, const char *data)
{
Modified: trunk/apps/app_exec.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_exec.c?view=diff&rev=199479&r1=199478&r2=199479
==============================================================================
--- trunk/apps/app_exec.c (original)
+++ trunk/apps/app_exec.c Sun Jun 7 09:55:51 2009
@@ -125,9 +125,9 @@
* affecting the dialplan.
*/
-static char *app_exec = "Exec";
-static char *app_tryexec = "TryExec";
-static char *app_execif = "ExecIf";
+static const char app_exec[] = "Exec";
+static const char app_tryexec[] = "TryExec";
+static const char app_execif[] = "ExecIf";
static int exec_exec(struct ast_channel *chan, const char *data)
{
Modified: trunk/apps/app_fax.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/apps/app_fax.c?view=diff&rev=199479&r1=199478&r2=199479
==============================================================================
--- trunk/apps/app_fax.c (original)
+++ trunk/apps/app_fax.c Sun Jun 7 09:55:51 2009
@@ -141,8 +141,8 @@
***/
-static char *app_sndfax_name = "SendFAX";
-static char *app_rcvfax_name = "ReceiveFAX";
+static const char app_sndfax_name[] = "SendFAX";
+static const char app_rcvfax_name[] = "ReceiveFAX";
#define MAX_SAMPLES 240
More information about the asterisk-commits
mailing list