From patchwork Fri Mar 17 15:02:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devin Heitmueller X-Patchwork-Id: 40711 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:d046:b0:cd:afd7:272c with SMTP id hv6csp635912pzb; Fri, 17 Mar 2023 08:02:48 -0700 (PDT) X-Google-Smtp-Source: AK7set9I388AayJ0Jq+3iTKluJgCLYZCYy8ZZSAFFrgeolaPq19NjBYcLGevzQ3m5NZZW5ElYPdv X-Received: by 2002:a17:907:2c59:b0:921:412b:d8c1 with SMTP id hf25-20020a1709072c5900b00921412bd8c1mr13689688ejc.71.1679065368609; Fri, 17 Mar 2023 08:02:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679065368; cv=none; d=google.com; s=arc-20160816; b=W6YTccI8yFSpjtXO6PwGQLt3k+l+AGOrbJJ90z4qBsOPvLeB9H/01RqTGxssxOW8sV 191eWnk3My6sSzgWEr8zXFBgo2KUVqBCqgwjjnujJKvjjJCvHR6FUN+OeoaXILFXxiys Q2F50wz+9+jjifjF6Mo0v66KKV9L5zH1BA+BLSzUUOzc+2ez4d4p6mH17n21J+htsoXi PY+ucev4prDMyP+tkpcFgFudEGGaTC/Ph2fhVIj9Syj8gI71WhHKUkJrP0w/y/iMhpPz rYPMBjnhHHZzxdQaoP2mPSa5ZlzeshMJMJ1rzUgLyPziECl/AxeR8kcm2ZBJvNULbFoU VfKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=lsiU7fXbnEfxWHjTTRsSMzXSeowsVK0SrMf7kG6k2r0=; b=noAEUIdk7ctda+m5T73mkUYKW2OoTGdE5miXRBibLZDkWTf2Pn1fLRLtzWLluxdBOA 8V9ReBrOeUj2IVqeRaZJXUbNSIUoyP7PhPVOrBR6XvhsalpSBEwkjEutUcVtC4b95qXZ bVT8XuxyJADw6Q/sLpOdNriumCMz9vjBcotgm2fZDH+2+kMdO3VrGAiaUmCE7ZGGCzTA R7Ov1befRw/Qay8LdtI8brEW69fbfvLrwX6sETpY3Wv5EFEqJaRJbbPCm83IR1i9iixY bhOJ37PLECq2kVzMSE0T5M0MGbFmk/RgF5pz7ZXwu8p3joSG4aDs89mKMCuJprbJFXeq X/ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@ltnglobal-com.20210112.gappssmtp.com header.s=20210112 header.b=VxdCsaDg; 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 i14-20020a1709064ece00b00930ca0feb65si2280374ejv.1001.2023.03.17.08.02.47; Fri, 17 Mar 2023 08:02:48 -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=@ltnglobal-com.20210112.gappssmtp.com header.s=20210112 header.b=VxdCsaDg; 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 4B4CC68C1D1; Fri, 17 Mar 2023 17:02:44 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A944D68C198 for ; Fri, 17 Mar 2023 17:02:37 +0200 (EET) Received: by mail-qt1-f173.google.com with SMTP id r16so5844314qtx.9 for ; Fri, 17 Mar 2023 08:02:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ltnglobal-com.20210112.gappssmtp.com; s=20210112; t=1679065356; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=eB3QUOtYzHOtOttNDyuOMgkcn/tWlRQ7wEcXjvawcn8=; b=VxdCsaDgLNlgSwE6sgKGZ79A+VqhJMRV9D+rKggpPNsgXSgH0brfi878Kk1kARbffC Ym060dOX6WrdzyowGuqbZS5yKajsrWSsXz8nlprvmvz9gUd+bZ/L9cxu1WgwPn1yNpgr 09FwmCalZuQ8AEciCzPWuqHz/0/T5earpurPynE6X88l/PRCbmQnvhc7q9Q7sC1hZFxS aZubnb2fmDnS1j+uQYdC/EPx5LwsyI+CyEa5XAJaZMW7akR2ngw726A4HZyHqt8E7QCA hvdPQZEab6bsYFNl3owN99Dh9l5ZA8y5AbEPWz/HE1idbbJsr5mE/3DkE2HcHNIQsdXM vLXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679065356; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=eB3QUOtYzHOtOttNDyuOMgkcn/tWlRQ7wEcXjvawcn8=; b=FrRQx3HcefPt5yEVknAZUfNziD/jglwgdn7ZyBzjIhudmC/sge2yyeEUCroupKrb31 W7RP6RqJjPMS3LIMn+HAiyenZR+DlnzBNFiir4dNAj3slUTlnHkeoUwvatxQsOyIIKFq VZ5ixapDvwQP7J0AFH02fyFTuKfIU4WiiNKbLgbRQ/xW4ZrXliQbb1mYqLfZX7rmktQ7 IjkjK0dTpWDFyVM0eVR8TUx4kZ9PM7NUdREi1JmEs75zk8WovyKpG+BLhhLcOjjMYBNh rvQJ66J9/8yUK5Kg0tjdPn96dOTxuA4OKxFTEplcXlFlqnxSeqO2ulN4qsgbvZHcJobZ QKaA== X-Gm-Message-State: AO0yUKWTWpxgfLBTrcp0XnzMjAEjaEHy/hCoL392KRRh8AW82zJ5vVme r4g8XUhdbvqaQo5pwmR5axaAayeOkL6xxGCAWVM= X-Received: by 2002:ac8:5a0c:0:b0:3bf:e796:bfdd with SMTP id n12-20020ac85a0c000000b003bfe796bfddmr5977278qta.9.1679065356112; Fri, 17 Mar 2023 08:02:36 -0700 (PDT) Received: from klab-nyc-kernellabs2.localdomain (pool-71-105-132-214.nycmny.fios.verizon.net. [71.105.132.214]) by smtp.gmail.com with ESMTPSA id v127-20020a379385000000b007456c75edbbsm1768469qkd.129.2023.03.17.08.02.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Mar 2023 08:02:35 -0700 (PDT) From: Devin Heitmueller X-Google-Original-From: Devin Heitmueller To: ffmpeg-devel@ffmpeg.org Date: Fri, 17 Mar 2023 11:02:31 -0400 Message-Id: <20230317150232.17804-1-dheitmueller@ltnglobal.com> X-Mailer: git-send-email 2.35.1.655.ga68dfadae5 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 1/2] avcodec: Fix warnings with signed/unsigned compare in bitstream.h X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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: Devin Heitmueller Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: VnUeXWNPDDPj When including the header in decklink_enc.cpp it would be fed through the C++ compiler rather than the C compiler, which has more strict warnings when comparing signed/unsigned values. Make the local variables unsigned to match the arguments they are being passed for those functions. Signed-off-by: Devin Heitmueller --- libavcodec/bytestream.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavcodec/bytestream.h b/libavcodec/bytestream.h index d0033f14f3..67080604b9 100644 --- a/libavcodec/bytestream.h +++ b/libavcodec/bytestream.h @@ -180,7 +180,7 @@ static av_always_inline void bytestream2_skipu(GetByteContext *g, static av_always_inline void bytestream2_skip_p(PutByteContext *p, unsigned int size) { - int size2; + unsigned int size2; if (p->eof) return; size2 = FFMIN(p->buffer_end - p->buffer, size); @@ -268,7 +268,7 @@ static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g, uint8_t *dst, unsigned int size) { - int size2 = FFMIN(g->buffer_end - g->buffer, size); + unsigned int size2 = FFMIN(g->buffer_end - g->buffer, size); memcpy(dst, g->buffer, size2); g->buffer += size2; return size2; @@ -287,7 +287,7 @@ static av_always_inline unsigned int bytestream2_put_buffer(PutByteContext *p, const uint8_t *src, unsigned int size) { - int size2; + unsigned int size2; if (p->eof) return 0; size2 = FFMIN(p->buffer_end - p->buffer, size); @@ -311,7 +311,7 @@ static av_always_inline void bytestream2_set_buffer(PutByteContext *p, const uint8_t c, unsigned int size) { - int size2; + unsigned int size2; if (p->eof) return; size2 = FFMIN(p->buffer_end - p->buffer, size); @@ -348,7 +348,7 @@ static av_always_inline unsigned int bytestream2_copy_buffer(PutByteContext *p, GetByteContext *g, unsigned int size) { - int size2; + unsigned int size2; if (p->eof) return 0;