History

avfilter/blend_modes: Always preserve constness

These casts cast const away temporarily; they are safe, because the pointers that are initialized point to const data. But this is nevertheless not nice and leads to warnings when using -Wcast-qual. blend_modes.c generates 546 (2*39*7) such warnings which is the majority of such warnings for FFmpeg as a whole. vf_blend.c and vf_blend_init.h also use this pattern; they have also been changed.

Andreas Rheinhardt committed 3 years ago

Commit 44dcc4d1 parent 29c6f433 files · +6 −6Browse files

Unified · Split

3 files
  1. libavfilter/blend_modes.c +2 −2
  2. libavfilter/vf_blend.c +2 −2
  3. libavfilter/vf_blend_init.h +2 −2
libavfilter/blend_modes.c+2−2
@@ -93,8 +93,8 @@ static void fn0(NAME)(const uint8_t *_top, ptrdiff_t top_linesize, \ · 92 unmodified lines
93 ptrdiff_t width, ptrdiff_t height, \93 ptrdiff_t width, ptrdiff_t height, \
94 FilterParams *param, double *values, int starty) \94 FilterParams *param, double *values, int starty) \
95{ \95{ \
96 const PIXEL *top = (PIXEL *)_top; \96 const PIXEL *top = (const PIXEL *)_top; \
97 const PIXEL *bottom = (PIXEL *)_bottom; \97 const PIXEL *bottom = (const PIXEL *)_bottom; \
98 PIXEL *dst = (PIXEL *)_dst; \98 PIXEL *dst = (PIXEL *)_dst; \
99 const float opacity = param->opacity; \99 const float opacity = param->opacity; \
100 \100 \
libavfilter/vf_blend.c+2−2
@@ -133,8 +133,8 @@ static void blend_expr_## name(const uint8_t *_top, ptrdiff_t top_linesize, · 132 unmodified lines
133 ptrdiff_t width, ptrdiff_t height, \133 ptrdiff_t width, ptrdiff_t height, \
134 FilterParams *param, double *values, int starty) \134 FilterParams *param, double *values, int starty) \
135{ \135{ \
136 const type *top = (type*)_top; \136 const type *top = (const type*)_top; \
137 const type *bottom = (type*)_bottom; \137 const type *bottom = (const type*)_bottom; \
138 type *dst = (type*)_dst; \138 type *dst = (type*)_dst; \
139 AVExpr *e = param->e; \139 AVExpr *e = param->e; \
140 int y, x; \140 int y, x; \
libavfilter/vf_blend_init.h+2−2
@@ -82,8 +82,8 @@ static void blend_normal_##name(const uint8_t *_top, ptrdiff_t top_linesize, · 81 unmodified lines
82 ptrdiff_t width, ptrdiff_t height, \82 ptrdiff_t width, ptrdiff_t height, \
83 FilterParams *param, double *values, int starty) \83 FilterParams *param, double *values, int starty) \
84{ \84{ \
85 const type *top = (type*)_top; \85 const type *top = (const type*)_top; \
86 const type *bottom = (type*)_bottom; \86 const type *bottom = (const type*)_bottom; \
87 type *dst = (type*)_dst; \87 type *dst = (type*)_dst; \
88 const float opacity = param->opacity; \88 const float opacity = param->opacity; \
89 \89 \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t