[asterisk-commits] kpfleming: trunk r152809 - in /trunk: apps/ channels/misdn/ codecs/lpc10/ mai...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Oct 30 11:49:02 CDT 2008


Author: kpfleming
Date: Thu Oct 30 11:49:02 2008
New Revision: 152809

URL: http://svn.digium.com/view/asterisk?view=rev&rev=152809
Log:
fix a few small things found by using sparse

Modified:
    trunk/apps/app_adsiprog.c
    trunk/channels/misdn/isdn_lib.c
    trunk/channels/misdn/isdn_lib.h
    trunk/channels/misdn/isdn_lib_intern.h
    trunk/codecs/lpc10/chanwr.c
    trunk/main/asterisk.c
    trunk/main/buildinfo.c
    trunk/main/dial.c
    trunk/main/dnsmgr.c
    trunk/utils/astcanary.c

Modified: trunk/apps/app_adsiprog.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_adsiprog.c?view=diff&rev=152809&r1=152808&r2=152809
==============================================================================
--- trunk/apps/app_adsiprog.c (original)
+++ trunk/apps/app_adsiprog.c Thu Oct 30 11:49:02 2008
@@ -828,7 +828,7 @@
 			ast_log(LOG_WARNING, "'%s' is not a valid state name at line %d of %s\n", tok, lineno, script);
 			return 0;
 		}
