mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 04:30:28 +00:00
BuildSystem: Fix a few issues hightlighted by gcc 6.x
gcc 6.1.1 caught a few more issues. Made sure the unit tests still pass for the func_env and stdtime issues. ASTERISK-26157 #close Change-Id: I6664d8f34a45bc1481d2a854481c7878b0c1cf8e
This commit is contained in:
@@ -567,8 +567,10 @@ static const unsigned char packet_send_stream_based_tone_off[] =
|
|||||||
{ 0x16, 0x05, 0x1c, 0x00, 0x00 };
|
{ 0x16, 0x05, 0x1c, 0x00, 0x00 };
|
||||||
|
|
||||||
static const unsigned char packet_send_mute[] = { 0x16, 0x05, 0x04, 0x00, 0x00 };
|
static const unsigned char packet_send_mute[] = { 0x16, 0x05, 0x04, 0x00, 0x00 };
|
||||||
|
#ifdef NOT_USED
|
||||||
static const unsigned char packet_send_CloseAudioStreamRX[] = { 0x16, 0x05, 0x31, 0x00, 0xff };
|
static const unsigned char packet_send_CloseAudioStreamRX[] = { 0x16, 0x05, 0x31, 0x00, 0xff };
|
||||||
static const unsigned char packet_send_CloseAudioStreamTX[] = { 0x16, 0x05, 0x31, 0xff, 0x00 };
|
static const unsigned char packet_send_CloseAudioStreamTX[] = { 0x16, 0x05, 0x31, 0xff, 0x00 };
|
||||||
|
#endif
|
||||||
static const unsigned char packet_send_stream_based_tone_on[] =
|
static const unsigned char packet_send_stream_based_tone_on[] =
|
||||||
{ 0x16, 0x06, 0x1b, 0x00, 0x00, 0x05 };
|
{ 0x16, 0x06, 0x1b, 0x00, 0x00, 0x05 };
|
||||||
static const unsigned char packet_send_stream_based_tone_single_freq[] =
|
static const unsigned char packet_send_stream_based_tone_single_freq[] =
|
||||||
|
@@ -624,7 +624,7 @@ static int file_read(struct ast_channel *chan, const char *cmd, char *data, stru
|
|||||||
ast_log(LOG_ERROR, "Cannot seek to offset %" PRId64 ": %s\n", i, strerror(errno));
|
ast_log(LOG_ERROR, "Cannot seek to offset %" PRId64 ": %s\n", i, strerror(errno));
|
||||||
}
|
}
|
||||||
end = fread(fbuf, 1, sizeof(fbuf), ff);
|
end = fread(fbuf, 1, sizeof(fbuf), ff);
|
||||||
for (pos = (end < sizeof(fbuf) ? fbuf + end - 1 : fbuf + sizeof(fbuf) - 1); pos > fbuf - 1; pos--) {
|
for (pos = (end < sizeof(fbuf) ? fbuf + end - 1 : fbuf + sizeof(fbuf) - 1); pos >= fbuf; pos--) {
|
||||||
LINE_COUNTER(pos, format, count);
|
LINE_COUNTER(pos, format, count);
|
||||||
|
|
||||||
if (length < 0 && count * -1 == length) {
|
if (length < 0 && count * -1 == length) {
|
||||||
@@ -1024,7 +1024,7 @@ static int file_write(struct ast_channel *chan, const char *cmd, char *data, con
|
|||||||
fclose(ff);
|
fclose(ff);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
for (pos = fbuf + sizeof(fbuf) - 1; pos > fbuf - 1; pos--) {
|
for (pos = fbuf + sizeof(fbuf) - 1; pos >= fbuf; pos--) {
|
||||||
LINE_COUNTER(pos, newline_format, count);
|
LINE_COUNTER(pos, newline_format, count);
|
||||||
|
|
||||||
if (length < 0 && count * -1 == length) {
|
if (length < 0 && count * -1 == length) {
|
||||||
|
16
main/say.c
16
main/say.c
@@ -5201,13 +5201,14 @@ int ast_say_date_with_format_it(struct ast_channel *chan, time_t t, const char *
|
|||||||
case 'I':
|
case 'I':
|
||||||
case 'l':
|
case 'l':
|
||||||
/* 12-Hour */
|
/* 12-Hour */
|
||||||
if (tm.tm_hour == 0)
|
if (tm.tm_hour == 0) {
|
||||||
ast_copy_string(nextmsg, "digits/12", sizeof(nextmsg));
|
ast_copy_string(nextmsg, "digits/12", sizeof(nextmsg));
|
||||||
else if (tm.tm_hour > 12)
|
} else if (tm.tm_hour > 12) {
|
||||||
snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_hour - 12);
|
snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_hour - 12);
|
||||||
else
|
} else {
|
||||||
snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_hour);
|
snprintf(nextmsg, sizeof(nextmsg), "digits/%d", tm.tm_hour);
|
||||||
res = wait_file(chan, ints, nextmsg, lang);
|
}
|
||||||
|
res = wait_file(chan, ints, nextmsg, lang);
|
||||||
break;
|
break;
|
||||||
case 'H':
|
case 'H':
|
||||||
case 'k':
|
case 'k':
|
||||||
@@ -5227,11 +5228,12 @@ int ast_say_date_with_format_it(struct ast_channel *chan, time_t t, const char *
|
|||||||
case 'P':
|
case 'P':
|
||||||
case 'p':
|
case 'p':
|
||||||
/* AM/PM */
|
/* AM/PM */
|
||||||
if (tm.tm_hour > 11)
|
if (tm.tm_hour > 11) {
|
||||||
ast_copy_string(nextmsg, "digits/p-m", sizeof(nextmsg));
|
ast_copy_string(nextmsg, "digits/p-m", sizeof(nextmsg));
|
||||||
else
|
} else {
|
||||||
ast_copy_string(nextmsg, "digits/a-m", sizeof(nextmsg));
|
ast_copy_string(nextmsg, "digits/a-m", sizeof(nextmsg));
|
||||||
res = wait_file(chan, ints, nextmsg, lang);
|
}
|
||||||
|
res = wait_file(chan, ints, nextmsg, lang);
|
||||||
break;
|
break;
|
||||||
case 'Q':
|
case 'Q':
|
||||||
/* Shorthand for "Today", "Yesterday", or ABdY */
|
/* Shorthand for "Today", "Yesterday", or ABdY */
|
||||||
|
@@ -1849,13 +1849,14 @@ void ast_get_dst_info(const time_t * const timep, int *dst_enabled, time_t *dst_
|
|||||||
*dst_enabled = 0;
|
*dst_enabled = 0;
|
||||||
/* Find where I can get gmtoff */
|
/* Find where I can get gmtoff */
|
||||||
i = 0;
|
i = 0;
|
||||||
while (sp->ttis[i].tt_isdst)
|
while (sp->ttis[i].tt_isdst) {
|
||||||
if (++i >= sp->typecnt) {
|
if (++i >= sp->typecnt) {
|
||||||
i = 0;
|
i = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
*gmt_off = sp->ttis[i].tt_gmtoff;
|
}
|
||||||
return;
|
*gmt_off = sp->ttis[i].tt_gmtoff;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 1; i < sp->timecnt; ++i) {
|
for (i = 1; i < sp->timecnt; ++i) {
|
||||||
|
Reference in New Issue
Block a user