1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Remove warning: C++11 requires a space between string literal and macro (#874)

On Ubuntu 17.04, the default gcc compiler version is 6.3.0.
It switch standard from c++98 to c++11.
So it would generate verbose warnings.
This commit is contained in:
HungMingWu 2017-05-06 14:05:22 +08:00 committed by winlin
parent a58874178b
commit 815d50f00a
32 changed files with 114 additions and 114 deletions

View file

@ -959,7 +959,7 @@ int SrsFlvVodStreamDecoder::seek2(int64_t offset)
if (offset >= reader->filesize()) {
ret = ERROR_SYSTEM_FILE_EOF;
srs_warn("flv fast decoder seek overflow file, "
"size=%"PRId64", offset=%"PRId64", ret=%d",
"size=%" PRId64 ", offset=%" PRId64 ", ret=%d",
reader->filesize(), offset, ret);
return ret;
}
@ -967,7 +967,7 @@ int SrsFlvVodStreamDecoder::seek2(int64_t offset)
if (reader->seek2(offset) < 0) {
ret = ERROR_SYSTEM_FILE_SEEK;
srs_warn("flv fast decoder seek error, "
"size=%"PRId64", offset=%"PRId64", ret=%d",
"size=%" PRId64 ", offset=%" PRId64 ", ret=%d",
reader->filesize(), offset, ret);
return ret;
}

View file

@ -190,7 +190,7 @@ int SrsMp4Box::discovery(SrsBuffer* buf, SrsMp4Box** ppbox)
// Only support 31bits size.
if (largesize > 0x7fffffff) {
ret = ERROR_MP4_BOX_OVERFLOW;
srs_error("MP4 discovery overflow 31bits, size=%"PRId64". ret=%d", largesize, ret);
srs_error("MP4 discovery overflow 31bits, size=%" PRId64 ". ret=%d", largesize, ret);
return ret;
}
@ -370,7 +370,7 @@ int SrsMp4Box::encode_header(SrsBuffer* buf)
// Only support 31bits size.
if (sz() > 0x7fffffff) {
ret = ERROR_MP4_BOX_OVERFLOW;
srs_error("MP4 box size overflow 31bits, size=%"PRId64". ret=%d", sz(), ret);
srs_error("MP4 box size overflow 31bits, size=%" PRId64 ". ret=%d", sz(), ret);
return ret;
}
@ -430,7 +430,7 @@ int SrsMp4Box::decode_header(SrsBuffer* buf)
// Only support 31bits size.
if (sz() > 0x7fffffff) {
ret = ERROR_MP4_BOX_OVERFLOW;
srs_error("MP4 box size overflow 31bits, size=%"PRId64". ret=%d", sz(), ret);
srs_error("MP4 box size overflow 31bits, size=%" PRId64 ". ret=%d", sz(), ret);
return ret;
}

View file

@ -1142,7 +1142,7 @@ int SrsTsAdaptationField::decode(SrsBuffer* stream)
nb_af_reserved = adaption_field_length - (stream->pos() - pos_af);
stream->skip(nb_af_reserved);
srs_info("ts: af parsed, discontinuity=%d random=%d priority=%d PCR=%d OPCR=%d slicing=%d private=%d extension=%d/%d pcr=%"PRId64"/%d opcr=%"PRId64"/%d",
srs_info("ts: af parsed, discontinuity=%d random=%d priority=%d PCR=%d OPCR=%d slicing=%d private=%d extension=%d/%d pcr=%" PRId64 "/%d opcr=%" PRId64 "/%d",
discontinuity_indicator, random_access_indicator, elementary_stream_priority_indicator, PCR_flag, OPCR_flag, splicing_point_flag,
transport_private_data_flag, adaptation_field_extension_flag, adaptation_field_extension_length, program_clock_reference_base,
program_clock_reference_extension, original_program_clock_reference_base, original_program_clock_reference_extension);
@ -1323,7 +1323,7 @@ int SrsTsAdaptationField::encode(SrsBuffer* stream)
stream->skip(nb_af_reserved);
}
srs_info("ts: af parsed, discontinuity=%d random=%d priority=%d PCR=%d OPCR=%d slicing=%d private=%d extension=%d/%d pcr=%"PRId64"/%d opcr=%"PRId64"/%d",
srs_info("ts: af parsed, discontinuity=%d random=%d priority=%d PCR=%d OPCR=%d slicing=%d private=%d extension=%d/%d pcr=%" PRId64 "/%d opcr=%" PRId64 "/%d",
discontinuity_indicator, random_access_indicator, elementary_stream_priority_indicator, PCR_flag, OPCR_flag, splicing_point_flag,
transport_private_data_flag, adaptation_field_extension_flag, adaptation_field_extension_length, program_clock_reference_base,
program_clock_reference_extension, original_program_clock_reference_base, original_program_clock_reference_extension);
@ -1563,7 +1563,7 @@ int SrsTsPayloadPES::decode(SrsBuffer* stream, SrsTsMessage** ppmsg)
// check sync, the diff of dts and pts should never greater than 1s.
if (dts - pts > 90000 || pts - dts > 90000) {
srs_warn("ts: sync dts=%"PRId64", pts=%"PRId64, dts, pts);
srs_warn("ts: sync dts=%" PRId64 ", pts=%" PRId64, dts, pts);
}
// update the dts and pts of message.
@ -1923,7 +1923,7 @@ int SrsTsPayloadPES::encode(SrsBuffer* stream)
// check sync, the diff of dts and pts should never greater than 1s.
if (dts - pts > 90000 || pts - dts > 90000) {
srs_warn("ts: sync dts=%"PRId64", pts=%"PRId64, dts, pts);
srs_warn("ts: sync dts=%" PRId64 ", pts=%" PRId64, dts, pts);
}
}
@ -2753,7 +2753,7 @@ int SrsTsContextWriter::write_audio(SrsTsMessage* audio)
{
int ret = ERROR_SUCCESS;
srs_info("hls: write audio pts=%"PRId64", dts=%"PRId64", size=%d",
srs_info("hls: write audio pts=%" PRId64 ", dts=%" PRId64 ", size=%d",
audio->pts, audio->dts, audio->PES_packet_length);
if ((ret = context->encode(writer, audio, vcodec, acodec)) != ERROR_SUCCESS) {
@ -2769,7 +2769,7 @@ int SrsTsContextWriter::write_video(SrsTsMessage* video)
{
int ret = ERROR_SUCCESS;
srs_info("hls: write video pts=%"PRId64", dts=%"PRId64", size=%d",
srs_info("hls: write video pts=%" PRId64 ", dts=%" PRId64 ", size=%d",
video->pts, video->dts, video->PES_packet_length);
if ((ret = context->encode(writer, video, vcodec, acodec)) != ERROR_SUCCESS) {

View file

@ -143,13 +143,13 @@ int64_t srs_update_system_time_ms()
int64_t diff = now_us - _srs_system_time_us_cache;
diff = srs_max(0, diff);
if (diff < 0 || diff > 1000 * SYS_TIME_RESOLUTION_US) {
srs_warn("clock jump, history=%"PRId64"us, now=%"PRId64"us, diff=%"PRId64"us", _srs_system_time_us_cache, now_us, diff);
srs_warn("clock jump, history=%" PRId64 "us, now=%" PRId64 "us, diff=%" PRId64 "us", _srs_system_time_us_cache, now_us, diff);
// @see: https://github.com/ossrs/srs/issues/109
_srs_system_time_startup_time += diff;
}
_srs_system_time_us_cache = now_us;
srs_info("clock updated, startup=%"PRId64"us, now=%"PRId64"us", _srs_system_time_startup_time, _srs_system_time_us_cache);
srs_info("clock updated, startup=%" PRId64 "us, now=%" PRId64 "us", _srs_system_time_startup_time, _srs_system_time_us_cache);
return _srs_system_time_us_cache / 1000;
}
@ -206,7 +206,7 @@ string srs_int2str(int64_t value)
{
// len(max int64_t) is 20, plus one "+-."
char tmp[22];
snprintf(tmp, 22, "%"PRId64, value);
snprintf(tmp, 22, "%" PRId64, value);
return tmp;
}