-		if ((snums[scnt] = getstatebyname(state, sname, script, lineno, 0) < 0)) {
+		if ((snums[scnt] = getstatebyname(state, sname, script, lineno, 0) == NULL)) {
 			ast_log(LOG_WARNING, "State '%s' not declared at line %d of %s\n", sname, lineno, script);
 			return 0;
 		}

Modified: trunk/channels/misdn/isdn_lib.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/misdn/isdn_lib.c?view=diff&rev=152809&r1=152808&r2=152809
==============================================================================
--- trunk/channels/misdn/isdn_lib.c (original)
+++ trunk/channels/misdn/isdn_lib.c Thu Oct 30 11:49:02 2008
@@ -25,6 +25,14 @@
 #include "isdn_lib_intern.h"
 #include "isdn_lib.h"
 
+enum event_response_e (*cb_event) (enum event_e event, struct misdn_bchannel *bc, void *user_data);
+
+void (*cb_log) (int level, int port, char *tmpl, ...)
+	__attribute__ ((format (printf, 3, 4)));
+
+int (*cb_jb_empty)(struct misdn_bchannel *bc, char *buffer, int len);
+
+
 /* 
  * Define ARRAY_LEN() because I cannot
  * #include "asterisk/utils.h"
@@ -259,8 +267,8 @@
 
 static struct misdn_lib *glob_mgr;
 
-char tone_425_flip[TONE_425_SIZE];
-char tone_silence_flip[TONE_SILENCE_SIZE];
+static char tone_425_flip[TONE_425_SIZE];
+static char tone_silence_flip[TONE_SILENCE_SIZE];
 
 static void misdn_lib_isdn_event_catcher(void *arg);
 static int handle_event_nt(void *dat, void *arg);
@@ -472,7 +480,7 @@
 }
 
 
-void misdn_dump_chanlist()
+void misdn_dump_chanlist(void)
 {
 	struct misdn_stack *stack=get_misdn_stack();
 	for ( ; stack; stack=stack->next) {
@@ -481,7 +489,7 @@
 
 }
 
-int set_chan_in_stack(struct misdn_stack *stack, int channel)
+static int set_chan_in_stack(struct misdn_stack *stack, int channel)
 {
 
 	cb_log(4,stack->port,"set_chan_in_stack: %d\n",channel);
@@ -1838,7 +1846,7 @@
 	return 0 ;
 }
 
-int
+static int
 handle_event_nt(void *dat, void *arg)
 {
 	manager_t *mgr = (manager_t *)dat;
@@ -3079,7 +3087,7 @@
 
 /** App Interface **/
 
-int te_lib_init() {
+int te_lib_init(void) {
 	char buff[1025] = "";
 	iframe_t *frm=(iframe_t*)buff;
 	int midev=mISDN_open();
@@ -3888,7 +3896,7 @@
 
 
 
-sem_t handler_started; 
+static sem_t handler_started; 
 
 /* This is a thread */
 static void manager_event_handler(void *arg)
@@ -4037,7 +4045,6 @@
 	}
 }
 
-
 int misdn_lib_init(char *portlist, struct misdn_lib_iface *iface, void *user_data)
 {
 	struct misdn_lib *mgr=calloc(1, sizeof(struct misdn_lib));
@@ -4560,7 +4567,7 @@
 #endif
 }
 
-struct misdn_stack* get_misdn_stack() {
+struct misdn_stack* get_misdn_stack(void) {
 	return glob_mgr->stack_list;
 }
 

Modified: trunk/channels/misdn/isdn_lib.h
URL: http://svn.digium.com/view/asterisk/trunk/channels/misdn/isdn_lib.h?view=diff&rev=152809&r1=152808&r2=152809
==============================================================================
--- trunk/channels/misdn/isdn_lib.h (original)
+++ trunk/channels/misdn/isdn_lib.h Thu Oct 30 11:49:02 2008
@@ -567,10 +567,12 @@
 };
 
 
-enum event_response_e (*cb_event) (enum event_e event, struct misdn_bchannel *bc, void *user_data);
-void (*cb_log) (int level, int port, char *tmpl, ...)
+extern enum event_response_e (*cb_event) (enum event_e event, struct misdn_bchannel *bc, void *user_data);
+
+extern void (*cb_log) (int level, int port, char *tmpl, ...)
 	__attribute__ ((format (printf, 3, 4)));
-int (*cb_jb_empty)(struct misdn_bchannel *bc, char *buffer, int len);
+
+extern int (*cb_jb_empty)(struct misdn_bchannel *bc, char *buffer, int len);
 
 struct misdn_lib_iface {
 	enum event_response_e (*cb_event)(enum event_e event, struct misdn_bchannel *bc, void *user_data);

Modified: trunk/channels/misdn/isdn_lib_intern.h
URL: http://svn.digium.com/view/asterisk/trunk/channels/misdn/isdn_lib_intern.h?view=diff&rev=152809&r1=152808&r2=152809
==============================================================================
--- trunk/channels/misdn/isdn_lib_intern.h (original)
+++ trunk/channels/misdn/isdn_lib_intern.h Thu Oct 30 11:49:02 2008
@@ -28,8 +28,10 @@
 #endif
 
 
+#if 0
 ibuffer_t *astbuf;		/* Not used */
 ibuffer_t *misdnbuf;	/* Not used */
+#endif
 
 struct send_lock {
 	pthread_mutex_t lock;

Modified: trunk/codecs/lpc10/chanwr.c
URL: http://svn.digium.com/view/asterisk/trunk/codecs/lpc10/chanwr.c?view=diff&rev=152809&r1=152808&r2=152809
==============================================================================
--- trunk/codecs/lpc10/chanwr.c (original)
+++ trunk/codecs/lpc10/chanwr.c Thu Oct 30 11:49:02 2008
@@ -29,6 +29,7 @@
 	-lf2c -lm   (in that order)
 */
 
+#include <stdlib.h>
 #include "f2c.h"
 
 /* *********************************************************************** */
@@ -228,5 +229,5 @@
 /* Subroutine */ int chanrd_(integer *order, integer *ipitv, integer *irms, 
 	integer *irc, integer *ibits)
 {
-    return chanwr_0_(1, order, ipitv, irms, irc, ibits, 0);
-    }
+    return chanwr_0_(1, order, ipitv, irms, irc, ibits, NULL);
+    }

Modified: trunk/main/asterisk.c
URL: http://svn.digium.com/view/asterisk/trunk/main/asterisk.c?view=diff&rev=152809&r1=152808&r2=152809
==============================================================================
--- trunk/main/asterisk.c (original)
+++ trunk/main/asterisk.c Thu Oct 30 11:49:02 2008
@@ -117,6 +117,7 @@
 #include "asterisk/devicestate.h"
 #include "asterisk/module.h"
 #include "asterisk/dsp.h"
+#include "asterisk/buildinfo.h"
 
 #include "asterisk/doxyref.h"		/* Doxygen documentation */
 
@@ -245,13 +246,6 @@
 static char ast_config_AST_CTL_OWNER[PATH_MAX] = "\0";
 static char ast_config_AST_CTL_GROUP[PATH_MAX] = "\0";
 static char ast_config_AST_CTL[PATH_MAX] = "asterisk.ctl";
-
-extern const char *ast_build_hostname;
-extern const char *ast_build_kernel;
-extern const char *ast_build_machine;
-extern const char *ast_build_os;
-extern const char *ast_build_date;
-extern const char *ast_build_user;
 
 static char *_argv[256];
 static int shuttingdown;

Modified: trunk/main/buildinfo.c
URL: http://svn.digium.com/view/asterisk/trunk/main/buildinfo.c?view=diff&rev=152809&r1=152808&r2=152809
==============================================================================
--- trunk/main/buildinfo.c (original)
+++ trunk/main/buildinfo.c Thu Oct 30 11:49:02 2008
@@ -23,6 +23,7 @@
  * \author Kevin P. Fleming <kpfleming at digium.com>
  */
 
+#include "asterisk/buildinfo.h"
 #include "asterisk/build.h"
 
 const char *ast_build_hostname = BUILD_HOSTNAME;

Modified: trunk/main/dial.c
URL: http://svn.digium.com/view/asterisk/trunk/main/dial.c?view=diff&rev=152809&r1=152808&r2=152809
==============================================================================
--- trunk/main/dial.c (original)
+++ trunk/main/dial.c Thu Oct 30 11:49:02 2008
@@ -53,15 +53,15 @@
 
 /*! \brief Dialing channel structure. Contains per-channel dialing options, asterisk channel, and more! */
 struct ast_dial_channel {
-	int num;                               /*!< Unique number for dialed channel */
-	int timeout;                           /*!< Maximum time allowed for attempt */
-	char *tech;                            /*!< Technology being dialed */
-	char *device;                          /*!< Device being dialed */
-	void *options[AST_DIAL_OPTION_MAX];    /*!< Channel specific options */
-	int cause;                             /*!< Cause code in case of failure */
-	int is_running_app:1;                  /*!< Is this running an application? */
-	struct ast_channel *owner;             /*!< Asterisk channel */
-	AST_LIST_ENTRY(ast_dial_channel) list; /*!< Linked list information */
+	int num;				/*!< Unique number for dialed channel */
+	int timeout;				/*!< Maximum time allowed for attempt */
+	char *tech;				/*!< Technology being dialed */
+	char *device;				/*!< Device being dialed */
+	void *options[AST_DIAL_OPTION_MAX];	/*!< Channel specific options */
+	int cause;				/*!< Cause code in case of failure */
+	unsigned int is_running_app:1;		/*!< Is this running an application? */
+	struct ast_channel *owner;		/*!< Asterisk channel */
+	AST_LIST_ENTRY(ast_dial_channel) list;	/*!< Linked list information */
 };
 
 /*! \brief Typedef for dial option enable */

Modified: trunk/main/dnsmgr.c
URL: http://svn.digium.com/view/asterisk/trunk/main/dnsmgr.c?view=diff&rev=152809&r1=152808&r2=152809
==============================================================================
--- trunk/main/dnsmgr.c (original)
+++ trunk/main/dnsmgr.c Thu Oct 30 11:49:02 2008
@@ -57,7 +57,7 @@
 	/*! SRV record to lookup, if provided. Composed of service, protocol, and domain name: _Service._Proto.Name */
 	char *service;
 	/*! Set to 1 if the entry changes */
-	int changed:1;
+	unsigned int changed:1;
 	ast_mutex_t lock;
 	AST_RWLIST_ENTRY(ast_dnsmgr_entry) list;
 	/*! just 1 here, but we use calloc to allocate the correct size */

Modified: trunk/utils/astcanary.c
URL: http://svn.digium.com/view/asterisk/trunk/utils/astcanary.c?view=diff&rev=152809&r1=152808&r2=152809
==============================================================================
--- trunk/utils/astcanary.c (original)
+++ trunk/utils/astcanary.c Thu Oct 30 11:49:02 2008
@@ -59,7 +59,7 @@
  * Asterisk itself.
  */
 
-const char explanation[] =
+static const char explanation[] =
 "This file is created when Asterisk is run with a realtime priority (-p).  It\n"
 "must continue to exist, and the astcanary process must be allowed to continue\n"
 "running, or else the Asterisk process will, within a short period of time,\n"




More information about the asterisk-commits mailing list