correct some signed/unsigned issues found by GCC 4 (bug #4237)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5664 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2005-05-15 03:21:51 +00:00
parent 977fd5a157
commit 6cd4f9a8d3
8 changed files with 15 additions and 15 deletions

View File

@@ -327,7 +327,7 @@ static void *listener(void *unused)
{
struct sockaddr_un sunaddr;
int s;
int len;
socklen_t len;
int x;
int flags;
struct pollfd fds[1];

View File

@@ -6089,7 +6089,7 @@ static int socket_read(int *id, int fd, short events, void *cbdata)
int updatehistory=1;
int new = NEW_PREVENT;
char buf[4096], *ptr;
int len = sizeof(sin);
socklen_t len = sizeof(sin);
int dcallno = 0;
struct ast_iax2_full_hdr *fh = (struct ast_iax2_full_hdr *)buf;
struct ast_iax2_mini_hdr *mh = (struct ast_iax2_mini_hdr *)buf;

View File

@@ -297,7 +297,7 @@ struct mgcp_message {
unsigned int seqno;
int len;
struct mgcp_message *next;
unsigned char buf[0];
char buf[0];
};
#define RESPONSE_TIMEOUT 30 /* in seconds */
@@ -307,7 +307,7 @@ struct mgcp_response {
int len;
int seqno;
struct mgcp_response *next;
unsigned char buf[0];
char buf[0];
};
#define MAX_SUBS 2
@@ -722,7 +722,7 @@ static int retrans_pkt(void *data)
/* SC: modified for the new transaction mechanism */
static int mgcp_postrequest(struct mgcp_endpoint *p, struct mgcp_subchannel *sub,
unsigned char *data, int len, unsigned int seqno)
char *data, int len, unsigned int seqno)
{
struct mgcp_message *msg = malloc(sizeof(struct mgcp_message) + len);
struct mgcp_message *cur;
@@ -3286,7 +3286,7 @@ static int mgcpsock_read(int *id, int fd, short events, void *ignore)
struct sockaddr_in sin;
struct mgcp_subchannel *sub;
int res;
int len;
socklen_t len;
int result;
int ident;
char iabuf[INET_ADDRSTRLEN];

View File

@@ -1230,7 +1230,7 @@ static void realtime_update_peer(const char *peername, struct sockaddr_in *sin,
/*--- register_peer_exten: Automatically add peer extension to dial plan ---*/
static void register_peer_exten(struct sip_peer *peer, int onoff)
{
unsigned char multi[256]="";
char multi[256]="";
char *stringp, *ext;
if (!ast_strlen_zero(regcontext)) {
ast_copy_string(multi, ast_strlen_zero(peer->regexten) ? peer->name : peer->regexten, sizeof(multi));
@@ -9207,7 +9207,7 @@ static int sipsock_read(int *id, int fd, short events, void *ignore)
struct sockaddr_in sin = { 0, };
struct sip_pvt *p;
int res;
int len;
socklen_t len;
int nounlock;
int recount = 0;
int debug;

View File

@@ -2688,7 +2688,7 @@ static void *accept_thread(void *ignore)
{
int as;
struct sockaddr_in sin;
int sinlen;
socklen_t sinlen;
struct skinnysession *s;
struct protoent *p;
int arg = 1;

6
dsp.c
View File

@@ -1303,7 +1303,7 @@ struct ast_frame *ast_dsp_process(struct ast_channel *chan, struct ast_dsp *dsp,
int res;
int digit;
int x;
unsigned short *shortdata;
short *shortdata;
unsigned char *odata;
int len;
int writeback = 0;
@@ -1315,11 +1315,11 @@ struct ast_frame *ast_dsp_process(struct ast_channel *chan, struct ast_dsp *dsp,
break; \
case AST_FORMAT_ULAW: \
for (x=0;x<len;x++) \
odata[x] = AST_LIN2MU(shortdata[x]); \
odata[x] = AST_LIN2MU((unsigned short)shortdata[x]); \
break; \
case AST_FORMAT_ALAW: \
for (x=0;x<len;x++) \
odata[x] = AST_LIN2A(shortdata[x]); \
odata[x] = AST_LIN2A((unsigned short)shortdata[x]); \
break; \
} \
} \

View File

@@ -1358,7 +1358,7 @@ static void *accept_thread(void *ignore)
{
int as;
struct sockaddr_in sin;
int sinlen;
socklen_t sinlen;
struct mansession *s;
struct protoent *p;
int arg = 1;

4
rtp.c
View File

@@ -313,7 +313,7 @@ static int rtpread(int *id, int fd, short events, void *cbdata)
struct ast_frame *ast_rtcp_read(struct ast_rtp *rtp)
{
static struct ast_frame null_frame = { AST_FRAME_NULL, };
int len;
socklen_t len;
int hdrlen = 8;
int res;
struct sockaddr_in sin;
@@ -382,7 +382,7 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
{
int res;
struct sockaddr_in sin;
int len;
socklen_t len;
unsigned int seqno;
int version;
int payloadtype;