From patchwork Tue Jun 6 05:05:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Earnest X-Patchwork-Id: 3855 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.10.2 with SMTP id 2csp1677295vsk; Mon, 5 Jun 2017 22:05:38 -0700 (PDT) X-Received: by 10.223.134.161 with SMTP id 30mr7707549wrx.20.1496725538510; Mon, 05 Jun 2017 22:05:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496725538; cv=none; d=google.com; s=arc-20160816; b=cqyX2Cy+Ssi0tNmqAAY3XlLBEdx/u7ObkX1Ll3cMXwIevTZgIzF57qDjOKIFRt1JTO MB+DYAn1NRkFcD+0smE1Zfu3f7CVF5rbaiLrY1PWVcFpQyNzAe7QogjNZQi5PBJ7WbSH HWiP3X9b1DjMvFnZFvhJJK5ydKSTFWJLZCR28GkW6kVdZR0CR72m6mYtyEQcjHuFBae4 ZuBmhFSFZJY+Au47XcYTyrkUpzhNSnu9KwQTbZ+V1XGiKtIp1RYr10N8wBWNsSr/Z85M 27+Z4qQDI+DL8euuRDBSpaaREr9UQ+Xq2Nu7qvfwXU6wgxAoNeVV3Bqi/CT61U1QdadW 5EaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=6pl5m7p8ndNdFAZXJVMNRvucvSOwcGVp6cH5J8pVI1Y=; b=FlIeImJpWjM7ob3CFm5DStenHTLMH5UmlO94BnoH9+0X4g58ItO+TgSJLyv9+eDvMp F7q3IAEK5+LOb9x9wuTa+rraQe2vM0+GiSKsmIgGHPU+MvX756iKU7UnPFm85gT3Joz2 tMBaZKnSKpBARtu7w6rTVZ9ijtwD1G68PQwuT5MzhI8nhwcm2dPwhMv3VW9nYvJcvw+k aVOGHjI8oROibs4d8wj7Gs4phd7IkPHkFYwh1Oe1GP+i/4biOXi+/P+61qFkJ7OowjH/ bEiu8C8kBvponJH/U0lq0jV+00lgOTda/Uvpz7fZSxB5/9M8C3qkQJQhwBIrBCl3Y8cO 8vew== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@pobox.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 80si14892231wmt.84.2017.06.05.22.05.37; Mon, 05 Jun 2017 22:05:38 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@pobox.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2DA436891FB; Tue, 6 Jun 2017 08:05:28 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from sasl.smtp.pobox.com (pb-smtp2.pobox.com [64.147.108.71]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 97ACF680D18 for ; Tue, 6 Jun 2017 08:05:21 +0300 (EEST) Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 4D41393544; Tue, 6 Jun 2017 01:05:26 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:date:message-id; s=sasl; bh=G2vb+SQVXf0qzhm6PGu4jAeOl5E =; b=FqFmTT/ksefIuheMpHxBPDWUjnWNQdPh9XEiwtT4GuNrwnHxPj/MfpE5KkM 9Zeje7O8SP9nCt8QR4AvtwD8d2kBAPeMWRNbs5f+zIrbRJPMhuBDQzDNbGm6mNiv fTQWhJS6QLu6mSbeymghLuVvk8vsqHH0cShuye/Auw2n5M14= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 4678293543; Tue, 6 Jun 2017 01:05:26 -0400 (EDT) Received: from localhost.localdomain (unknown [72.161.35.106]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id 8E5D793542; Tue, 6 Jun 2017 01:05:24 -0400 (EDT) From: Patrick Earnest To: ffmpeg-devel@ffmpeg.org Date: Tue, 6 Jun 2017 01:05:12 -0400 Message-Id: <20170606050512.60448-1-patrick@patrickearnest.com> X-Mailer: git-send-email 2.11.0 (Apple Git-81) X-Pobox-Relay-ID: BFF9E31E-4A75-11E7-9B4E-61520C78B957-83932494!pb-smtp2.pobox.com Subject: [FFmpeg-devel] [PATCH] libavcodec/videotoolboxenc.c: Fix 3 'discards qualifiers' clang compiler warnings X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Patrick Earnest MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 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);