dect
/
asterisk
Archived
13
0
Fork 0

fix a few small things found by using sparse

git-svn-id: http://svn.digium.com/svn/asterisk/trunk@152809 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
kpfleming 2008-10-30 16:49:02 +00:00
parent 5cb631dcff
commit 5cb4e461fd
10 changed files with 39 additions and 32 deletions

View File

@ -828,7 +828,7 @@ static int onevent(char *buf, char *name, int id, char *args, struct adsi_script
ast_log(LOG_WARNING, "'%s' is not a valid state name at line %d of %s\n", tok, lineno, script); ast_log(LOG_WARNING, "'%s' is not a valid state name at line %d of %s\n", tok, lineno, script);
return 0; 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); ast_log(LOG_WARNING, "State '%s' not declared at line %d of %s\n", sname, lineno, script);
return 0; return 0;
} }

View File

@ -25,6 +25,14 @@
#include "isdn_lib_intern.h" #include "isdn_lib_intern.h"
#include "isdn_lib.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 * Define ARRAY_LEN() because I cannot
* #include "asterisk/utils.h" * #include "asterisk/utils.h"
@ -259,8 +267,8 @@ static int entity;
static struct misdn_lib *glob_mgr; static struct misdn_lib *glob_mgr;
char tone_425_flip[TONE_425_SIZE]; static char tone_425_flip[TONE_425_SIZE];
char tone_silence_flip[TONE_SILENCE_SIZE]; static char tone_silence_flip[TONE_SILENCE_SIZE];
static void misdn_lib_isdn_event_catcher(void *arg); static void misdn_lib_isdn_event_catcher(void *arg);
static int handle_event_nt(void *dat, void *arg); static int handle_event_nt(void *dat, void *arg);
@ -472,7 +480,7 @@ static void dump_chan_list(struct misdn_stack *stack)
} }
void misdn_dump_chanlist() void misdn_dump_chanlist(void)
{ {
struct misdn_stack *stack=get_misdn_stack(); struct misdn_stack *stack=get_misdn_stack();
for ( ; stack; stack=stack->next) { for ( ; stack; stack=stack->next) {
@ -481,7 +489,7 @@ void misdn_dump_chanlist()
} }
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); cb_log(4,stack->port,"set_chan_in_stack: %d\n",channel);
@ -1838,7 +1846,7 @@ int release_cr(struct misdn_stack *stack, mISDNuser_head_t *hh)
return 0 ; return 0 ;
} }
int static int
handle_event_nt(void *dat, void *arg) handle_event_nt(void *dat, void *arg)
{ {
manager_t *mgr = (manager_t *)dat; manager_t *mgr = (manager_t *)dat;
@ -3079,7 +3087,7 @@ static void misdn_lib_isdn_event_catcher(void *arg)
/** App Interface **/ /** App Interface **/
int te_lib_init() { int te_lib_init(void) {
char buff[1025] = ""; char buff[1025] = "";
iframe_t *frm=(iframe_t*)buff; iframe_t *frm=(iframe_t*)buff;
int midev=mISDN_open(); int midev=mISDN_open();
@ -3888,7 +3896,7 @@ int misdn_lib_port_restart(int port)
sem_t handler_started; static sem_t handler_started;
/* This is a thread */ /* This is a thread */
static void manager_event_handler(void *arg) static void manager_event_handler(void *arg)
@ -4037,7 +4045,6 @@ void misdn_lib_nt_debug_init( int flags, char *file )
} }
} }
int misdn_lib_init(char *portlist, struct misdn_lib_iface *iface, void *user_data) int misdn_lib_init(char *portlist, struct misdn_lib_iface *iface, void *user_data)
{ {
struct misdn_lib *mgr=calloc(1, sizeof(struct misdn_lib)); struct misdn_lib *mgr=calloc(1, sizeof(struct misdn_lib));
@ -4560,7 +4567,7 @@ void manager_ec_disable(struct misdn_bchannel *bc)
#endif #endif
} }
struct misdn_stack* get_misdn_stack() { struct misdn_stack* get_misdn_stack(void) {
return glob_mgr->stack_list; return glob_mgr->stack_list;
} }

View File

