[FFmpeg-cvslog] avfilter/vf_morpho: Rename functions to unbreak MSVC

Andreas Rheinhardt git at videolan.org
Wed Sep 29 10:33:44 EEST 2021


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Wed Sep 29 09:17:46 2021 +0200| [b2538ce578ef729c5437465fd845e877d5151a39] | committer: Andreas Rheinhardt

avfilter/vf_morpho: Rename functions to unbreak MSVC

MSVC's headers include function-like macros min and max which
collide with function pointers in vf_morpho.c, leading to
compilation failures. Fix this by renaming said function pointers.

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b2538ce578ef729c5437465fd845e877d5151a39
---

 libavfilter/vf_morpho.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/libavfilter/vf_morpho.c b/libavfilter/vf_morpho.c
index fd181ddaa5..e45f7522f8 100644
--- a/libavfilter/vf_morpho.c
+++ b/libavfilter/vf_morpho.c
@@ -49,8 +49,8 @@ typedef struct IPlane {
     int depth;
     int type_size;
 
-    void (*max)(uint8_t *c, const uint8_t *a, const uint8_t *b, int x);
-    void (*min)(uint8_t *c, const uint8_t *a, const uint8_t *b, int x);
+    void (*max_out_place)(uint8_t *c, const uint8_t *a, const uint8_t *b, int x);
+    void (*min_out_place)(uint8_t *c, const uint8_t *a, const uint8_t *b, int x);
     void (*max_in_place)(uint8_t *a, const uint8_t *b, int x);
     void (*min_in_place)(uint8_t *a, const uint8_t *b, int x);
 } IPlane;
@@ -304,7 +304,7 @@ static void compute_min_row(IPlane *f, LUT *Ty, chord_set *SE, int r, int y)
     for (int i = 1; i < SE->Lnum; i++) {
         int d = SE->R[i] - SE->R[i - 1];
 
-        f->min(Ty->arr[r][i] - Ty->pre_pad_x * f->type_size,
+        f->min_out_place(Ty->arr[r][i] - Ty->pre_pad_x * f->type_size,
             Ty->arr[r][i - 1] - Ty->pre_pad_x * f->type_size,
             Ty->arr[r][i - 1] + (d - Ty->pre_pad_x) * f->type_size,
             Ty->X + Ty->pre_pad_x - d);
@@ -358,7 +358,7 @@ static void compute_max_row(IPlane *f, LUT *Ty, chord_set *SE, int r, int y)
     for (int i = 1; i < SE->Lnum; i++) {
         int d = SE->R[i] - SE->R[i - 1];
 
-        f->max(Ty->arr[r][i] - Ty->pre_pad_x * f->type_size,
+        f->max_out_place(Ty->arr[r][i] - Ty->pre_pad_x * f->type_size,
             Ty->arr[r][i - 1] - Ty->pre_pad_x * f->type_size,
             Ty->arr[r][i - 1] + (d - Ty->pre_pad_x) * f->type_size,
             Ty->X + Ty->pre_pad_x - d);
@@ -685,8 +685,8 @@ static int read_iplane(IPlane *imp, const uint8_t *dst, int dst_linesize,
     imp->range = R;
     imp->depth = depth;
     imp->type_size = type_size;
-    imp->max = type_size == 1 ? max_fun : max16_fun;
-    imp->min = type_size == 1 ? min_fun : min16_fun;
+    imp->max_out_place = type_size == 1 ? max_fun : max16_fun;
+    imp->min_out_place = type_size == 1 ? min_fun : min16_fun;
     imp->max_in_place = type_size == 1 ? maxinplace_fun : maxinplace16_fun;
     imp->min_in_place = type_size == 1 ? mininplace_fun : mininplace16_fun;
 



More information about the ffmpeg-cvslog mailing list