mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 07:35:18 +00:00
more pointer signedness fixes for gcc4 warnings
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6306 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -120,7 +120,7 @@
|
|||||||
*/
|
*/
|
||||||
extern int adsi_channel_init(struct ast_channel *chan);
|
extern int adsi_channel_init(struct ast_channel *chan);
|
||||||
|
|
||||||
extern int adsi_begin_download(struct ast_channel *chan, char *service, char *fdn, char *sec, int version);
|
extern int adsi_begin_download(struct ast_channel *chan, unsigned char *service, unsigned char *fdn, unsigned char *sec, int version);
|
||||||
|
|
||||||
extern int adsi_end_download(struct ast_channel *chan);
|
extern int adsi_end_download(struct ast_channel *chan);
|
||||||
|
|
||||||
@@ -145,7 +145,7 @@ extern int adsi_channel_restore(struct ast_channel *chan);
|
|||||||
* Return 0 on success (or adsi unavailable) and -1 on hangup
|
* Return 0 on success (or adsi unavailable) and -1 on hangup
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
extern int adsi_print(struct ast_channel *chan, char **lines, int *align, int voice);
|
extern int adsi_print(struct ast_channel *chan, unsigned char **lines, int *align, int voice);
|
||||||
|
|
||||||
/*! Check if scripts for a given app are already loaded. Version may be -1 */
|
/*! Check if scripts for a given app are already loaded. Version may be -1 */
|
||||||
/* if any version is okay, or 0-255 for a specific version. */
|
/* if any version is okay, or 0-255 for a specific version. */
|
||||||
|
@@ -56,7 +56,7 @@ static char speeddial[ADSI_MAX_SPEED_DIAL][3][20];
|
|||||||
|
|
||||||
static int alignment = 0;
|
static int alignment = 0;
|
||||||
|
|
||||||
static int adsi_generate(unsigned char *buf, int msgtype, char *msg, int msglen, int msgnum, int last, int codec)
|
static int adsi_generate(unsigned char *buf, int msgtype, unsigned char *msg, int msglen, int msgnum, int last, int codec)
|
||||||
{
|
{
|
||||||
int sum;
|
int sum;
|
||||||
int x;
|
int x;
|
||||||
@@ -306,7 +306,7 @@ static int __adsi_transmit_messages(struct ast_channel *chan, unsigned char **ms
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int adsi_begin_download(struct ast_channel *chan, char *service, char *fdn, char *sec, int version)
|
int adsi_begin_download(struct ast_channel *chan, unsigned char *service, unsigned char *fdn, unsigned char *sec, int version)
|
||||||
{
|
{
|
||||||
int bytes;
|
int bytes;
|
||||||
unsigned char buf[256];
|
unsigned char buf[256];
|
||||||
@@ -592,7 +592,7 @@ int adsi_read_encoded_dtmf(struct ast_channel *chan, unsigned char *buf, int max
|
|||||||
|
|
||||||
int adsi_get_cpeid(struct ast_channel *chan, unsigned char *cpeid, int voice)
|
int adsi_get_cpeid(struct ast_channel *chan, unsigned char *cpeid, int voice)
|
||||||
{
|
{
|
||||||
char buf[256];
|
unsigned char buf[256];
|
||||||
int bytes = 0;
|
int bytes = 0;
|
||||||
int res;
|
int res;
|
||||||
bytes += adsi_data_mode(buf);
|
bytes += adsi_data_mode(buf);
|
||||||
@@ -624,7 +624,7 @@ int adsi_get_cpeid(struct ast_channel *chan, unsigned char *cpeid, int voice)
|
|||||||
|
|
||||||
int adsi_get_cpeinfo(struct ast_channel *chan, int *width, int *height, int *buttons, int voice)
|
int adsi_get_cpeinfo(struct ast_channel *chan, int *width, int *height, int *buttons, int voice)
|
||||||
{
|
{
|
||||||
char buf[256];
|
unsigned char buf[256];
|
||||||
int bytes = 0;
|
int bytes = 0;
|
||||||
int res;
|
int res;
|
||||||
bytes += adsi_data_mode(buf);
|
bytes += adsi_data_mode(buf);
|
||||||
@@ -636,46 +636,46 @@ int adsi_get_cpeinfo(struct ast_channel *chan, int *width, int *height, int *but
|
|||||||
|
|
||||||
/* Get width */
|
/* Get width */
|
||||||
memset(buf, 0, sizeof(buf));
|
memset(buf, 0, sizeof(buf));
|
||||||
res = ast_readstring(chan, buf, 2, 1000, 500, "");
|
res = ast_readstring(chan, (char *)buf, 2, 1000, 500, "");
|
||||||
if (res < 0)
|
if (res < 0)
|
||||||
return res;
|
return res;
|
||||||
if (strlen(buf) != 2) {
|
if (strlen((char *)buf) != 2) {
|
||||||
ast_log(LOG_WARNING, "Got %d bytes of width, expecting 2\n", res);
|
ast_log(LOG_WARNING, "Got %d bytes of width, expecting 2\n", res);
|
||||||
res = 0;
|
res = 0;
|
||||||
} else {
|
} else {
|
||||||
res = 1;
|
res = 1;
|
||||||
}
|
}
|
||||||
if (width)
|
if (width)
|
||||||
*width = atoi(buf);
|
*width = atoi((char *)buf);
|
||||||
/* Get height */
|
/* Get height */
|
||||||
memset(buf, 0, sizeof(buf));
|
memset(buf, 0, sizeof(buf));
|
||||||
if (res) {
|
if (res) {
|
||||||
res = ast_readstring(chan, buf, 2, 1000, 500, "");
|
res = ast_readstring(chan, (char *)buf, 2, 1000, 500, "");
|
||||||
if (res < 0)
|
if (res < 0)
|
||||||
return res;
|
return res;
|
||||||
if (strlen(buf) != 2) {
|
if (strlen((char *)buf) != 2) {
|
||||||
ast_log(LOG_WARNING, "Got %d bytes of height, expecting 2\n", res);
|
ast_log(LOG_WARNING, "Got %d bytes of height, expecting 2\n", res);
|
||||||
res = 0;
|
res = 0;
|
||||||
} else {
|
} else {
|
||||||
res = 1;
|
res = 1;
|
||||||
}
|
}
|
||||||
if (height)
|
if (height)
|
||||||
*height= atoi(buf);
|
*height= atoi((char *)buf);
|
||||||
}
|
}
|
||||||
/* Get buttons */
|
/* Get buttons */
|
||||||
memset(buf, 0, sizeof(buf));
|
memset(buf, 0, sizeof(buf));
|
||||||
if (res) {
|
if (res) {
|
||||||
res = ast_readstring(chan, buf, 1, 1000, 500, "");
|
res = ast_readstring(chan, (char *)buf, 1, 1000, 500, "");
|
||||||
if (res < 0)
|
if (res < 0)
|
||||||
return res;
|
return res;
|
||||||
if (strlen(buf) != 1) {
|
if (strlen((char *)buf) != 1) {
|
||||||
ast_log(LOG_WARNING, "Got %d bytes of buttons, expecting 1\n", res);
|
ast_log(LOG_WARNING, "Got %d bytes of buttons, expecting 1\n", res);
|
||||||
res = 0;
|
res = 0;
|
||||||
} else {
|
} else {
|
||||||
res = 1;
|
res = 1;
|
||||||
}
|
}
|
||||||
if (buttons)
|
if (buttons)
|
||||||
*buttons = atoi(buf);
|
*buttons = atoi((char *)buf);
|
||||||
}
|
}
|
||||||
if (voice) {
|
if (voice) {
|
||||||
bytes = 0;
|
bytes = 0;
|
||||||
@@ -846,7 +846,7 @@ int adsi_input_format(unsigned char *buf, int num, int dir, int wrap, unsigned c
|
|||||||
{
|
{
|
||||||
int bytes = 0;
|
int bytes = 0;
|
||||||
|
|
||||||
if (!strlen(format1))
|
if (!strlen((char *)format1))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
buf[bytes++] = ADSI_INPUT_FORMAT;
|
buf[bytes++] = ADSI_INPUT_FORMAT;
|
||||||
@@ -854,7 +854,7 @@ int adsi_input_format(unsigned char *buf, int num, int dir, int wrap, unsigned c
|
|||||||
buf[bytes++] = ((dir & 1) << 7) | ((wrap & 1) << 6) | (num & 0x7);
|
buf[bytes++] = ((dir & 1) << 7) | ((wrap & 1) << 6) | (num & 0x7);
|
||||||
bytes += ccopy(buf + bytes, format1, 20);
|
bytes += ccopy(buf + bytes, format1, 20);
|
||||||
buf[bytes++] = 0xff;
|
buf[bytes++] = 0xff;
|
||||||
if (format2 && strlen(format2)) {
|
if (format2 && strlen((char *)format2)) {
|
||||||
bytes += ccopy(buf + bytes, format2, 20);
|
bytes += ccopy(buf + bytes, format2, 20);
|
||||||
}
|
}
|
||||||
buf[1] = bytes - 2;
|
buf[1] = bytes - 2;
|
||||||
@@ -909,7 +909,7 @@ static int speeds = 0;
|
|||||||
|
|
||||||
int adsi_channel_restore(struct ast_channel *chan)
|
int adsi_channel_restore(struct ast_channel *chan)
|
||||||
{
|
{
|
||||||
char dsp[256];
|
unsigned char dsp[256];
|
||||||
int bytes;
|
int bytes;
|
||||||
int x;
|
int x;
|
||||||
unsigned char keyd[6];
|
unsigned char keyd[6];
|
||||||
@@ -934,14 +934,14 @@ int adsi_channel_restore(struct ast_channel *chan)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int adsi_print(struct ast_channel *chan, char **lines, int *aligns, int voice)
|
int adsi_print(struct ast_channel *chan, unsigned char **lines, int *aligns, int voice)
|
||||||
{
|
{
|
||||||
char buf[4096];
|
unsigned char buf[4096];
|
||||||
int bytes=0;
|
int bytes=0;
|
||||||
int res;
|
int res;
|
||||||
int x;
|
int x;
|
||||||
for(x=0;lines[x];x++)
|
for(x=0;lines[x];x++)
|
||||||
bytes += adsi_display(buf + bytes, ADSI_INFO_PAGE, x+1, aligns[x],0, lines[x], "");
|
bytes += adsi_display(buf + bytes, ADSI_INFO_PAGE, x+1, aligns[x], 0, lines[x], (unsigned char *)"");
|
||||||
bytes += adsi_set_line(buf + bytes, ADSI_INFO_PAGE, 1);
|
bytes += adsi_set_line(buf + bytes, ADSI_INFO_PAGE, 1);
|
||||||
if (voice) {
|
if (voice) {
|
||||||
bytes += adsi_voice_mode(buf + bytes, 0);
|
bytes += adsi_voice_mode(buf + bytes, 0);
|
||||||
@@ -956,7 +956,7 @@ int adsi_print(struct ast_channel *chan, char **lines, int *aligns, int voice)
|
|||||||
|
|
||||||
int adsi_load_session(struct ast_channel *chan, unsigned char *app, int ver, int data)
|
int adsi_load_session(struct ast_channel *chan, unsigned char *app, int ver, int data)
|
||||||
{
|
{
|
||||||
char dsp[256];
|
unsigned char dsp[256];
|
||||||
int bytes;
|
int bytes;
|
||||||
int res;
|
int res;
|
||||||
char resp[2];
|
char resp[2];
|
||||||
@@ -965,7 +965,7 @@ int adsi_load_session(struct ast_channel *chan, unsigned char *app, int ver, int
|
|||||||
|
|
||||||
/* Connect to session */
|
/* Connect to session */
|
||||||
bytes = 0;
|
bytes = 0;
|
||||||
bytes += adsi_connect_session(dsp + bytes, app,ver);
|
bytes += adsi_connect_session(dsp + bytes, app, ver);
|
||||||
|
|
||||||
if (data)
|
if (data)
|
||||||
bytes += adsi_data_mode(dsp + bytes);
|
bytes += adsi_data_mode(dsp + bytes);
|
||||||
@@ -997,7 +997,7 @@ int adsi_load_session(struct ast_channel *chan, unsigned char *app, int ver, int
|
|||||||
|
|
||||||
int adsi_unload_session(struct ast_channel *chan)
|
int adsi_unload_session(struct ast_channel *chan)
|
||||||
{
|
{
|
||||||
char dsp[256];
|
unsigned char dsp[256];
|
||||||
int bytes;
|
int bytes;
|
||||||
|
|
||||||
memset(dsp, 0, sizeof(dsp));
|
memset(dsp, 0, sizeof(dsp));
|
||||||
|
@@ -248,10 +248,10 @@ static int adsi_announce_park(struct ast_channel *chan, int parkingnum)
|
|||||||
int res;
|
int res;
|
||||||
int justify[5] = {ADSI_JUST_CENT, ADSI_JUST_CENT, ADSI_JUST_CENT, ADSI_JUST_CENT};
|
int justify[5] = {ADSI_JUST_CENT, ADSI_JUST_CENT, ADSI_JUST_CENT, ADSI_JUST_CENT};
|
||||||
char tmp[256] = "";
|
char tmp[256] = "";
|
||||||
char *message[5] = {NULL, NULL, NULL, NULL, NULL};
|
unsigned char *message[5] = {NULL, NULL, NULL, NULL, NULL};
|
||||||
|
|
||||||
snprintf(tmp, sizeof(tmp), "Parked on %d", parkingnum);
|
snprintf(tmp, sizeof(tmp), "Parked on %d", parkingnum);
|
||||||
message[0] = tmp;
|
message[0] = (unsigned char *)tmp;
|
||||||
res = adsi_load_session(chan, NULL, 0, 1);
|
res = adsi_load_session(chan, NULL, 0, 1);
|
||||||
if (res == -1) {
|
if (res == -1) {
|
||||||
return res;
|
return res;
|
||||||
|
Reference in New Issue
Block a user