Fixed several compiler warnings
This commit is contained in:
parent
825ad6f887
commit
42b2772d78
|
@ -174,7 +174,6 @@ fail:
|
||||||
#ifdef WITH_MISDN
|
#ifdef WITH_MISDN
|
||||||
struct mISDNport *mISDNport;
|
struct mISDNport *mISDNport;
|
||||||
int channel = 0;
|
int channel = 0;
|
||||||
int earlyb;
|
|
||||||
int mode = B_MODE_TRANSPARENT;
|
int mode = B_MODE_TRANSPARENT;
|
||||||
|
|
||||||
/* hunt for mISDNport and create Port */
|
/* hunt for mISDNport and create Port */
|
||||||
|
@ -193,7 +192,6 @@ fail:
|
||||||
port = ss5_hunt_line(mISDNport);
|
port = ss5_hunt_line(mISDNport);
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
earlyb = mISDNport->earlyb;
|
|
||||||
#ifdef ISDN_P_FXS_POTS
|
#ifdef ISDN_P_FXS_POTS
|
||||||
if (mISDNport->pots)
|
if (mISDNport->pots)
|
||||||
port = new Pfxs(PORT_TYPE_POTS_FXS_OUT, mISDNport, portname, &port_settings, mISDNport->ifport->interface, mode);
|
port = new Pfxs(PORT_TYPE_POTS_FXS_OUT, mISDNport, portname, &port_settings, mISDNport->ifport->interface, mode);
|
||||||
|
|
|
@ -3391,10 +3391,8 @@ void EndpointAppPBX::pick_join(char *extensions)
|
||||||
class Join *join;
|
class Join *join;
|
||||||
class JoinPBX *joinpbx;
|
class JoinPBX *joinpbx;
|
||||||
struct join_relation *relation;
|
struct join_relation *relation;
|
||||||
int vbox;
|
|
||||||
|
|
||||||
/* find an endpoint that is ringing internally or vbox with higher priority */
|
/* find an endpoint that is ringing internally or vbox with higher priority */
|
||||||
vbox = 0;
|
|
||||||
found = NULL;
|
found = NULL;
|
||||||
eapp = apppbx_first;
|
eapp = apppbx_first;
|
||||||
while(eapp) {
|
while(eapp) {
|
||||||
|
@ -3405,7 +3403,6 @@ void EndpointAppPBX::pick_join(char *extensions)
|
||||||
if (port->p_type == PORT_TYPE_VBOX_OUT) {
|
if (port->p_type == PORT_TYPE_VBOX_OUT) {
|
||||||
if (match_list(extensions, eapp->e_ext.number)) {
|
if (match_list(extensions, eapp->e_ext.number)) {
|
||||||
found = eapp;
|
found = eapp;
|
||||||
vbox = 1;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1722,7 +1722,7 @@ void EndpointAppPBX::encrypt_shared(void)
|
||||||
struct lcr_msg *message;
|
struct lcr_msg *message;
|
||||||
const char *errstr = "";
|
const char *errstr = "";
|
||||||
class Port *port;
|
class Port *port;
|
||||||
int type, key_len;
|
int key_len;
|
||||||
unsigned char *key;
|
unsigned char *key;
|
||||||
char *auth_pointer, *crypt_pointer, *key_pointer;
|
char *auth_pointer, *crypt_pointer, *key_pointer;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -1779,7 +1779,7 @@ void EndpointAppPBX::encrypt_shared(void)
|
||||||
goto reject;
|
goto reject;
|
||||||
}
|
}
|
||||||
if (!strcasecmp(crypt_pointer, "blowfish")) {
|
if (!strcasecmp(crypt_pointer, "blowfish")) {
|
||||||
type = CC_ACTBF_REQ;
|
// type = CC_ACTBF_REQ;
|
||||||
if (key_len < 4) {
|
if (key_len < 4) {
|
||||||
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) Key too short.\n", ea_endpoint->ep_serial);
|
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) Key too short.\n", ea_endpoint->ep_serial);
|
||||||
errstr = "Key Too Short";
|
errstr = "Key Too Short";
|
||||||
|
|
4
dss1.cpp
4
dss1.cpp
|
@ -2533,7 +2533,6 @@ void Pdss1::message_connect(unsigned int epoint_id, int message_id, union parame
|
||||||
{
|
{
|
||||||
l3_msg *l3m;
|
l3_msg *l3m;
|
||||||
int type, plan, present, screen;
|
int type, plan, present, screen;
|
||||||
class Endpoint *epoint;
|
|
||||||
time_t current_time;
|
time_t current_time;
|
||||||
|
|
||||||
/* NT-MODE in setup state we must send PROCEEDING first */
|
/* NT-MODE in setup state we must send PROCEEDING first */
|
||||||
|
@ -2628,7 +2627,6 @@ void Pdss1::message_connect(unsigned int epoint_id, int message_id, union parame
|
||||||
// enc_facility_centrex(&connect->FACILITY, dmsg, (unsigned char *)p_connectinfo.name, 0);
|
// enc_facility_centrex(&connect->FACILITY, dmsg, (unsigned char *)p_connectinfo.name, 0);
|
||||||
/* date & time */
|
/* date & time */
|
||||||
if (p_m_d_ntmode || p_m_d_tespecial) {
|
if (p_m_d_ntmode || p_m_d_tespecial) {
|
||||||
epoint = find_epoint_id(epoint_id);
|
|
||||||
time(¤t_time);
|
time(¤t_time);
|
||||||
enc_ie_date(l3m, current_time, p_settings.no_seconds);
|
enc_ie_date(l3m, current_time, p_settings.no_seconds);
|
||||||
}
|
}
|
||||||
|
@ -2716,7 +2714,6 @@ if (/* ||*/ p_state==PORT_STATE_OUT_SETUP) {
|
||||||
void Pdss1::message_release(unsigned int epoint_id, int message_id, union parameter *param)
|
void Pdss1::message_release(unsigned int epoint_id, int message_id, union parameter *param)
|
||||||
{
|
{
|
||||||
l3_msg *l3m;
|
l3_msg *l3m;
|
||||||
class Endpoint *epoint;
|
|
||||||
char *p = NULL;
|
char *p = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -2796,7 +2793,6 @@ wirklich erst proceeding?:
|
||||||
/* send cause */
|
/* send cause */
|
||||||
enc_ie_cause(l3m, (p_m_mISDNport->locally && param->disconnectinfo.location==LOCATION_PRIVATE_LOCAL)?LOCATION_PRIVATE_LOCAL:param->disconnectinfo.location, param->disconnectinfo.cause);
|
enc_ie_cause(l3m, (p_m_mISDNport->locally && param->disconnectinfo.location==LOCATION_PRIVATE_LOCAL)?LOCATION_PRIVATE_LOCAL:param->disconnectinfo.location, param->disconnectinfo.cause);
|
||||||
/* send display */
|
/* send display */
|
||||||
epoint = find_epoint_id(epoint_id);
|
|
||||||
if (param->disconnectinfo.display[0])
|
if (param->disconnectinfo.display[0])
|
||||||
p = param->disconnectinfo.display;
|
p = param->disconnectinfo.display;
|
||||||
if (p) if (*p && (p_m_d_ntmode || p_m_d_tespecial))
|
if (p) if (*p && (p_m_d_ntmode || p_m_d_tespecial))
|
||||||
|
|
2
genrc.c
2
genrc.c
|
@ -39,7 +39,7 @@ int main(void)
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
int i = 0, j, jj, n;
|
int i = 0, j, jj, n;
|
||||||
char input[256], file[256];
|
char input[256], file[256];
|
||||||
int ret;
|
int __attribute__((__unused__)) ret;
|
||||||
|
|
||||||
printf("\n\nThis program generates a script, which is used to start/stop/restart mISDN\n");
|
printf("\n\nThis program generates a script, which is used to start/stop/restart mISDN\n");
|
||||||
printf("driver. Please select card only once. Mode and options are given by LCR.\n");
|
printf("driver. Please select card only once. Mode and options are given by LCR.\n");
|
||||||
|
|
13
mISDN.cpp
13
mISDN.cpp
|
@ -63,7 +63,6 @@ static struct mi_ext_fn_s myfn;
|
||||||
int mISDN_initialize(void)
|
int mISDN_initialize(void)
|
||||||
{
|
{
|
||||||
char filename[256];
|
char filename[256];
|
||||||
int ver;
|
|
||||||
|
|
||||||
/* try to open raw socket to check kernel */
|
/* try to open raw socket to check kernel */
|
||||||
mISDNsocket = socket(PF_ISDN, SOCK_RAW, ISDN_P_BASE);
|
mISDNsocket = socket(PF_ISDN, SOCK_RAW, ISDN_P_BASE);
|
||||||
|
@ -76,7 +75,7 @@ int mISDN_initialize(void)
|
||||||
// set debug printout function
|
// set debug printout function
|
||||||
myfn.prt_debug = my_mISDNlib_debug;
|
myfn.prt_debug = my_mISDNlib_debug;
|
||||||
|
|
||||||
ver = init_layer3(4, &myfn); // buffer of 4
|
init_layer3(4, &myfn); // buffer of 4
|
||||||
|
|
||||||
/* open debug, if enabled and not only stack debugging */
|
/* open debug, if enabled and not only stack debugging */
|
||||||
if (options.deb) {
|
if (options.deb) {
|
||||||
|
@ -604,6 +603,7 @@ void bchannel_event(struct mISDNport *mISDNport, int i, int event)
|
||||||
class PmISDN *b_port = mISDNport->b_port[i];
|
class PmISDN *b_port = mISDNport->b_port[i];
|
||||||
int state = mISDNport->b_state[i];
|
int state = mISDNport->b_state[i];
|
||||||
int timer = -1; // no change
|
int timer = -1; // no change
|
||||||
|
#if 0
|
||||||
int p_m_tx_gain = 0;
|
int p_m_tx_gain = 0;
|
||||||
int p_m_rx_gain = 0;
|
int p_m_rx_gain = 0;
|
||||||
char *p_m_pipeline = NULL;
|
char *p_m_pipeline = NULL;
|
||||||
|
@ -619,6 +619,7 @@ void bchannel_event(struct mISDNport *mISDNport, int i, int event)
|
||||||
p_m_crypt_key_len = b_port->p_m_crypt_key_len;
|
p_m_crypt_key_len = b_port->p_m_crypt_key_len;
|
||||||
p_m_crypt_key_type = /*b_port->p_m_crypt_key_type*/1;
|
p_m_crypt_key_type = /*b_port->p_m_crypt_key_type*/1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
switch(event) {
|
switch(event) {
|
||||||
case B_EVENT_USE:
|
case B_EVENT_USE:
|
||||||
|
@ -1533,7 +1534,7 @@ static int mISDN_upqueue(struct lcr_fd *fd, unsigned int what, void *instance, i
|
||||||
struct mbuffer *mb;
|
struct mbuffer *mb;
|
||||||
struct l3_msg *l3m;
|
struct l3_msg *l3m;
|
||||||
char byte;
|
char byte;
|
||||||
int ret;
|
int __attribute__((__unused__)) ret;
|
||||||
|
|
||||||
/* unset global semaphore */
|
/* unset global semaphore */
|
||||||
upqueue_avail = 0;
|
upqueue_avail = 0;
|
||||||
|
@ -1769,7 +1770,7 @@ int do_layer3(struct mlayer3 *ml3, unsigned int cmd, unsigned int pid, struct l3
|
||||||
// this is no problem.
|
// this is no problem.
|
||||||
upqueue_avail = 1;
|
upqueue_avail = 1;
|
||||||
char byte = 0;
|
char byte = 0;
|
||||||
int ret;
|
int __attribute__((__unused__)) ret;
|
||||||
ret = write(upqueue_pipe[1], &byte, 1);
|
ret = write(upqueue_pipe[1], &byte, 1);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1796,6 +1797,7 @@ int mISDN_getportbyname(int sock, int cnt, char *portname)
|
||||||
return (port);
|
return (port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ISDN_P_FXS_POTS
|
||||||
/* handle frames from pots */
|
/* handle frames from pots */
|
||||||
static int pots_sock_callback(struct lcr_fd *fd, unsigned int what, void *instance, int i)
|
static int pots_sock_callback(struct lcr_fd *fd, unsigned int what, void *instance, int i)
|
||||||
{
|
{
|
||||||
|
@ -1818,12 +1820,10 @@ static int pots_sock_callback(struct lcr_fd *fd, unsigned int what, void *instan
|
||||||
case PH_CONTROL_IND:
|
case PH_CONTROL_IND:
|
||||||
cont = *((unsigned int *)(buffer + MISDN_HEADER_LEN));
|
cont = *((unsigned int *)(buffer + MISDN_HEADER_LEN));
|
||||||
/* l1-control is sent to LCR */
|
/* l1-control is sent to LCR */
|
||||||
#ifdef ISDN_P_FXS_POTS
|
|
||||||
if (mISDNport->ntmode)
|
if (mISDNport->ntmode)
|
||||||
stack2manager_fxs(mISDNport, cont);
|
stack2manager_fxs(mISDNport, cont);
|
||||||
else
|
else
|
||||||
PERROR("FXO not supported!\n");
|
PERROR("FXO not supported!\n");
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
case PH_ACTIVATE_REQ:
|
case PH_ACTIVATE_REQ:
|
||||||
break;
|
break;
|
||||||
|
@ -1834,6 +1834,7 @@ static int pots_sock_callback(struct lcr_fd *fd, unsigned int what, void *instan
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* global function to add a new card (port)
|
* global function to add a new card (port)
|
||||||
|
|
2
main.c
2
main.c
|
@ -257,7 +257,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
/* query available isdn ports */
|
/* query available isdn ports */
|
||||||
if (!(strcasecmp(argv[1],"query"))) {
|
if (!(strcasecmp(argv[1],"query"))) {
|
||||||
int rc;
|
int __attribute__((__unused__)) rc;
|
||||||
fprintf(stderr, "-> Using 'misdn_info'\n");
|
fprintf(stderr, "-> Using 'misdn_info'\n");
|
||||||
rc = system("misdn_info");
|
rc = system("misdn_info");
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
6
port.cpp
6
port.cpp
|
@ -666,7 +666,7 @@ int Port::open_record(int type, int vbox, int skip, char *extension, int anon_ig
|
||||||
char filename[256];
|
char filename[256];
|
||||||
time_t now;
|
time_t now;
|
||||||
struct tm *now_tm;
|
struct tm *now_tm;
|
||||||
int ret;
|
int __attribute__((__unused__)) ret;
|
||||||
|
|
||||||
if (!extension) {
|
if (!extension) {
|
||||||
PERROR("Port(%d) not an extension\n", p_serial);
|
PERROR("Port(%d) not an extension\n", p_serial);
|
||||||
|
@ -759,7 +759,7 @@ void Port::close_record(int beep, int mute)
|
||||||
char *p;
|
char *p;
|
||||||
struct caller_info callerinfo;
|
struct caller_info callerinfo;
|
||||||
const char *valid_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_.-!$%&/()=+*;~";
|
const char *valid_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_.-!$%&/()=+*;~";
|
||||||
int ret;
|
int __attribute__((__unused__)) ret;
|
||||||
|
|
||||||
if (!p_record)
|
if (!p_record)
|
||||||
return;
|
return;
|
||||||
|
@ -960,7 +960,7 @@ void Port::record(unsigned char *data, int length, int dir_fromup)
|
||||||
signed short *s;
|
signed short *s;
|
||||||
int free, i, ii;
|
int free, i, ii;
|
||||||
signed int sample;
|
signed int sample;
|
||||||
int ret;
|
int __attribute__((__unused__)) ret;
|
||||||
|
|
||||||
/* no recording */
|
/* no recording */
|
||||||
if (!p_record || !length)
|
if (!p_record || !length)
|
||||||
|
|
4
route.c
4
route.c
|
@ -1955,8 +1955,7 @@ struct route_action *EndpointAppPBX::route(struct route_ruleset *ruleset)
|
||||||
struct timeval current_time;
|
struct timeval current_time;
|
||||||
#ifdef WITH_MISDN
|
#ifdef WITH_MISDN
|
||||||
struct mISDNport *mISDNport;
|
struct mISDNport *mISDNport;
|
||||||
int avail,
|
int avail;
|
||||||
any;
|
|
||||||
int jj;
|
int jj;
|
||||||
class Port *port;
|
class Port *port;
|
||||||
class Pfxs *ourfxs, *fxs;
|
class Pfxs *ourfxs, *fxs;
|
||||||
|
@ -2250,7 +2249,6 @@ struct route_action *EndpointAppPBX::route(struct route_ruleset *ruleset)
|
||||||
case MATCH_BUSY:
|
case MATCH_BUSY:
|
||||||
case MATCH_IDLE:
|
case MATCH_IDLE:
|
||||||
#ifdef WITH_MISDN
|
#ifdef WITH_MISDN
|
||||||
any = 0;
|
|
||||||
mISDNport = mISDNport_first;
|
mISDNport = mISDNport_first;
|
||||||
while(mISDNport) {
|
while(mISDNport) {
|
||||||
if (mISDNport->ifport)
|
if (mISDNport->ifport)
|
||||||
|
|
|
@ -752,7 +752,6 @@ int admin_state(struct admin_queue **responsep)
|
||||||
class Pdss1 *pdss1;
|
class Pdss1 *pdss1;
|
||||||
struct mISDNport *mISDNport;
|
struct mISDNport *mISDNport;
|
||||||
struct select_channel *selchannel;
|
struct select_channel *selchannel;
|
||||||
int anybusy;
|
|
||||||
#endif
|
#endif
|
||||||
struct interface *interface;
|
struct interface *interface;
|
||||||
struct interface_port *ifport;
|
struct interface_port *ifport;
|
||||||
|
@ -937,7 +936,6 @@ int admin_state(struct admin_queue **responsep)
|
||||||
}
|
}
|
||||||
/* channel state */
|
/* channel state */
|
||||||
i = 0;
|
i = 0;
|
||||||
anybusy = 0;
|
|
||||||
while(i < mISDNport->b_num) {
|
while(i < mISDNport->b_num) {
|
||||||
response->am[num].u.i.busy[i] = mISDNport->b_state[i];
|
response->am[num].u.i.busy[i] = mISDNport->b_state[i];
|
||||||
if (mISDNport->b_port[i])
|
if (mISDNport->b_port[i])
|
||||||
|
|
11
ss5_decode.c
11
ss5_decode.c
|
@ -58,7 +58,10 @@ char ss5_decode(unsigned char *data, int len)
|
||||||
signed long sk, sk1, sk2, low, high;
|
signed long sk, sk1, sk2, low, high;
|
||||||
int k, n, i;
|
int k, n, i;
|
||||||
int f1 = 0, f2 = 0;
|
int f1 = 0, f2 = 0;
|
||||||
double result[NCOEFF], power, noise, snr;
|
double result[NCOEFF], power, noise;
|
||||||
|
#ifdef DEBUG_LEVELS
|
||||||
|
double snr;
|
||||||
|
#endif
|
||||||
signed long long cos2pik_;
|
signed long long cos2pik_;
|
||||||
char digit = ' ';
|
char digit = ' ';
|
||||||
|
|
||||||
|
@ -121,21 +124,27 @@ char ss5_decode(unsigned char *data, int len)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DEBUG_LEVELS
|
||||||
snr = 0;
|
snr = 0;
|
||||||
|
#endif
|
||||||
/* check one frequency */
|
/* check one frequency */
|
||||||
if (result[f1] > TONE_MIN_DB /* must be at least -17 db */
|
if (result[f1] > TONE_MIN_DB /* must be at least -17 db */
|
||||||
&& result[f1]*SNR > noise) { /* */
|
&& result[f1]*SNR > noise) { /* */
|
||||||
digit = decode_one[f1];
|
digit = decode_one[f1];
|
||||||
|
#ifdef DEBUG_LEVELS
|
||||||
if (digit != ' ')
|
if (digit != ' ')
|
||||||
snr = result[f1] / noise;
|
snr = result[f1] / noise;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
/* check two frequencies */
|
/* check two frequencies */
|
||||||
if (result[f1] > TONE_MIN_DB && result[f2] > TONE_MIN_DB /* must be at lease -17 db */
|
if (result[f1] > TONE_MIN_DB && result[f2] > TONE_MIN_DB /* must be at lease -17 db */
|
||||||
&& result[f1]*TONE_DIFF_DB <= result[f2] /* f2 must be not less than 5 db below f1 */
|
&& result[f1]*TONE_DIFF_DB <= result[f2] /* f2 must be not less than 5 db below f1 */
|
||||||
&& (result[f1]+result[f2])*SNR > noise) { /* */
|
&& (result[f1]+result[f2])*SNR > noise) { /* */
|
||||||
digit = decode_two[f1][f2];
|
digit = decode_two[f1][f2];
|
||||||
|
#ifdef DEBUG_LEVELS
|
||||||
if (digit != ' ')
|
if (digit != ' ')
|
||||||
snr = (result[f1]+result[f2]) / noise;
|
snr = (result[f1]+result[f2]) / noise;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* debug powers */
|
/* debug powers */
|
||||||
|
|
|
@ -88,7 +88,7 @@ unsigned char *ss5_encode(unsigned char *buffer, int len, char digit, int sample
|
||||||
}
|
}
|
||||||
if (!ss5_digits[i][0]) {
|
if (!ss5_digits[i][0]) {
|
||||||
PERROR("Digit '%c' does not exist.\n", digit);
|
PERROR("Digit '%c' does not exist.\n", digit);
|
||||||
memset(buffer, audio_s16_to_law[0], sizeof(buffer));
|
memset(buffer, audio_s16_to_law[0], len);
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
tones.c
2
tones.c
|
@ -48,7 +48,7 @@ int open_tone(char *file, int *codec, signed int *length, signed int *left)
|
||||||
int linksize;
|
int linksize;
|
||||||
int l;
|
int l;
|
||||||
char *p;
|
char *p;
|
||||||
int ret;
|
int __attribute__((__unused__)) ret;
|
||||||
|
|
||||||
|
|
||||||
/* try to open the law file */
|
/* try to open the law file */
|
||||||
|
|
2
trace.c
2
trace.c
|
@ -268,7 +268,7 @@ void _end_trace(const char *__file, int __line)
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
struct admin_list *admin;
|
struct admin_list *admin;
|
||||||
struct admin_queue *response, **responsep; /* response pointer */
|
struct admin_queue *response, **responsep; /* response pointer */
|
||||||
int ret;
|
int __attribute__((__unused__)) ret;
|
||||||
|
|
||||||
if (!trace.name[0])
|
if (!trace.name[0])
|
||||||
PERROR("trace not started in file %s line %d\n", __file, __line);
|
PERROR("trace not started in file %s line %d\n", __file, __line);
|
||||||
|
|
Loading…
Reference in New Issue