Message ID | 20200410110438.20517-1-lance.lmwang@gmail.com |
---|---|
State | New |
Headers | show |
Series | [FFmpeg-devel,v1] fftools/ffprobe: Use format specifier PRId64 instead of %lld | expand |
Context | Check | Description |
---|---|---|
andriy/ffmpeg-patchwork | success | Make fate finished |
On Fri, Apr 10, 2020 at 07:04:38PM +0800, lance.lmwang@gmail.com wrote: > From: Limin Wang <lance.lmwang@gmail.com> > > Signed-off-by: Limin Wang <lance.lmwang@gmail.com> > --- > fftools/ffprobe.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c > index e3f221f560..a32bc529d9 100644 > --- a/fftools/ffprobe.c > +++ b/fftools/ffprobe.c > @@ -408,7 +408,7 @@ static char *value_string(char *buf, int buf_size, struct unit_value uv) > if (show_float || (use_value_prefix && vald != (long long int)vald)) > snprintf(buf, buf_size, "%f", vald); > else > - snprintf(buf, buf_size, "%lld", vali); > + snprintf(buf, buf_size, "%"PRId64, vali); > av_strlcatf(buf, buf_size, "%s%s%s", *prefix_string || show_value_unit ? " " : "", > prefix_string, show_value_unit ? uv.unit : ""); > } > @@ -1002,7 +1002,7 @@ static void default_print_int(WriterContext *wctx, const char *key, long long in > > if (!def->nokey) > printf("%s%s=", wctx->section_pbuf[wctx->level].str, key); > - printf("%lld\n", value); > + printf("%"PRId64"\n", value); > } > > static const Writer default_writer = { > @@ -1179,7 +1179,7 @@ static void compact_print_int(WriterContext *wctx, const char *key, long long in > if (wctx->nb_item[wctx->level]) printf("%c", compact->item_sep); > if (!compact->nokey) > printf("%s%s=", wctx->section_pbuf[wctx->level].str, key); > - printf("%lld", value); > + printf("%"PRId64, value); > } > > static const Writer compact_writer = { > @@ -1322,7 +1322,7 @@ static void flat_print_section_header(WriterContext *wctx) > > static void flat_print_int(WriterContext *wctx, const char *key, long long int value) > { > - printf("%s%s=%lld\n", wctx->section_pbuf[wctx->level].str, key, value); > + printf("%s%s=%"PRId64"\n", wctx->section_pbuf[wctx->level].str, key, value); > } the type does not match here [...]
On Fri, Apr 10, 2020 at 07:37:40PM +0200, Michael Niedermayer wrote: > On Fri, Apr 10, 2020 at 07:04:38PM +0800, lance.lmwang@gmail.com wrote: > > From: Limin Wang <lance.lmwang@gmail.com> > > > > Signed-off-by: Limin Wang <lance.lmwang@gmail.com> > > --- > > fftools/ffprobe.c | 14 +++++++------- > > 1 file changed, 7 insertions(+), 7 deletions(-) > > > > diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c > > index e3f221f560..a32bc529d9 100644 > > --- a/fftools/ffprobe.c > > +++ b/fftools/ffprobe.c > > @@ -408,7 +408,7 @@ static char *value_string(char *buf, int buf_size, struct unit_value uv) > > if (show_float || (use_value_prefix && vald != (long long int)vald)) > > snprintf(buf, buf_size, "%f", vald); > > else > > - snprintf(buf, buf_size, "%lld", vali); > > + snprintf(buf, buf_size, "%"PRId64, vali); > > av_strlcatf(buf, buf_size, "%s%s%s", *prefix_string || show_value_unit ? " " : "", > > prefix_string, show_value_unit ? uv.unit : ""); > > } > > @@ -1002,7 +1002,7 @@ static void default_print_int(WriterContext *wctx, const char *key, long long in > > > > if (!def->nokey) > > printf("%s%s=", wctx->section_pbuf[wctx->level].str, key); > > - printf("%lld\n", value); > > + printf("%"PRId64"\n", value); > > } > > > > static const Writer default_writer = { > > @@ -1179,7 +1179,7 @@ static void compact_print_int(WriterContext *wctx, const char *key, long long in > > if (wctx->nb_item[wctx->level]) printf("%c", compact->item_sep); > > if (!compact->nokey) > > printf("%s%s=", wctx->section_pbuf[wctx->level].str, key); > > - printf("%lld", value); > > + printf("%"PRId64, value); > > } > > > > static const Writer compact_writer = { > > > @@ -1322,7 +1322,7 @@ static void flat_print_section_header(WriterContext *wctx) > > > > static void flat_print_int(WriterContext *wctx, const char *key, long long int value) > > { > > - printf("%s%s=%lld\n", wctx->section_pbuf[wctx->level].str, key, value); > > + printf("%s%s=%"PRId64"\n", wctx->section_pbuf[wctx->level].str, key, value); > > } > > the type does not match here yes, my fault, lld is for "long long int" is no problem. I originally plan to change "long long int" to int64_t, but I'm not sure if the original code has other ideas which I'm missing. > > [...] > -- > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB > > If you fake or manipulate statistics in a paper in physics you will never > get a job again. > If you fake or manipulate statistics in a paper in medicin you will get > a job for life at the pharma industry. > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c index e3f221f560..a32bc529d9 100644 --- a/fftools/ffprobe.c +++ b/fftools/ffprobe.c @@ -408,7 +408,7 @@ static char *value_string(char *buf, int buf_size, struct unit_value uv) if (show_float || (use_value_prefix && vald != (long long int)vald)) snprintf(buf, buf_size, "%f", vald); else - snprintf(buf, buf_size, "%lld", vali); + snprintf(buf, buf_size, "%"PRId64, vali); av_strlcatf(buf, buf_size, "%s%s%s", *prefix_string || show_value_unit ? " " : "", prefix_string, show_value_unit ? uv.unit : ""); } @@ -1002,7 +1002,7 @@ static void default_print_int(WriterContext *wctx, const char *key, long long in if (!def->nokey) printf("%s%s=", wctx->section_pbuf[wctx->level].str, key); - printf("%lld\n", value); + printf("%"PRId64"\n", value); } static const Writer default_writer = { @@ -1179,7 +1179,7 @@ static void compact_print_int(WriterContext *wctx, const char *key, long long in if (wctx->nb_item[wctx->level]) printf("%c", compact->item_sep); if (!compact->nokey) printf("%s%s=", wctx->section_pbuf[wctx->level].str, key); - printf("%lld", value); + printf("%"PRId64, value); } static const Writer compact_writer = { @@ -1322,7 +1322,7 @@ static void flat_print_section_header(WriterContext *wctx) static void flat_print_int(WriterContext *wctx, const char *key, long long int value) { - printf("%s%s=%lld\n", wctx->section_pbuf[wctx->level].str, key, value); + printf("%s%s=%"PRId64"\n", wctx->section_pbuf[wctx->level].str, key, value); } static void flat_print_str(WriterContext *wctx, const char *key, const char *value) @@ -1440,7 +1440,7 @@ static void ini_print_str(WriterContext *wctx, const char *key, const char *valu static void ini_print_int(WriterContext *wctx, const char *key, long long int value) { - printf("%s=%lld\n", key, value); + printf("%s=%"PRId64"\n", key, value); } static const Writer ini_writer = { @@ -1603,7 +1603,7 @@ static void json_print_int(WriterContext *wctx, const char *key, long long int v JSON_INDENT(); av_bprint_init(&buf, 1, AV_BPRINT_SIZE_UNLIMITED); - printf("\"%s\": %lld", json_escape_str(&buf, key, wctx), value); + printf("\"%s\": %"PRId64, json_escape_str(&buf, key, wctx), value); av_bprint_finalize(&buf, NULL); } @@ -1776,7 +1776,7 @@ static void xml_print_int(WriterContext *wctx, const char *key, long long int va { if (wctx->nb_item[wctx->level]) printf(" "); - printf("%s=\"%lld\"", key, value); + printf("%s=\"%"PRId64"\"", key, value); } static Writer xml_writer = {