From patchwork Thu Oct 8 19:18:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 22763 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 157BD44B18A for ; Thu, 8 Oct 2020 22:19:22 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 00A8768B92A; Thu, 8 Oct 2020 22:19:22 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E54AD68B90D for ; Thu, 8 Oct 2020 22:19:14 +0300 (EEST) Received: by mail-wm1-f65.google.com with SMTP id p15so7562793wmi.4 for ; Thu, 08 Oct 2020 12:19:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=p9QMqfkVBlXoylAf10fK17AGha4xz2sE42I73SfXf0w=; b=oHukVdvsiUzA82/OUfNKShP33AyuDqRJBRTLSvQCP0f00tRVAj1P8oLVpIaWGlNkea k4+JDJXSMInVdEUoTW0QbgZtze4YU1DhvXMvO1JiSA8aLtgHmMBQTC1D0oQPJS4hMi7C /XsDpdaD66Ks4vPpHlCFR5e9cEiUrF9juit/r9UwrlA0sNN3saEanadxBGsSPoN5fFTB yFiaMTZbCSAu/N0+MpPIzkFI/sQrgu434wjHqP15KeiWM1D1/A03hkEnh+panBPvm2Ay ZpqT1NLTrunUNMfb5oXckwRoqjZBN9E44/x0zLgQ2epuCvev8InszHVN/n+e61mtETvs O8kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=p9QMqfkVBlXoylAf10fK17AGha4xz2sE42I73SfXf0w=; b=uEsPEs+qA67oIhLRFDmXottnOSjD1w8u4JXVqbWCM4q3vnNL9DTEMiMJ/FWd6axMnY YvdZS5NKyQfHvSvGMtigAQ1n/mL4E9h+cTLPbAy1E8CKgqlD0fSuRakEVMgv7XuWLqsd 840x43Sxna7mWnBprKQhI9dJnfqOgHZtksAT1tAu2yoCqctf+yPXEi2V8Hu8z9aqqCTs LB8pZRsyny9IkblP3tV6Zl7zNiS/Vr6+tNrWZ1CGt+LZGY9CXfo3Nh6RDEq0H6A1QjOq hayLCKXLx/JFGtC2GD1CyMdokgHkfWbz0ihW47xxaq8FkZMkJKLZ8OAwkJKlO+3dPAgn 6dGw== X-Gm-Message-State: AOAM531HUX+KcRJY+P6vJQ336QCyFgyp8mb8isMvvuAN8+ulSTfgNtim 2RXDL7K1N8QKPI/evq+gqSa52lfH/+s= X-Google-Smtp-Source: ABdhPJyb0+irWX19E9RYy9R1EDKzhNhX/zwMRVaWL4wXhddv5dVeHYzK/KGs09f8MvwfOxstF6GUuA== X-Received: by 2002:a1c:9885:: with SMTP id a127mr10394705wme.8.1602184754216; Thu, 08 Oct 2020 12:19:14 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id u17sm9280316wri.45.2020.10.08.12.19.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2020 12:19:13 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 8 Oct 2020 21:18:42 +0200 Message-Id: <20201008191842.385813-4-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201008191842.385813-1-andreas.rheinhardt@gmail.com> References: <20201008191842.385813-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/4] avcodec/magicyuvenc: Use more correct cast in compare function 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" There is no need to cast const away (even if it was harmless) and to copy the object at all. Signed-off-by: Andreas Rheinhardt --- libavcodec/magicyuvenc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/magicyuvenc.c b/libavcodec/magicyuvenc.c index 1b8bb53114..440b3514c3 100644 --- a/libavcodec/magicyuvenc.c +++ b/libavcodec/magicyuvenc.c @@ -280,9 +280,9 @@ typedef struct PackageMergerList { static int compare_by_prob(const void *a, const void *b) { - PTable a_val = *(PTable *)a; - PTable b_val = *(PTable *)b; - return a_val.prob - b_val.prob; + const PTable *a2 = a; + const PTable *b2 = b; + return a2->prob - b2->prob; } static void magy_huffman_compute_bits(PTable *prob_table, HuffEntry *distincts,