[FFmpeg-devel] [PATCH] libavcodec/videotoolboxenc.c: Fix 3 'discards qualifiers' clang compiler warnings
When compiled by clang, libavcodec/videotoolboxenc.c produces three warnings: libavcodec/videotoolboxenc.c:962:13: warning: assigning to 'void *' from 'CFNumberRef' (aka 'const struct __CFNumber *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] nums[0] = bytes_per_second; ^ libavcodec/videotoolboxenc.c:963:13: warning: assigning to 'void *' from 'CFNumberRef' (aka 'const struct __CFNumber *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] nums[1] = one_second; ^ ~~ libavcodec/videotoolboxenc.c:965:38: warning: passing 'void *[2]' to parameter of type 'const void **' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers] nums, ^~~~ /System/Library/Frameworks/CoreFoundation.framework/Headers/CFArray.h:174:65: note: passing argument to parameter 'values' here CFArrayRef CFArrayCreate(CFAllocatorRef allocator, const void **values, CFIndex numValues, const CFArrayCallBacks *callBacks); ^ 3 warnings generated. Changing type of nums[2] from void * to CFNumberRef silences the first two warnings. Adding a pointer (numsptr) to nums[2], and using that in CFArrayCreate silences the third warning. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] libavcodec/videotoolboxenc.c: Fix 3 'discards qualifiers' clang compiler warnings
This email should have the patch. Sorry for the duplicate. When compiled by clang, libavcodec/videotoolboxenc.c produces three 'discards qualifiers' warnings. Changing type of nums[2] from void * to CFNumberRef silences the first two warnings. Adding a pointer (numsptr) to nums[2], and using that in CFArrayCreate silences the third warning. Signed-off-by: Patrick Earnest --- libavcodec/videotoolboxenc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c index 638f278cd0..4cc4fbfef4 100644 --- a/libavcodec/videotoolboxenc.c +++ b/libavcodec/videotoolboxenc.c @@ -904,7 +904,8 @@ static int vtenc_create_encoder(AVCodecContext *avctx, CFArrayRef data_rate_limits; int64_t bytes_per_second_value = 0; int64_t one_second_value = 0; -void *nums[2]; +CFNumberRef nums[2]; +void *numsptr = nums; int status = VTCompressionSessionCreate(kCFAllocatorDefault, avctx->width, @@ -962,7 +963,7 @@ static int vtenc_create_encoder(AVCodecContext *avctx, nums[0] = bytes_per_second; nums[1] = one_second; data_rate_limits = CFArrayCreate(kCFAllocatorDefault, - nums, + numsptr, 2, &kCFTypeArrayCallBacks); -- 2.11.0 (Apple Git-81) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel