diff mbox series

[FFmpeg-devel,02/30] avfilter/vf_addroi: Use chars instead of strings for one-char strings

Message ID 20201230233157.1055287-2-andreas.rheinhardt@gmail.com
State Accepted
Commit 2089d21bc73d54faee1170d12e0d2b85ad821f57
Headers show
Series [FFmpeg-devel,01/30] avcodec/opustab: Make array static
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Dec. 30, 2020, 11:31 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavfilter/vf_addroi.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Guo, Yejun Dec. 31, 2020, 1:57 a.m. UTC | #1
> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
> Andreas Rheinhardt
> Sent: 2020年12月31日 7:31
> To: ffmpeg-devel@ffmpeg.org
> Cc: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> Subject: [FFmpeg-devel] [PATCH 02/30] avfilter/vf_addroi: Use chars instead of
> strings for one-char strings
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavfilter/vf_addroi.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/libavfilter/vf_addroi.c b/libavfilter/vf_addroi.c index
> 489998ce73..d6b83ee854 100644
> --- a/libavfilter/vf_addroi.c
> +++ b/libavfilter/vf_addroi.c
> @@ -26,8 +26,8 @@ enum {
>      X, Y, W, H,
>      NB_PARAMS,
>  };
> -static const char *addroi_param_names[] = {
> -    "x", "y", "w", "h",
> +static const char addroi_param_names[] = {
> +    'x', 'y', 'w', 'h',
>  };
> 
>  enum {
> @@ -74,12 +74,12 @@ static int addroi_config_input(AVFilterLink *inlink)
> 
>          val = av_expr_eval(ctx->region_expr[i], vars, NULL);
>          if (val < 0.0) {
> -            av_log(avctx, AV_LOG_WARNING, "Calculated value %g for %s is
> "
> +            av_log(avctx, AV_LOG_WARNING, "Calculated value %g for %c is
> "
>                     "less than zero - using zero instead.\n", val,
>                     addroi_param_names[i]);
>              val = 0.0;
>          } else if (val > max_value) {
> -            av_log(avctx, AV_LOG_WARNING, "Calculated value %g for %s is
> "
> +            av_log(avctx, AV_LOG_WARNING, "Calculated value %g for %c is
> "
>                     "greater than maximum allowed value %d - "
>                     "using %d instead.\n", val, addroi_param_names[i],
>                     max_value, max_value); @@ -194,7 +194,7 @@ static
> av_cold int addroi_init(AVFilterContext *avctx)
>                              0, avctx);
>          if (err < 0) {
>              av_log(ctx, AV_LOG_ERROR,
> -                   "Error parsing %s expression '%s'.\n",
> +                   "Error parsing %c expression '%s'.\n",
>                     addroi_param_names[i], ctx->region_str[i]);
>              return err;
>          }
> --
this patch LGTM
diff mbox series

Patch

diff --git a/libavfilter/vf_addroi.c b/libavfilter/vf_addroi.c
index 489998ce73..d6b83ee854 100644
--- a/libavfilter/vf_addroi.c
+++ b/libavfilter/vf_addroi.c
@@ -26,8 +26,8 @@  enum {
     X, Y, W, H,
     NB_PARAMS,
 };
-static const char *addroi_param_names[] = {
-    "x", "y", "w", "h",
+static const char addroi_param_names[] = {
+    'x', 'y', 'w', 'h',
 };
 
 enum {
@@ -74,12 +74,12 @@  static int addroi_config_input(AVFilterLink *inlink)
 
         val = av_expr_eval(ctx->region_expr[i], vars, NULL);
         if (val < 0.0) {
-            av_log(avctx, AV_LOG_WARNING, "Calculated value %g for %s is "
+            av_log(avctx, AV_LOG_WARNING, "Calculated value %g for %c is "
                    "less than zero - using zero instead.\n", val,
                    addroi_param_names[i]);
             val = 0.0;
         } else if (val > max_value) {
-            av_log(avctx, AV_LOG_WARNING, "Calculated value %g for %s is "
+            av_log(avctx, AV_LOG_WARNING, "Calculated value %g for %c is "
                    "greater than maximum allowed value %d - "
                    "using %d instead.\n", val, addroi_param_names[i],
                    max_value, max_value);
@@ -194,7 +194,7 @@  static av_cold int addroi_init(AVFilterContext *avctx)
                             0, avctx);
         if (err < 0) {
             av_log(ctx, AV_LOG_ERROR,
-                   "Error parsing %s expression '%s'.\n",
+                   "Error parsing %c expression '%s'.\n",
                    addroi_param_names[i], ctx->region_str[i]);
             return err;
         }