silence signed/unsigned warnings with upcoming gcc-4 (bug #3915)
git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@204 2fbb986a-6c06-0410-b554-c9c1f0a7f128
This commit is contained in:
parent
02abf57233
commit
241f97782c
5
libpri.h
5
libpri.h
@ -412,7 +412,7 @@ pri_event *pri_check_event(struct pri *pri);
|
|||||||
/* Give a name to a given event ID */
|
/* Give a name to a given event ID */
|
||||||
extern char *pri_event2str(int id);
|
extern char *pri_event2str(int id);
|
||||||
|
|
||||||
/* Give a name toa node type */
|
/* Give a name to a node type */
|
||||||
extern char *pri_node2str(int id);
|
extern char *pri_node2str(int id);
|
||||||
|
|
||||||
/* Give a name to a switch type */
|
/* Give a name to a switch type */
|
||||||
@ -421,9 +421,6 @@ extern char *pri_switch2str(int id);
|
|||||||
/* Print an event */
|
/* Print an event */
|
||||||
extern void pri_dump_event(struct pri *pri, pri_event *e);
|
extern void pri_dump_event(struct pri *pri, pri_event *e);
|
||||||
|
|
||||||
/* Turn an event ID into a string */
|
|
||||||
extern char *pri_event2str(int e);
|
|
||||||
|
|
||||||
/* Turn presentation into a string */
|
/* Turn presentation into a string */
|
||||||
extern char *pri_pres2str(int pres);
|
extern char *pri_pres2str(int pres);
|
||||||
|
|
||||||
|
36
q931.c
36
q931.c
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
struct msgtype {
|
struct msgtype {
|
||||||
int msgnum;
|
int msgnum;
|
||||||
unsigned char *name;
|
char *name;
|
||||||
int mandies[MAX_MAND_IES];
|
int mandies[MAX_MAND_IES];
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -741,7 +741,7 @@ static void q931_get_number(unsigned char *num, int maxlen, unsigned char *src,
|
|||||||
|
|
||||||
static FUNC_DUMP(dump_called_party_number)
|
static FUNC_DUMP(dump_called_party_number)
|
||||||
{
|
{
|
||||||
char cnum[256];
|
unsigned char cnum[256];
|
||||||
|
|
||||||
q931_get_number(cnum, sizeof(cnum), ie->data + 1, len - 3);
|
q931_get_number(cnum, sizeof(cnum), ie->data + 1, len - 3);
|
||||||
pri_message("%c Called Number (len=%2d) [ Ext: %d TON: %s (%d) NPI: %s (%d) '%s' ]\n",
|
pri_message("%c Called Number (len=%2d) [ Ext: %d TON: %s (%d) NPI: %s (%d) '%s' ]\n",
|
||||||
@ -750,7 +750,7 @@ static FUNC_DUMP(dump_called_party_number)
|
|||||||
|
|
||||||
static FUNC_DUMP(dump_called_party_subaddr)
|
static FUNC_DUMP(dump_called_party_subaddr)
|
||||||
{
|
{
|
||||||
char cnum[256];
|
unsigned char cnum[256];
|
||||||
q931_get_number(cnum, sizeof(cnum), ie->data + 1, len - 3);
|
q931_get_number(cnum, sizeof(cnum), ie->data + 1, len - 3);
|
||||||
pri_message("%c Called Sub-Address (len=%2d) [ Ext: %d Type: %s (%d) O: %d '%s' ]\n",
|
pri_message("%c Called Sub-Address (len=%2d) [ Ext: %d Type: %s (%d) O: %d '%s' ]\n",
|
||||||
prefix, len, ie->data[0] >> 7,
|
prefix, len, ie->data[0] >> 7,
|
||||||
@ -760,7 +760,7 @@ static FUNC_DUMP(dump_called_party_subaddr)
|
|||||||
|
|
||||||
static FUNC_DUMP(dump_calling_party_number)
|
static FUNC_DUMP(dump_calling_party_number)
|
||||||
{
|
{
|
||||||
char cnum[256];
|
unsigned char cnum[256];
|
||||||
if (ie->data[0] & 0x80)
|
if (ie->data[0] & 0x80)
|
||||||
q931_get_number(cnum, sizeof(cnum), ie->data + 1, len - 3);
|
q931_get_number(cnum, sizeof(cnum), ie->data + 1, len - 3);
|
||||||
else
|
else
|
||||||
@ -774,7 +774,7 @@ static FUNC_DUMP(dump_calling_party_number)
|
|||||||
|
|
||||||
static FUNC_DUMP(dump_calling_party_subaddr)
|
static FUNC_DUMP(dump_calling_party_subaddr)
|
||||||
{
|
{
|
||||||
char cnum[256];
|
unsigned char cnum[256];
|
||||||
q931_get_number(cnum, sizeof(cnum), ie->data + 2, len - 4);
|
q931_get_number(cnum, sizeof(cnum), ie->data + 2, len - 4);
|
||||||
pri_message("%c Calling Sub-Address (len=%2d) [ Ext: %d Type: %s (%d) O: %d '%s' ]\n",
|
pri_message("%c Calling Sub-Address (len=%2d) [ Ext: %d Type: %s (%d) O: %d '%s' ]\n",
|
||||||
prefix, len, ie->data[0] >> 7,
|
prefix, len, ie->data[0] >> 7,
|
||||||
@ -784,7 +784,7 @@ static FUNC_DUMP(dump_calling_party_subaddr)
|
|||||||
|
|
||||||
static FUNC_DUMP(dump_redirecting_number)
|
static FUNC_DUMP(dump_redirecting_number)
|
||||||
{
|
{
|
||||||
char cnum[256];
|
unsigned char cnum[256];
|
||||||
int i = 0;
|
int i = 0;
|
||||||
/* To follow Q.931 (4.5.1), we must search for start of octet 4 by
|
/* To follow Q.931 (4.5.1), we must search for start of octet 4 by
|
||||||
walking through all bytes until one with ext bit (8) set to 1 */
|
walking through all bytes until one with ext bit (8) set to 1 */
|
||||||
@ -811,7 +811,7 @@ static FUNC_DUMP(dump_redirecting_number)
|
|||||||
|
|
||||||
static FUNC_DUMP(dump_connected_number)
|
static FUNC_DUMP(dump_connected_number)
|
||||||
{
|
{
|
||||||
char cnum[256];
|
unsigned char cnum[256];
|
||||||
int i = 0;
|
int i = 0;
|
||||||
/* To follow Q.931 (4.5.1), we must search for start of octet 4 by
|
/* To follow Q.931 (4.5.1), we must search for start of octet 4 by
|
||||||
walking through all bytes until one with ext bit (8) set to 1 */
|
walking through all bytes until one with ext bit (8) set to 1 */
|
||||||
@ -853,7 +853,7 @@ static FUNC_RECV(receive_redirecting_number)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
while(!(ie->data[i++] & 0x80));
|
while(!(ie->data[i++] & 0x80));
|
||||||
q931_get_number(call->redirectingnum, sizeof(call->redirectingnum), ie->data + i, ie->len - i);
|
q931_get_number((unsigned char *) call->redirectingnum, sizeof(call->redirectingnum), ie->data + i, ie->len - i);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -873,7 +873,7 @@ static FUNC_SEND(transmit_redirecting_number)
|
|||||||
|
|
||||||
static FUNC_DUMP(dump_redirecting_subaddr)
|
static FUNC_DUMP(dump_redirecting_subaddr)
|
||||||
{
|
{
|
||||||
char cnum[256];
|
unsigned char cnum[256];
|
||||||
q931_get_number(cnum, sizeof(cnum), ie->data + 2, len - 4);
|
q931_get_number(cnum, sizeof(cnum), ie->data + 2, len - 4);
|
||||||
pri_message("%c Redirecting Sub-Address (len=%2d) [ Ext: %d Type: %s (%d) O: %d '%s' ]\n",
|
pri_message("%c Redirecting Sub-Address (len=%2d) [ Ext: %d Type: %s (%d) O: %d '%s' ]\n",
|
||||||
prefix, len, ie->data[0] >> 7,
|
prefix, len, ie->data[0] >> 7,
|
||||||
@ -884,14 +884,14 @@ static FUNC_DUMP(dump_redirecting_subaddr)
|
|||||||
static FUNC_RECV(receive_calling_party_subaddr)
|
static FUNC_RECV(receive_calling_party_subaddr)
|
||||||
{
|
{
|
||||||
/* copy digits to call->callingsubaddr */
|
/* copy digits to call->callingsubaddr */
|
||||||
q931_get_number(call->callingsubaddr, sizeof(call->callingsubaddr), ie->data + 2, len - 4);
|
q931_get_number((unsigned char *) call->callingsubaddr, sizeof(call->callingsubaddr), ie->data + 2, len - 4);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static FUNC_RECV(receive_called_party_number)
|
static FUNC_RECV(receive_called_party_number)
|
||||||
{
|
{
|
||||||
/* copy digits to call->callednum */
|
/* copy digits to call->callednum */
|
||||||
q931_get_number(call->callednum, sizeof(call->callednum), ie->data + 1, len - 3);
|
q931_get_number((unsigned char *) call->callednum, sizeof(call->callednum), ie->data + 1, len - 3);
|
||||||
call->calledplan = ie->data[0] & 0x7f;
|
call->calledplan = ie->data[0] & 0x7f;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -918,11 +918,11 @@ static FUNC_RECV(receive_calling_party_number)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (extbit) {
|
if (extbit) {
|
||||||
q931_get_number(call->callernum, sizeof(call->callernum), ie->data + 1, len - 3);
|
q931_get_number((unsigned char *) call->callernum, sizeof(call->callernum), ie->data + 1, len - 3);
|
||||||
call->callerpres = 0; /* PI presentation allowed
|
call->callerpres = 0; /* PI presentation allowed
|
||||||
SI user-provided, not screened */
|
SI user-provided, not screened */
|
||||||
} else {
|
} else {
|
||||||
q931_get_number(call->callernum, sizeof(call->callernum), ie->data + 2, len - 4);
|
q931_get_number((unsigned char *) call->callernum, sizeof(call->callernum), ie->data + 2, len - 4);
|
||||||
call->callerpres = ie->data[1] & 0x7f;
|
call->callerpres = ie->data[1] & 0x7f;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -951,7 +951,7 @@ static FUNC_RECV(receive_user_user)
|
|||||||
{
|
{
|
||||||
call->useruserprotocoldisc = ie->data[0] & 0xff;
|
call->useruserprotocoldisc = ie->data[0] & 0xff;
|
||||||
if (call->useruserprotocoldisc == 4) /* IA5 */
|
if (call->useruserprotocoldisc == 4) /* IA5 */
|
||||||
q931_get_number(call->useruserinfo, sizeof(call->useruserinfo), ie->data + 1, len - 3);
|
q931_get_number((unsigned char *) call->useruserinfo, sizeof(call->useruserinfo), ie->data + 1, len - 3);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1015,7 +1015,7 @@ static FUNC_RECV(receive_display)
|
|||||||
data++;
|
data++;
|
||||||
len--;
|
len--;
|
||||||
}
|
}
|
||||||
q931_get_number(call->callername, sizeof(call->callername), data, len - 2);
|
q931_get_number((unsigned char *) call->callername, sizeof(call->callername), data, len - 2);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1508,7 +1508,7 @@ static FUNC_DUMP(dump_keypad_facility)
|
|||||||
if (ie->len == 0 || ie->len > sizeof(tmp))
|
if (ie->len == 0 || ie->len > sizeof(tmp))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
strncpy(tmp, ie->data, sizeof(tmp));
|
strncpy(tmp, (char *) ie->data, sizeof(tmp));
|
||||||
pri_message("%c Keypad Facility (len=%2d) [ %s ]\n", prefix, ie->len, tmp );
|
pri_message("%c Keypad Facility (len=%2d) [ %s ]\n", prefix, ie->len, tmp );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1524,7 +1524,7 @@ static FUNC_RECV(receive_keypad_facility)
|
|||||||
else
|
else
|
||||||
mylen = ie->len;
|
mylen = ie->len;
|
||||||
|
|
||||||
strncpy(call->digitbuf, ie->data, mylen);
|
strncpy(call->digitbuf, (char *) ie->data, mylen);
|
||||||
|
|
||||||
/* I must be really neurotic */
|
/* I must be really neurotic */
|
||||||
call->digitbuf[sizeof(call->digitbuf)-1] = '\0';
|
call->digitbuf[sizeof(call->digitbuf)-1] = '\0';
|
||||||
@ -2445,7 +2445,7 @@ static int q931_handle_ie(int codeset, struct pri *pri, q931_call *c, int msg, q
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void init_header(struct pri *pri, q931_call *call, char *buf, q931_h **hb, q931_mh **mhb, int *len)
|
static void init_header(struct pri *pri, q931_call *call, unsigned char *buf, q931_h **hb, q931_mh **mhb, int *len)
|
||||||
{
|
{
|
||||||
/* Returns header and message header and modifies length in place */
|
/* Returns header and message header and modifies length in place */
|
||||||
q931_h *h = (q931_h *)buf;
|
q931_h *h = (q931_h *)buf;
|
||||||
|
Loading…
Reference in New Issue
Block a user