mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-14 00:24:05 +00:00
Allow Asterisk to compile under GCC 4.10
This resolves a large number of compiler warnings from GCC 4.10 which cause the build to fail under dev mode. The vast majority are signed/unsigned mismatches in printf-style format strings. ........ Merged revisions 413586 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 413587 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 413588 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -304,24 +304,24 @@ static int check_header(FILE *f)
|
||||
/* data_size = ltohl(header[AU_HDR_DATA_SIZE_OFF]); */
|
||||
encoding = ltohl(header[AU_HDR_ENCODING_OFF]);
|
||||
if (encoding != AU_ENC_8BIT_ULAW) {
|
||||
ast_log(LOG_WARNING, "Unexpected format: %d. Only 8bit ULAW allowed (%d)\n", encoding, AU_ENC_8BIT_ULAW);
|
||||
ast_log(LOG_WARNING, "Unexpected format: %u. Only 8bit ULAW allowed (%d)\n", encoding, AU_ENC_8BIT_ULAW);
|
||||
return -1;
|
||||
}
|
||||
sample_rate = ltohl(header[AU_HDR_SAMPLE_RATE_OFF]);
|
||||
if (sample_rate != DEFAULT_SAMPLE_RATE) {
|
||||
ast_log(LOG_WARNING, "Sample rate can only be 8000 not %d\n", sample_rate);
|
||||
ast_log(LOG_WARNING, "Sample rate can only be 8000 not %u\n", sample_rate);
|
||||
return -1;
|
||||
}
|
||||
channels = ltohl(header[AU_HDR_CHANNELS_OFF]);
|
||||
if (channels != 1) {
|
||||
ast_log(LOG_WARNING, "Not in mono: channels=%d\n", channels);
|
||||
ast_log(LOG_WARNING, "Not in mono: channels=%u\n", channels);
|
||||
return -1;
|
||||
}
|
||||
/* Skip to data */
|
||||
fseek(f, 0, SEEK_END);
|
||||
data_size = ftell(f) - hdr_size;
|
||||
if (fseek(f, hdr_size, SEEK_SET) == -1 ) {
|
||||
ast_log(LOG_WARNING, "Failed to skip to data: %d\n", hdr_size);
|
||||
ast_log(LOG_WARNING, "Failed to skip to data: %u\n", hdr_size);
|
||||
return -1;
|
||||
}
|
||||
return data_size;
|
||||
|
Reference in New Issue
Block a user