Convert a number of global module variables to 'static'.
authorKevin P. Fleming <kpfleming@digium.com>
Mon, 15 Jun 2009 17:06:34 +0000 (17:06 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Mon, 15 Jun 2009 17:06:34 +0000 (17:06 +0000)
These modules all contained variables that are module-global but not system-global,
but were not marked 'static'.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200587 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_agent.c
channels/chan_dahdi.c
channels/chan_h323.c
channels/chan_iax2.c
channels/chan_misdn.c
channels/chan_sip.c
channels/chan_skinny.c

index 826c673..f8205d4 100644 (file)
@@ -2283,7 +2283,7 @@ static int function_agent(struct ast_channel *chan, const char *cmd, char *data,
        return 0;
 }
 
-struct ast_custom_function agent_function = {
+static struct ast_custom_function agent_function = {
        .name = "AGENT",
        .read = function_agent,
 };
index 9dd2b2a..ee62405 100644 (file)
@@ -2440,7 +2440,7 @@ static struct analog_callback dahdi_analog_callbacks =
        .decrease_ss_count = my_decrease_ss_count,
 };
 
-struct dahdi_pvt *round_robin[32];
+static struct dahdi_pvt *round_robin[32];
 
 #if defined(HAVE_PRI)
 static inline int pri_grab(struct dahdi_pvt *pvt, struct dahdi_pri *pri)
index 21ea139..fd32953 100644 (file)
@@ -147,7 +147,7 @@ static unsigned int unique = 0;
 static call_options_t global_options;
 
 /*! \brief Private structure of a OpenH323 channel */
-struct oh323_pvt {
+static struct oh323_pvt {
        ast_mutex_t lock;                       /*!< Channel private lock */
        call_options_t options;                 /*!<!< Options to be used during call setup */
        int alreadygone;                        /*!< Whether or not we've already been destroyed by our peer */
index 4640faa..c90bc5f 100644 (file)
@@ -305,7 +305,7 @@ static struct ast_netsock_list *netsock;
 static struct ast_netsock_list *outsock;               /*!< used if sourceaddress specified and bindaddr == INADDR_ANY */
 static int defaultsockfd = -1;
 
-int (*iax2_regfunk)(const char *username, int onoff) = NULL;
+static int (*iax2_regfunk)(const char *username, int onoff) = NULL;
 
 /* Ethernet, etc */
 #define IAX_CAPABILITY_FULLBANDWIDTH   0xFFFF
@@ -12318,7 +12318,7 @@ static int function_iaxpeer(struct ast_channel *chan, const char *cmd, char *dat
        return 0;
 }
 
-struct ast_custom_function iaxpeer_function = {
+static struct ast_custom_function iaxpeer_function = {
        .name = "IAXPEER",
        .read = function_iaxpeer,
 };
index b9e38c5..db1eb55 100644 (file)
@@ -94,7 +94,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "chan_misdn_config.h"
 #include "isdn_lib.h"
 
-char global_tracefile[BUFFERSIZE + 1];
+static char global_tracefile[BUFFERSIZE + 1];
 
 static int g_config_initialized = 0;
 
@@ -290,7 +290,7 @@ static const char misdn_cc_record_not_found[] = "Call completion record not foun
 #define MISDN_ERROR_MSG                "MISDN_ERROR_MSG"
 #endif /* defined(AST_MISDN_ENHANCEMENTS) */
 
-ast_mutex_t release_lock;
+static ast_mutex_t release_lock;
 
 enum misdn_chan_state {
        MISDN_NOTHING = 0,         /*!< at beginning */
@@ -683,13 +683,11 @@ static int max_ports;
 static int *misdn_in_calls;
 static int *misdn_out_calls;
 
-struct chan_list dummy_cl;
-
 /*!
  * \brief Global channel call record list head.
  */
-struct chan_list *cl_te=NULL;
-ast_mutex_t cl_te_lock;
+static struct chan_list *cl_te=NULL;
+static ast_mutex_t cl_te_lock;
 
 static enum event_response_e
 cb_events(enum event_e event, struct misdn_bchannel *bc, void *user_data);
index 17c446c..100c52c 100644 (file)
@@ -1869,7 +1869,7 @@ struct sip_pvt {
  * the container and individual items, and functions to add/remove
  * references to the individual items.
  */
-struct ao2_container *dialogs;
+static struct ao2_container *dialogs;
 
 #define sip_pvt_lock(x) ao2_lock(x)
 #define sip_pvt_trylock(x) ao2_trylock(x)
@@ -2148,8 +2148,8 @@ static int hash_user_size = 563;
 static AST_LIST_HEAD_STATIC(threadl, sip_threadinfo);
 
 /*! \brief  The peer list: Users, Peers and Friends */
-struct ao2_container *peers;
-struct ao2_container *peers_by_ip;
+static struct ao2_container *peers;
+static struct ao2_container *peers_by_ip;
 
 /*! \brief  The register list: Other SIP proxies we register with and place calls to */
 static struct ast_register_list {
index 0aea73b..7271a2e 100644 (file)
@@ -642,7 +642,7 @@ struct soft_key_template_definition {
 #define SOFTKEY_DND 0x13
 #define SOFTKEY_IDIVERT 0x14
 
-struct soft_key_template_definition soft_key_template_default[] = {
+static struct soft_key_template_definition soft_key_template_default[] = {
        { "\200\001", SOFTKEY_REDIAL },
        { "\200\002", SOFTKEY_NEWCALL },
        { "\200\003", SOFTKEY_HOLD },
@@ -1020,7 +1020,7 @@ struct skinny_req {
 /* XXX This is the combined size of the variables above.  (len, res, e)
    If more are added, this MUST change.
    (sizeof(skinny_req) - sizeof(skinny_data)) DOES NOT WORK on all systems (amd64?). */
-int skinny_header_size = 12;
+static int skinny_header_size = 12;
 
 /*****************************
  * Asterisk specific globals *
@@ -1034,8 +1034,8 @@ static struct sockaddr_in bindaddr;
 static char ourhost[256];
 static int ourport;
 static struct in_addr __ourip;
-struct ast_hostent ahp;
-struct hostent *hp;
+static struct ast_hostent ahp;
+static struct hostent *hp;
 static int skinnysock = -1;
 static pthread_t accept_t;
 static int callnums = 1;
@@ -1255,7 +1255,7 @@ struct skinny_line {
        int newmsgs;
 };
 
-struct skinny_line_options{
+static struct skinny_line_options{
        SKINNY_LINE_OPTIONS
 } default_line_struct = {
        .callwaiting = 1,
@@ -1274,7 +1274,7 @@ struct skinny_line_options{
        .prune = 0,
        .hookstate = SKINNY_ONHOOK,
 };
-struct skinny_line_options *default_line = &default_line_struct;
+static struct skinny_line_options *default_line = &default_line_struct;
 
 static AST_LIST_HEAD_STATIC(lines, skinny_line);
 
@@ -1335,7 +1335,7 @@ struct skinny_device {
        AST_LIST_ENTRY(skinny_device) list;
 };
 
-struct skinny_device_options{
+static struct skinny_device_options {
        SKINNY_DEVICE_OPTIONS
 } default_device_struct = {
        .transfer = 1,
@@ -1347,7 +1347,7 @@ struct skinny_device_options{
        .capability = 0,
        .prune = 0,
 };
-struct skinny_device_options *default_device = &default_device_struct;
+static struct skinny_device_options *default_device = &default_device_struct;
        
 static AST_LIST_HEAD_STATIC(devices, skinny_device);