diff --git a/Makefile b/Makefile index 0e654157d88f81632049ae3d6fcab8db1882dd51..c5505ccf690c7f36e7952111e006ad02fb494331 100755 --- a/Makefile +++ b/Makefile @@ -20,6 +20,12 @@ OSARCH=$(shell uname -s) ifeq (${OSARCH},Linux) PROC=$(shell uname -m) +ifeq ($(PROC),x86_64) +# You must have GCC 3.4 to use k8, otherwise use athlon +PROC=k8 +#PROC=athlon +OPTIONS+=-m64 +endif else ifeq (${OSARCH},FreeBSD) PROC=$(shell uname -m) diff --git a/apps/app_festival.c b/apps/app_festival.c index 3076d9a420194bfd7009f5d9a97157400f18b2cf..c0352cbb296635deb43d8d3429affcdacc959920 100755 --- a/apps/app_festival.c +++ b/apps/app_festival.c @@ -199,7 +199,7 @@ static int send_waveform_to_channel(struct ast_channel *chan, char *waveform, in needed = f->samples * 2; if (needed > sizeof(myf.frdata)) { ast_log(LOG_WARNING, "Only able to deliver %d of %d requested samples\n", - sizeof(myf.frdata) / 2, needed/2); + (int)sizeof(myf.frdata) / 2, needed/2); needed = sizeof(myf.frdata); } res = read(fds[0], myf.frdata, needed); @@ -374,7 +374,7 @@ static int festival_exec(struct ast_channel *chan, void *vdata) } } else { read(fdesc,&strln,sizeof(int)); - ast_log(LOG_DEBUG,"Cache file exists, strln=%d, strlen=%d\n",strln,strlen((char *)data)); + ast_log(LOG_DEBUG,"Cache file exists, strln=%d, strlen=%d\n",strln,(int)strlen((char *)data)); if (strlen((char *)data)==strln) { ast_log(LOG_DEBUG,"Size OK\n"); read(fdesc,&bigstring,strln); diff --git a/apps/app_milliwatt.c b/apps/app_milliwatt.c index 78f0604cec7f2681c1c349969c65358efe165d8d..dd14b60d496beeebc53924b08604934446d6c4c5 100755 --- a/apps/app_milliwatt.c +++ b/apps/app_milliwatt.c @@ -64,7 +64,7 @@ static int milliwatt_generate(struct ast_channel *chan, void *data, int len, int if (len > sizeof(buf)) { - ast_log(LOG_WARNING,"Only doing %d bytes (%d bytes requested)\n",sizeof(buf),len); + ast_log(LOG_WARNING,"Only doing %d bytes (%d bytes requested)\n",(int)sizeof(buf),len); len = sizeof(buf); } waste[0] = 0; /* make compiler happy */ diff --git a/apps/app_sms.c b/apps/app_sms.c index 7e704449f9da8daf52f86c3007f50846d2d3693b..b935ae5cc4d1212135e2ddc81fa6974a20cc9ed4 100755 --- a/apps/app_sms.c +++ b/apps/app_sms.c @@ -860,7 +860,7 @@ sms_generate (struct ast_channel *chan, void *data, int len, int samples) if (len > sizeof (buf)) { - ast_log (LOG_WARNING, "Only doing %d bytes (%d bytes requested)\n", sizeof (buf) / sizeof (signed short), len); + ast_log (LOG_WARNING, "Only doing %d bytes (%d bytes requested)\n", (int)(sizeof (buf) / sizeof (signed short)), len); len = sizeof (buf); samples = len / 2; } diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index cc2b4dfe4619168eced1ad5036f73cb38997f3d1..fa25f7501e9a22702f5cd67e4eec5fb48dda6828 100755 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -2953,7 +2953,7 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct break; } vm_change_password(vmu,newpassword); - ast_log(LOG_DEBUG,"User %s set password to %s of length %i\n",vms->username,newpassword,strlen(newpassword)); + ast_log(LOG_DEBUG,"User %s set password to %s of length %i\n",vms->username,newpassword,(int)strlen(newpassword)); cmd = play_and_wait(chan,"vm-passchanged"); break; case '*': diff --git a/asterisk.c b/asterisk.c index 76636ae4313a3d678ffb686139d28d0c9dd46ac1..556f77605d039804c17400e2afe79095fbaa0be9 100755 --- a/asterisk.c +++ b/asterisk.c @@ -1216,7 +1216,7 @@ static char *cli_complete(EditLine *el, int ch) free(matches); } - return (char *)retval; + return (char *)(long)retval; } static int ast_el_initialize(void) @@ -1459,7 +1459,7 @@ int main(int argc, char *argv[]) /* Remember original args for restart */ if (argc > sizeof(_argv) / sizeof(_argv[0]) - 1) { - fprintf(stderr, "Truncating argument size to %d\n", sizeof(_argv) / sizeof(_argv[0]) - 1); + fprintf(stderr, "Truncating argument size to %d\n", (int)(sizeof(_argv) / sizeof(_argv[0])) - 1); argc = sizeof(_argv) / sizeof(_argv[0]) - 1; } for (x=0;x<argc;x++) diff --git a/cdr/cdr_csv.c b/cdr/cdr_csv.c index 17a0f4dabd900788541a8d87e216b86651ab85ae..8c553db6801ea6932022d34ae11780212ac4be4c 100755 --- a/cdr/cdr_csv.c +++ b/cdr/cdr_csv.c @@ -210,7 +210,7 @@ static int csv_log(struct ast_cdr *cdr) printf("[CDR] %s ('%s' -> '%s') Dur: %ds Bill: %ds Disp: %s Flags: %s Account: [%s]\n", cdr->channel, cdr->src, cdr->dst, cdr->duration, cdr->billsec, ast_cdr_disp2str(cdr->disposition), ast_cdr_flags2str(cdr->amaflags), cdr->accountcode); #endif if (build_csv_record(buf, sizeof(buf), cdr)) { - ast_log(LOG_WARNING, "Unable to create CSV record in %d bytes. CDR not recorded!\n", sizeof(buf)); + ast_log(LOG_WARNING, "Unable to create CSV record in %d bytes. CDR not recorded!\n", (int)sizeof(buf)); } else { /* because of the absolutely unconditional need for the highest reliability possible in writing billing records, diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 8989bc6329a7839de95f76c612af7d7aed6dee0f..3b64b52089c12a9a3fbf5dc02ef6bea76b88ddff 100755 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -773,8 +773,8 @@ static int make_trunk(unsigned short callno, int locked) ast_sched_del(sched, iaxs[x]->pingid); if (iaxs[x]->lagid > -1) ast_sched_del(sched, iaxs[x]->lagid); - iaxs[x]->pingid = ast_sched_add(sched, ping_time * 1000, send_ping, (void *)x); - iaxs[x]->lagid = ast_sched_add(sched, lagrq_time * 1000, send_lagrq, (void *)x); + iaxs[x]->pingid = ast_sched_add(sched, ping_time * 1000, send_ping, (void *)(long)x); + iaxs[x]->lagid = ast_sched_add(sched, lagrq_time * 1000, send_lagrq, (void *)(long)x); if (locked) ast_mutex_unlock(&iaxsl[callno]); res = x; @@ -848,8 +848,8 @@ static int find_callno(unsigned short callno, unsigned short dcallno, struct soc iaxs[x]->callno = x; iaxs[x]->pingtime = DEFAULT_RETRY_TIME; iaxs[x]->expirey = expirey; - iaxs[x]->pingid = ast_sched_add(sched, ping_time * 1000, send_ping, (void *)x); - iaxs[x]->lagid = ast_sched_add(sched, lagrq_time * 1000, send_lagrq, (void *)x); + iaxs[x]->pingid = ast_sched_add(sched, ping_time * 1000, send_ping, (void *)(long)x); + iaxs[x]->lagid = ast_sched_add(sched, lagrq_time * 1000, send_lagrq, (void *)(long)x); iaxs[x]->amaflags = amaflags; iaxs[x]->notransfer = globalnotransfer; strncpy(iaxs[x]->accountcode, accountcode, sizeof(iaxs[x]->accountcode)-1); @@ -4288,7 +4288,7 @@ static void iax2_dprequest(struct iax2_dpcache *dp, int callno) /* Auto-hangup with 30 seconds of inactivity */ if (iaxs[callno]->autoid > -1) ast_sched_del(sched, iaxs[callno]->autoid); - iaxs[callno]->autoid = ast_sched_add(sched, 30000, auto_hangup, (void *)callno); + iaxs[callno]->autoid = ast_sched_add(sched, 30000, auto_hangup, (void *)(long)callno); memset(&ied, 0, sizeof(ied)); iax_ie_append_str(&ied, IAX_IE_CALLED_NUMBER, dp->exten); send_command(iaxs[callno], AST_FRAME_IAX, IAX_COMMAND_DPREQ, 0, ied.buf, ied.pos, -1); @@ -4638,7 +4638,7 @@ static int socket_read(int *id, int fd, short events, void *cbdata) return 1; } if (res < sizeof(struct ast_iax2_mini_hdr)) { - ast_log(LOG_WARNING, "midget packet received (%d of %d min)\n", res, sizeof(struct ast_iax2_mini_hdr)); + ast_log(LOG_WARNING, "midget packet received (%d of %d min)\n", res, (int)sizeof(struct ast_iax2_mini_hdr)); return 1; } if ((vh->zeros == 0) && (ntohs(vh->callno) & 0x8000)) { @@ -4650,7 +4650,7 @@ static int socket_read(int *id, int fd, short events, void *cbdata) switch(meta->metacmd) { case IAX_META_TRUNK: if (res < sizeof(struct ast_iax2_meta_hdr) + sizeof(struct ast_iax2_meta_trunk_hdr)) { - ast_log(LOG_WARNING, "midget meta trunk packet received (%d of %d min)\n", res, sizeof(struct ast_iax2_mini_hdr)); + ast_log(LOG_WARNING, "midget meta trunk packet received (%d of %d min)\n", res, (int)sizeof(struct ast_iax2_mini_hdr)); return 1; } mth = (struct ast_iax2_meta_trunk_hdr *)(meta->data); @@ -4836,7 +4836,7 @@ static int socket_read(int *id, int fd, short events, void *cbdata) } /* A full frame */ if (res < sizeof(struct ast_iax2_full_hdr)) { - ast_log(LOG_WARNING, "midget packet received (%d of %d min)\n", res, sizeof(struct ast_iax2_full_hdr)); + ast_log(LOG_WARNING, "midget packet received (%d of %d min)\n", res, (int)sizeof(struct ast_iax2_full_hdr)); ast_mutex_unlock(&iaxsl[fr.callno]); return 1; } diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 2b52c6a26891ed243a798fdebb91182c26fca30e..c076d640cf9ccc4c4b3e104238aa2afc82e3889d 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -1766,11 +1766,11 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, char *title) else if (strchr(i->fromdomain,':')) { - snprintf(tmp->name, sizeof(tmp->name), "SIP/%s-%08x", strchr(i->fromdomain,':')+1, (int)(i)); + snprintf(tmp->name, sizeof(tmp->name), "SIP/%s-%08x", strchr(i->fromdomain,':')+1, (int)(long)(i)); } else { - snprintf(tmp->name, sizeof(tmp->name), "SIP/%s-%08x", i->fromdomain, (int)(i)); + snprintf(tmp->name, sizeof(tmp->name), "SIP/%s-%08x", i->fromdomain, (int)(long)(i)); } tmp->type = type; if (i->dtmfmode & SIP_DTMF_INBAND) { @@ -3554,7 +3554,7 @@ static int transmit_state_notify(struct sip_pvt *p, int state, int full) if (t > tmp + sizeof(tmp)) ast_log(LOG_WARNING, "Buffer overflow detected!! (Please file a bug report)\n"); - snprintf(clen, sizeof(clen), "%d", strlen(tmp)); + snprintf(clen, sizeof(clen), "%d", (int)strlen(tmp)); add_header(&req, "Content-Length", clen); add_line(&req, tmp); @@ -3579,7 +3579,7 @@ static int transmit_notify(struct sip_pvt *p, int newmsgs, int oldmsgs) snprintf(tmp, sizeof(tmp), "Messages-Waiting: %s\n", newmsgs ? "yes" : "no"); snprintf(tmp2, sizeof(tmp2), "Voicemail: %d/%d\n", newmsgs, oldmsgs); - snprintf(clen, sizeof(clen), "%d", strlen(tmp) + strlen(tmp2)); + snprintf(clen, sizeof(clen), "%d", (int)(strlen(tmp) + strlen(tmp2))); add_header(&req, "Content-Length", clen); add_line(&req, tmp); add_line(&req, tmp2); diff --git a/channels/chan_zap.c b/channels/chan_zap.c index 434a2af2bdf92c1628dc7005dc66e05a3ff1a5a1..7e4f791056d8474d31e69a54297bff8190c40e24 100755 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -9206,7 +9206,7 @@ static int zt_sendtext(struct ast_channel *c, char *text) else { len = tdd_generate(p->tdd,buf,text); if (len < 1) { - ast_log(LOG_ERROR, "TDD generate (len %d) failed!!\n",strlen(text)); + ast_log(LOG_ERROR, "TDD generate (len %d) failed!!\n",(int)strlen(text)); free(mybuf); return -1; } diff --git a/channels/iax2-parser.c b/channels/iax2-parser.c index dc249fad6fe17ec331efe5bb53c862c85b2cf417..a64fa0e1199c87b99a97bf796de45e1ae129b9ac 100755 --- a/channels/iax2-parser.c +++ b/channels/iax2-parser.c @@ -44,7 +44,7 @@ static void (*errorf)(const char *str) = internalerror; static void dump_addr(char *output, int maxlen, void *value, int len) { struct sockaddr_in sin; - if (len == sizeof(sin)) { + if (len == (int)sizeof(sin)) { memcpy(&sin, value, len); snprintf(output, maxlen, "IPV4 %s:%d", inet_ntoa(sin.sin_addr), ntohs(sin.sin_port)); } else { @@ -63,7 +63,7 @@ static void dump_string(char *output, int maxlen, void *value, int len) static void dump_int(char *output, int maxlen, void *value, int len) { - if (len == sizeof(unsigned int)) + if (len == (int)sizeof(unsigned int)) snprintf(output, maxlen, "%lu", (unsigned long)ntohl(*((unsigned int *)value))); else snprintf(output, maxlen, "Invalid INT"); @@ -71,7 +71,7 @@ static void dump_int(char *output, int maxlen, void *value, int len) static void dump_short(char *output, int maxlen, void *value, int len) { - if (len == sizeof(unsigned short)) + if (len == (int)sizeof(unsigned short)) snprintf(output, maxlen, "%d", ntohs(*((unsigned short *)value))); else snprintf(output, maxlen, "Invalid SHORT"); @@ -79,7 +79,7 @@ static void dump_short(char *output, int maxlen, void *value, int len) static void dump_byte(char *output, int maxlen, void *value, int len) { - if (len == sizeof(unsigned char)) + if (len == (int)sizeof(unsigned char)) snprintf(output, maxlen, "%d", ntohs(*((unsigned char *)value))); else snprintf(output, maxlen, "Invalid BYTE"); @@ -131,7 +131,7 @@ static struct iax2_ie { const char *iax_ie2str(int ie) { int x; - for (x=0;x<sizeof(ies) / sizeof(ies[0]); x++) { + for (x=0;x<(int)sizeof(ies) / (int)sizeof(ies[0]); x++) { if (ies[x].ie == ie) return ies[x].name; } @@ -152,30 +152,30 @@ static void dump_ies(unsigned char *iedata, int len) ie = iedata[0]; ielen = iedata[1]; if (ielen + 2> len) { - snprintf(tmp, sizeof(tmp), "Total IE length of %d bytes exceeds remaining frame length of %d bytes\n", ielen + 2, len); + snprintf(tmp, (int)sizeof(tmp), "Total IE length of %d bytes exceeds remaining frame length of %d bytes\n", ielen + 2, len); outputf(tmp); return; } found = 0; - for (x=0;x<sizeof(ies) / sizeof(ies[0]); x++) { + for (x=0;x<(int)sizeof(ies) / (int)sizeof(ies[0]); x++) { if (ies[x].ie == ie) { if (ies[x].dump) { - ies[x].dump(interp, sizeof(interp), iedata + 2, ielen); - snprintf(tmp, sizeof(tmp), " %-15.15s : %s\n", ies[x].name, interp); + ies[x].dump(interp, (int)sizeof(interp), iedata + 2, ielen); + snprintf(tmp, (int)sizeof(tmp), " %-15.15s : %s\n", ies[x].name, interp); outputf(tmp); } else { if (ielen) - snprintf(interp, sizeof(interp), "%d bytes", ielen); + snprintf(interp, (int)sizeof(interp), "%d bytes", ielen); else strcpy(interp, "Present"); - snprintf(tmp, sizeof(tmp), " %-15.15s : %s\n", ies[x].name, interp); + snprintf(tmp, (int)sizeof(tmp), " %-15.15s : %s\n", ies[x].name, interp); outputf(tmp); } found++; } } if (!found) { - snprintf(tmp, sizeof(tmp), " Unknown IE %03d : Present\n", ie); + snprintf(tmp, (int)sizeof(tmp), " Unknown IE %03d : Present\n", ie); outputf(tmp); } iedata += (2 + ielen); @@ -254,7 +254,7 @@ void iax_showframe(struct iax_frame *f, struct ast_iax2_full_hdr *fhi, int rx, s char tmp[256]; if (f) { fh = f->data; - snprintf(retries, sizeof(retries), "%03d", f->retries); + snprintf(retries, (int)sizeof(retries), "%03d", f->retries); } else { fh = fhi; if (ntohs(fh->dcallno) & IAX_FLAG_RETRANS) @@ -266,8 +266,8 @@ void iax_showframe(struct iax_frame *f, struct ast_iax2_full_hdr *fhi, int rx, s /* Don't mess with mini-frames */ return; } - if (fh->type > sizeof(frames)/sizeof(char *)) { - snprintf(class2, sizeof(class2), "(%d?)", fh->type); + if (fh->type > (int)sizeof(frames)/(int)sizeof(char *)) { + snprintf(class2, (int)sizeof(class2), "(%d?)", fh->type); class = class2; } else { class = frames[(int)fh->type]; @@ -276,29 +276,29 @@ void iax_showframe(struct iax_frame *f, struct ast_iax2_full_hdr *fhi, int rx, s sprintf(subclass2, "%c", fh->csub); subclass = subclass2; } else if (fh->type == AST_FRAME_IAX) { - if (fh->csub >= sizeof(iaxs)/sizeof(iaxs[0])) { - snprintf(subclass2, sizeof(subclass2), "(%d?)", fh->csub); + if (fh->csub >= (int)sizeof(iaxs)/(int)sizeof(iaxs[0])) { + snprintf(subclass2, (int)sizeof(subclass2), "(%d?)", fh->csub); subclass = subclass2; } else { subclass = iaxs[(int)fh->csub]; } } else if (fh->type == AST_FRAME_CONTROL) { - if (fh->csub > sizeof(cmds)/sizeof(char *)) { - snprintf(subclass2, sizeof(subclass2), "(%d?)", fh->csub); + if (fh->csub > (int)sizeof(cmds)/(int)sizeof(char *)) { + snprintf(subclass2, (int)sizeof(subclass2), "(%d?)", fh->csub); subclass = subclass2; } else { subclass = cmds[(int)fh->csub]; } } else { - snprintf(subclass2, sizeof(subclass2), "%d", fh->csub); + snprintf(subclass2, (int)sizeof(subclass2), "%d", fh->csub); subclass = subclass2; } -snprintf(tmp, sizeof(tmp), +snprintf(tmp, (int)sizeof(tmp), "%s-Frame Retry[%s] -- OSeqno: %3.3d ISeqno: %3.3d Type: %s Subclass: %s\n", (rx ? "Rx" : "Tx"), retries, fh->oseqno, fh->iseqno, class, subclass); outputf(tmp); -snprintf(tmp, sizeof(tmp), +snprintf(tmp, (int)sizeof(tmp), " Timestamp: %05lums SCall: %5.5d DCall: %5.5d [%s:%d]\n", (unsigned long)ntohl(fh->ts), ntohs(fh->scallno) & ~IAX_FLAG_FULL, ntohs(fh->dcallno) & ~IAX_FLAG_RETRANS, @@ -311,8 +311,8 @@ snprintf(tmp, sizeof(tmp), int iax_ie_append_raw(struct iax_ie_data *ied, unsigned char ie, void *data, int datalen) { char tmp[256]; - if (datalen > (sizeof(ied->buf) - ied->pos)) { - snprintf(tmp, sizeof(tmp), "Out of space for ie '%s' (%d), need %d have %d\n", iax_ie2str(ie), ie, datalen, sizeof(ied->buf) - ied->pos); + if (datalen > ((int)sizeof(ied->buf) - ied->pos)) { + snprintf(tmp, (int)sizeof(tmp), "Out of space for ie '%s' (%d), need %d have %d\n", iax_ie2str(ie), ie, datalen, (int)sizeof(ied->buf) - ied->pos); errorf(tmp); return -1; } @@ -325,21 +325,21 @@ int iax_ie_append_raw(struct iax_ie_data *ied, unsigned char ie, void *data, int int iax_ie_append_addr(struct iax_ie_data *ied, unsigned char ie, struct sockaddr_in *sin) { - return iax_ie_append_raw(ied, ie, sin, sizeof(struct sockaddr_in)); + return iax_ie_append_raw(ied, ie, sin, (int)sizeof(struct sockaddr_in)); } int iax_ie_append_int(struct iax_ie_data *ied, unsigned char ie, unsigned int value) { unsigned int newval; newval = htonl(value); - return iax_ie_append_raw(ied, ie, &newval, sizeof(newval)); + return iax_ie_append_raw(ied, ie, &newval, (int)sizeof(newval)); } int iax_ie_append_short(struct iax_ie_data *ied, unsigned char ie, unsigned short value) { unsigned short newval; newval = htons(value); - return iax_ie_append_raw(ied, ie, &newval, sizeof(newval)); + return iax_ie_append_raw(ied, ie, &newval, (int)sizeof(newval)); } int iax_ie_append_str(struct iax_ie_data *ied, unsigned char ie, unsigned char *str) @@ -373,7 +373,7 @@ int iax_parse_ies(struct iax_ies *ies, unsigned char *data, int datalen) int len; int ie; char tmp[256]; - memset(ies, 0, sizeof(struct iax_ies)); + memset(ies, 0, (int)sizeof(struct iax_ies)); ies->msgcount = -1; ies->firmwarever = -1; while(datalen >= 2) { @@ -406,15 +406,15 @@ int iax_parse_ies(struct iax_ies *ies, unsigned char *data, int datalen) ies->password = data + 2; break; case IAX_IE_CAPABILITY: - if (len != sizeof(unsigned int)) { - snprintf(tmp, sizeof(tmp), "Expecting capability to be %d bytes long but was %d\n", sizeof(unsigned int), len); + if (len != (int)sizeof(unsigned int)) { + snprintf(tmp, (int)sizeof(tmp), "Expecting capability to be %d bytes long but was %d\n", (int)sizeof(unsigned int), len); errorf(tmp); } else ies->capability = ntohl(*((unsigned int *)(data + 2))); break; case IAX_IE_FORMAT: - if (len != sizeof(unsigned int)) { - snprintf(tmp, sizeof(tmp), "Expecting format to be %d bytes long but was %d\n", sizeof(unsigned int), len); + if (len != (int)sizeof(unsigned int)) { + snprintf(tmp, (int)sizeof(tmp), "Expecting format to be %d bytes long but was %d\n", (int)sizeof(unsigned int), len); errorf(tmp); } else ies->format = ntohl(*((unsigned int *)(data + 2))); @@ -423,15 +423,15 @@ int iax_parse_ies(struct iax_ies *ies, unsigned char *data, int datalen) ies->language = data + 2; break; case IAX_IE_VERSION: - if (len != sizeof(unsigned short)) { - snprintf(tmp, sizeof(tmp), "Expecting version to be %d bytes long but was %d\n", sizeof(unsigned short), len); + if (len != (int)sizeof(unsigned short)) { + snprintf(tmp, (int)sizeof(tmp), "Expecting version to be %d bytes long but was %d\n", (int)sizeof(unsigned short), len); errorf(tmp); } else ies->version = ntohs(*((unsigned short *)(data + 2))); break; case IAX_IE_ADSICPE: - if (len != sizeof(unsigned short)) { - snprintf(tmp, sizeof(tmp), "Expecting adsicpe to be %d bytes long but was %d\n", sizeof(unsigned short), len); + if (len != (int)sizeof(unsigned short)) { + snprintf(tmp, (int)sizeof(tmp), "Expecting adsicpe to be %d bytes long but was %d\n", (int)sizeof(unsigned short), len); errorf(tmp); } else ies->adsicpe = ntohs(*((unsigned short *)(data + 2))); @@ -443,8 +443,8 @@ int iax_parse_ies(struct iax_ies *ies, unsigned char *data, int datalen) ies->rdnis = data + 2; break; case IAX_IE_AUTHMETHODS: - if (len != sizeof(unsigned short)) { - snprintf(tmp, sizeof(tmp), "Expecting authmethods to be %d bytes long but was %d\n", sizeof(unsigned short), len); + if (len != (int)sizeof(unsigned short)) { + snprintf(tmp, (int)sizeof(tmp), "Expecting authmethods to be %d bytes long but was %d\n", (int)sizeof(unsigned short), len); errorf(tmp); } else ies->authmethods = ntohs(*((unsigned short *)(data + 2))); @@ -462,22 +462,22 @@ int iax_parse_ies(struct iax_ies *ies, unsigned char *data, int datalen) ies->apparent_addr = ((struct sockaddr_in *)(data + 2)); break; case IAX_IE_REFRESH: - if (len != sizeof(unsigned short)) { - snprintf(tmp, sizeof(tmp), "Expecting refresh to be %d bytes long but was %d\n", sizeof(unsigned short), len); + if (len != (int)sizeof(unsigned short)) { + snprintf(tmp, (int)sizeof(tmp), "Expecting refresh to be %d bytes long but was %d\n", (int)sizeof(unsigned short), len); errorf(tmp); } else ies->refresh = ntohs(*((unsigned short *)(data + 2))); break; case IAX_IE_DPSTATUS: - if (len != sizeof(unsigned short)) { - snprintf(tmp, sizeof(tmp), "Expecting dpstatus to be %d bytes long but was %d\n", sizeof(unsigned short), len); + if (len != (int)sizeof(unsigned short)) { + snprintf(tmp, (int)sizeof(tmp), "Expecting dpstatus to be %d bytes long but was %d\n", (int)sizeof(unsigned short), len); errorf(tmp); } else ies->dpstatus = ntohs(*((unsigned short *)(data + 2))); break; case IAX_IE_CALLNO: - if (len != sizeof(unsigned short)) { - snprintf(tmp, sizeof(tmp), "Expecting callno to be %d bytes long but was %d\n", sizeof(unsigned short), len); + if (len != (int)sizeof(unsigned short)) { + snprintf(tmp, (int)sizeof(tmp), "Expecting callno to be %d bytes long but was %d\n", (int)sizeof(unsigned short), len); errorf(tmp); } else ies->callno = ntohs(*((unsigned short *)(data + 2))); @@ -489,13 +489,13 @@ int iax_parse_ies(struct iax_ies *ies, unsigned char *data, int datalen) if (len == 1) ies->iax_unknown = data[2]; else { - snprintf(tmp, sizeof(tmp), "Expected single byte Unknown command, but was %d long\n", len); + snprintf(tmp, (int)sizeof(tmp), "Expected single byte Unknown command, but was %d long\n", len); errorf(tmp); } break; case IAX_IE_MSGCOUNT: - if (len != sizeof(unsigned short)) { - snprintf(tmp, sizeof(tmp), "Expecting msgcount to be %d bytes long but was %d\n", sizeof(unsigned short), len); + if (len != (int)sizeof(unsigned short)) { + snprintf(tmp, (int)sizeof(tmp), "Expecting msgcount to be %d bytes long but was %d\n", (int)sizeof(unsigned short), len); errorf(tmp); } else ies->msgcount = ntohs(*((unsigned short *)(data + 2))); @@ -507,22 +507,22 @@ int iax_parse_ies(struct iax_ies *ies, unsigned char *data, int datalen) ies->musiconhold = 1; break; case IAX_IE_TRANSFERID: - if (len != sizeof(unsigned int)) { - snprintf(tmp, sizeof(tmp), "Expecting transferid to be %d bytes long but was %d\n", sizeof(unsigned int), len); + if (len != (int)sizeof(unsigned int)) { + snprintf(tmp, (int)sizeof(tmp), "Expecting transferid to be %d bytes long but was %d\n", (int)sizeof(unsigned int), len); errorf(tmp); } else ies->transferid = ntohl(*((unsigned int *)(data + 2))); break; case IAX_IE_DATETIME: - if (len != sizeof(unsigned int)) { - snprintf(tmp, sizeof(tmp), "Expecting date/time to be %d bytes long but was %d\n", sizeof(unsigned int), len); + if (len != (int)sizeof(unsigned int)) { + snprintf(tmp, (int)sizeof(tmp), "Expecting date/time to be %d bytes long but was %d\n", (int)sizeof(unsigned int), len); errorf(tmp); } else ies->datetime = ntohl(*((unsigned int *)(data + 2))); break; case IAX_IE_FIRMWAREVER: - if (len != sizeof(unsigned short)) { - snprintf(tmp, sizeof(tmp), "Expecting firmwarever to be %d bytes long but was %d\n", sizeof(unsigned short), len); + if (len != (int)sizeof(unsigned short)) { + snprintf(tmp, (int)sizeof(tmp), "Expecting firmwarever to be %d bytes long but was %d\n", (int)sizeof(unsigned short), len); errorf(tmp); } else ies->firmwarever = ntohs(*((unsigned short *)(data + 2))); @@ -534,8 +534,8 @@ int iax_parse_ies(struct iax_ies *ies, unsigned char *data, int datalen) ies->serviceident = data + 2; break; case IAX_IE_FWBLOCKDESC: - if (len != sizeof(unsigned int)) { - snprintf(tmp, sizeof(tmp), "Expected block desc to be %d bytes long but was %d\n", sizeof(unsigned int), len); + if (len != (int)sizeof(unsigned int)) { + snprintf(tmp, (int)sizeof(tmp), "Expected block desc to be %d bytes long but was %d\n", (int)sizeof(unsigned int), len); errorf(tmp); } else ies->fwdesc = ntohl(*((unsigned int *)(data + 2))); @@ -545,14 +545,14 @@ int iax_parse_ies(struct iax_ies *ies, unsigned char *data, int datalen) ies->fwdatalen = len; break; case IAX_IE_PROVVER: - if (len != sizeof(unsigned int)) { - snprintf(tmp, sizeof(tmp), "Expected provisioning version to be %d bytes long but was %d\n", sizeof(unsigned int), len); + if (len != (int)sizeof(unsigned int)) { + snprintf(tmp, (int)sizeof(tmp), "Expected provisioning version to be %d bytes long but was %d\n", (int)sizeof(unsigned int), len); errorf(tmp); } else ies->provver = ntohl(*((unsigned int *)(data + 2))); break; default: - snprintf(tmp, sizeof(tmp), "Ignoring unknown information element '%s' (%d) of length %d\n", iax_ie2str(ie), ie, len); + snprintf(tmp, (int)sizeof(tmp), "Ignoring unknown information element '%s' (%d) of length %d\n", iax_ie2str(ie), ie, len); outputf(tmp); } /* Overwrite information element with 0, to null terminate previous portion */ @@ -588,7 +588,7 @@ void iax_frame_wrap(struct iax_frame *fr, struct ast_frame *f) struct iax_frame *iax_frame_new(int direction, int datalen) { struct iax_frame *fr; - fr = malloc(sizeof(struct iax_frame) + datalen); + fr = malloc((int)sizeof(struct iax_frame) + datalen); if (fr) { fr->direction = direction; fr->retrans = -1; diff --git a/codecs/gsm/Makefile b/codecs/gsm/Makefile index effdbcbaca59ec144869269efd1959c4a83cb555..1cfa939e1dd2ad9dd10915916c243505b456811d 100755 --- a/codecs/gsm/Makefile +++ b/codecs/gsm/Makefile @@ -200,7 +200,7 @@ GSM_SOURCES = $(SRC)/add.c \ $(SRC)/short_term.c \ $(SRC)/table.c ifeq (${OSARCH},Linux) -ifneq (${PROC},x86_64) +ifneq ($(shell uname -m),x86_64) ifneq ($(shell uname -m),ppc) ifneq ($(shell uname -m),alpha) GSM_SOURCES+= $(SRC)/k6opt.s @@ -253,7 +253,7 @@ GSM_OBJECTS = $(SRC)/add.o \ $(SRC)/short_term.o \ $(SRC)/table.o ifeq (${OSARCH},Linux) -ifneq (${PROC},x86_64) +ifneq ($(shell uname -m), x86_64) ifneq ($(shell uname -m), ppc) ifneq ($(shell uname -m), alpha) GSM_OBJECTS+= $(SRC)/k6opt.o diff --git a/codecs/ilbc/Makefile b/codecs/ilbc/Makefile index dd2bbc3f29e2070c0405b9f3bb8a1d54b65d071f..12471d1051eec0a5d90238766845445ad7a486d8 100755 --- a/codecs/ilbc/Makefile +++ b/codecs/ilbc/Makefile @@ -1,4 +1,5 @@ -CFLAGS+=-Wall -Werror -fPIC -O3 -march=$(shell uname -m) -funroll-loops -fomit-frame-pointer +ARCH=$(PROC) +CFLAGS+=-Wall -Werror -fPIC -O3 -march=$(ARCH) -funroll-loops -fomit-frame-pointer LIB=libilbc.a OBJS= anaFilter.o iCBSearch.o packing.o \ diff --git a/pbx.c b/pbx.c index 2c79751bb7214faab16bdf69d5122b0150d6cf35..d88c265c58dc1ffcc9e489dcfc13e56cf23b47f3 100755 --- a/pbx.c +++ b/pbx.c @@ -794,7 +794,7 @@ static void pbx_substitute_variables_temp(struct ast_channel *c,const char *var, char cp3[80]; strncpy(cp3, var, sizeof(cp3) - 1); cp3[len-len_len-1]='\0'; - sprintf(workspace,"%d",strlen(cp3)); + sprintf(workspace,"%d",(int)strlen(cp3)); *ret = workspace; } else { /* length is zero */ diff --git a/pbx/pbx_wilcalu.c b/pbx/pbx_wilcalu.c index 69578c8a04ba86bd969f3f831cca951e6b6cb657..c58795089b007ddb22c8f258edb521f592415277 100755 --- a/pbx/pbx_wilcalu.c +++ b/pbx/pbx_wilcalu.c @@ -184,7 +184,7 @@ static void *dialstring(void *string){ free(string); pthread_exit(NULL); } - ast_log(LOG_DEBUG, "Autodial Tech %s(%d) Tele %s(%d) Filename %s(%d)\n",tech,strlen(tech),tele,strlen(tele),filename,strlen(filename)); + ast_log(LOG_DEBUG, "Autodial Tech %s(%d) Tele %s(%d) Filename %s(%d)\n",tech,(int)strlen(tech),tele,(int)strlen(tele),filename,(int)strlen(filename)); channel=ast_request(tech,AST_FORMAT_SLINEAR,tele); if(channel!=NULL){ diff --git a/res/res_crypto.c b/res/res_crypto.c index e0cb6233cd4619c8678c14aa790d56addeaf4869..2ebf4bef9d64976e854f216c2c942b6b642a6bf6 100755 --- a/res/res_crypto.c +++ b/res/res_crypto.c @@ -405,7 +405,7 @@ int ast_sign(struct ast_key *key, char *msg, char *sig) } if (siglen != sizeof(dsig)) { - ast_log(LOG_WARNING, "Unexpected signature length %d, expecting %d\n", siglen, sizeof(dsig)); + ast_log(LOG_WARNING, "Unexpected signature length %d, expecting %d\n", (int)siglen, (int)sizeof(dsig)); return -1; } @@ -431,7 +431,7 @@ int ast_check_signature(struct ast_key *key, char *msg, char *sig) /* Decode signature */ res = base64decode(dsig, sig, sizeof(dsig)); if (res != sizeof(dsig)) { - ast_log(LOG_WARNING, "Signature improper length (expect %d, got %d)\n", sizeof(dsig), res); + ast_log(LOG_WARNING, "Signature improper length (expect %d, got %d)\n", (int)sizeof(dsig), (int)res); return -1; } diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index 27519a7ea6143f1f8d1c3310d728d5d8f576d99f..6bef3a6d6f839a0f89b00a5f041a96b2ed947528 100755 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -454,7 +454,7 @@ static int moh_generate(struct ast_channel *chan, void *data, int len, int sampl len = samples * 2; if (len > sizeof(buf) - AST_FRIENDLY_OFFSET) { - ast_log(LOG_WARNING, "Only doing %d of %d requested bytes on %s\n", sizeof(buf), len, chan->name); + ast_log(LOG_WARNING, "Only doing %d of %d requested bytes on %s\n", (int)sizeof(buf), (int)len, chan->name); len = sizeof(buf) - AST_FRIENDLY_OFFSET; } res = read(moh->pipe[0], buf + AST_FRIENDLY_OFFSET/2, len);