@ -567,10 +567,12 @@ struct misdn_bchannel {
}; };
enum event_response_e (*cb_event) (enum event_e event, struct misdn_bchannel *bc, void *user_data); extern 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 void (*cb_log) (int level, int port, char *tmpl, ...)
__attribute__ ((format (printf, 3, 4))); __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 { struct misdn_lib_iface {
enum event_response_e (*cb_event)(enum event_e event, struct misdn_bchannel *bc, void *user_data); enum event_response_e (*cb_event)(enum event_e event, struct misdn_bchannel *bc, void *user_data);

View File

@ -28,8 +28,10 @@
#endif #endif
#if 0
ibuffer_t *astbuf; /* Not used */ ibuffer_t *astbuf; /* Not used */
ibuffer_t *misdnbuf; /* Not used */ ibuffer_t *misdnbuf; /* Not used */
#endif
struct send_lock { struct send_lock {
pthread_mutex_t lock; pthread_mutex_t lock;

View File

@ -29,6 +29,7 @@ Some OSS fixes and a few lpc changes to make it actually work
-lf2c -lm (in that order) -lf2c -lm (in that order)
*/ */
#include <stdlib.h>
#include "f2c.h" #include "f2c.h"
/* *********************************************************************** */ /* *********************************************************************** */
@ -228,5 +229,5 @@ L_chanrd:
/* Subroutine */ int chanrd_(integer *order, integer *ipitv, integer *irms, /* Subroutine */ int chanrd_(integer *order, integer *ipitv, integer *irms,
integer *irc, integer *ibits) integer *irc, integer *ibits)
{ {
return chanwr_0_(1, order, ipitv, irms, irc, ibits, 0); return chanwr_0_(1, order, ipitv, irms, irc, ibits, NULL);
} }

View File

@ -117,6 +117,7 @@ int daemon(int, int); /* defined in libresolv of all places */
#include "asterisk/devicestate.h" #include "asterisk/devicestate.h"
#include "asterisk/module.h" #include "asterisk/module.h"
#include "asterisk/dsp.h" #include "asterisk/dsp.h"
#include "asterisk/buildinfo.h"
#include "asterisk/doxyref.h" /* Doxygen documentation */ #include "asterisk/doxyref.h" /* Doxygen documentation */
@ -246,13 +247,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_GROUP[PATH_MAX] = "\0";
static char ast_config_AST_CTL[PATH_MAX] = "asterisk.ctl"; 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 char *_argv[256];
static int shuttingdown; static int shuttingdown;
static int restartnow; static int restartnow;

View File

@ -23,6 +23,7 @@
* \author Kevin P. Fleming <kpfleming@digium.com> * \author Kevin P. Fleming <kpfleming@digium.com>
*/ */
#include "asterisk/buildinfo.h"
#include "asterisk/build.h" #include "asterisk/build.h"
const char *ast_build_hostname = BUILD_HOSTNAME; const char *ast_build_hostname = BUILD_HOSTNAME;

View File

@ -53,15 +53,15 @@ struct ast_dial {
/*! \brief Dialing channel structure. Contains per-channel dialing options, asterisk channel, and more! */ /*! \brief Dialing channel structure. Contains per-channel dialing options, asterisk channel, and more! */
struct ast_dial_channel { struct ast_dial_channel {
int num; /*!< Unique number for dialed channel */ int num; /*!< Unique number for dialed channel */
int timeout; /*!< Maximum time allowed for attempt */ int timeout; /*!< Maximum time allowed for attempt */
char *tech; /*!< Technology being dialed */ char *tech; /*!< Technology being dialed */
char *device; /*!< Device being dialed */ char *device; /*!< Device being dialed */
void *options[AST_DIAL_OPTION_MAX]; /*!< Channel specific options */ void *options[AST_DIAL_OPTION_MAX]; /*!< Channel specific options */
int cause; /*!< Cause code in case of failure */ int cause; /*!< Cause code in case of failure */
int is_running_app:1; /*!< Is this running an application? */ unsigned int is_running_app:1; /*!< Is this running an application? */
struct ast_channel *owner; /*!< Asterisk channel */ struct ast_channel *owner; /*!< Asterisk channel */
AST_LIST_ENTRY(ast_dial_channel) list; /*!< Linked list information */ AST_LIST_ENTRY(ast_dial_channel) list; /*!< Linked list information */
}; };
/*! \brief Typedef for dial option enable */ /*! \brief Typedef for dial option enable */

View File

@ -57,7 +57,7 @@ struct ast_dnsmgr_entry {
/*! SRV record to lookup, if provided. Composed of service, protocol, and domain name: _Service._Proto.Name */ /*! SRV record to lookup, if provided. Composed of service, protocol, and domain name: _Service._Proto.Name */
char *service; char *service;
/*! Set to 1 if the entry changes */ /*! Set to 1 if the entry changes */
int changed:1; unsigned int changed:1;
ast_mutex_t lock; ast_mutex_t lock;
AST_RWLIST_ENTRY(ast_dnsmgr_entry) list; AST_RWLIST_ENTRY(ast_dnsmgr_entry) list;
/*! just 1 here, but we use calloc to allocate the correct size */ /*! just 1 here, but we use calloc to allocate the correct size */

View File

@ -59,7 +59,7 @@
* Asterisk itself. * Asterisk itself.
*/ */
const char explanation[] = static const char explanation[] =
"This file is created when Asterisk is run with a realtime priority (-p). It\n" "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" "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" "running, or else the Asterisk process will, within a short period of time,\n"