From patchwork Thu Jul 19 00:35:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Eugen Hoyos X-Patchwork-Id: 9754 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:104:0:0:0:0:0 with SMTP id c4-v6csp1132737jad; Wed, 18 Jul 2018 17:35:57 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf85HV14BXWo2irvujwfIMT0fFFCXiOmABt/8Yr9RUd2eXcTy3bToqqeYK6MgjnPwyB8XHk X-Received: by 2002:a1c:e189:: with SMTP id y131-v6mr2711399wmg.44.1531960557312; Wed, 18 Jul 2018 17:35:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531960557; cv=none; d=google.com; s=arc-20160816; b=JQ89F/JSQu/fub4p7wEjPxTjJd3dvpTvf/rOKcPmoyoR8vllSS1Ka+gEPfO7X1nxBH Vptt90wTHE8vabaK/3huaOlZUJxEy9u1Bbri4q89QwKWyFN4YXomtdORJW8DGsp1lJVA kMb5FjOEZQD89CYQPnzi7kjU15+YqJCoeeK6pHMHL1mLiPZg3dzSgWPFaHj0oGU13DQP rJgu2kCMkH5KFO0lM4jpR14eNAwMwYrPOlG6rqK/w3ipD1EatYjJ5VXXYGuKw/LWGdVE oCQOQI/se2X1aJlZcEY78N61XUoXnI/YBltJOb+UMkUIUhO/MeW3n9ZHo2rd333YHTUK LuAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:to :message-id:date:from:mime-version:dkim-signature:delivered-to :arc-authentication-results; bh=DZfptOzser6jNhUS0r6tL08bb+7SOf0Ohc7jV0X70ws=; b=z1qNRYzC5RtdmWyVH50g9IN5y3IMkYh6Wet6yFW060TE4wnvAXkKw/l0DBuSW15xeX UqG0fBLVitiILfv2ITnzitxCHT2WDj3u2sMSM8F3pMaHQZP+x6dveJB82I0SlH3RRIZe OmQiHrw9X47Hdjm9gVDmkQ3bgdUeZdqbcfAYaVhv8gi6mu1Bx3pbCcl7/qoV3+/UaQSq 1E7YNZ/VQMvLscuVqDE345y6oEdHdk3EXJpDdOhDqeoZd7uLYDG5DA/UqJ/1IdaB9ngB byzC6Qojv2Nbk5K7UmMSoVSvPZKAgd3Rc0uJMKBI1qyxeEc0jzRPzZOzaDp3sL/bi58m R0KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=J2m18mr0; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id y15-v6si3975704wrg.326.2018.07.18.17.35.56; Wed, 18 Jul 2018 17:35:57 -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=@gmail.com header.s=20161025 header.b=J2m18mr0; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7CDCD689BDF; Thu, 19 Jul 2018 03:35:43 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-it0-f41.google.com (mail-it0-f41.google.com [209.85.214.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A8737680754 for ; Thu, 19 Jul 2018 03:35:36 +0300 (EEST) Received: by mail-it0-f41.google.com with SMTP id v71-v6so6946696itb.3 for ; Wed, 18 Jul 2018 17:35:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=w7jzwN5Cc4I4p1MWb0YYOdQIg90MDdXs1fH18FGiQKg=; b=J2m18mr0C9eEcRQSdkSHD5LZXUEAmgUaNSjU9T4dJeXki3j7U+4pKAMC5ZpNFpv3ZT PiVIOwzE88XYXqhAlimTe22YlJIrubozchXUMIsi+MV8va072S9ur/EgOlNlEMxbviqo pW8fDjrr4/7SCF9DvmeX7gBiP3tqcoFDVku1n7pXJavfhkvXu6rtfOseh4P8Xcw5SbSu kmU6E8JylZXlFTzaSzCR67v7BYLjixUE+XNOTx94xeb7Xw+R1z/Oos2QbWiCQf7hGJFU 0Wzy4aMuLFjZRAeDdd6JvTrrPLB0CUnJ7zbRz/nq+GFJi+Glx6wwZ2D3f1llBa3Mg1jh Yltg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=w7jzwN5Cc4I4p1MWb0YYOdQIg90MDdXs1fH18FGiQKg=; b=iI41MSnzfSXcPGuglWKJrVfVvbDk1E0UGKYr4Zgid7Jv3EOYYY8OhuiGiyTtRbISRq 4/K5SrjcQt0clgwmctwvsagoi+NIrIgyUG3fPGVSgreYdNxS5vkAqFj7357Benxxhv46 1qX+ks8Zr+KcLtu+kC8siBSCTAe+QHXzTJNWA6LdSzArerVcJz/kONlaQU2FkffP7VH5 spN91JU4Mj9EYO+2RO5x7Ti7XdBHr7gBH6OzznV81/gMvu6TOMhc6ZQoKEU0LVsrH9n6 bs2HbJ5N4WoZH0yzsOECyEgdZ7l+nJM+ti9Ap2lcQxxpTdB+N00iDhj4N/iK1wOhaU2Y oHbg== X-Gm-Message-State: AOUpUlEE2JEL7Cly4tc+ME9J5lKkEyr+o0kfEpIxQYqiJ/zguYcogqdd ry3UsCdHsz26xnjh+naPtyqE9vXq5Uif3Hs43Nw= X-Received: by 2002:a24:cb03:: with SMTP id u3-v6mr3920717itg.15.1531960546379; Wed, 18 Jul 2018 17:35:46 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:7117:0:0:0:0:0 with HTTP; Wed, 18 Jul 2018 17:35:45 -0700 (PDT) From: Carl Eugen Hoyos Date: Thu, 19 Jul 2018 02:35:45 +0200 Message-ID: To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH]lavfi/af_aiir, af_afir: Remove a variable that is always -1 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Hi! Two very similar conditions in af_aiir.c and af_afir.c can never be true afaict. Please review, Carl Eugen From 6c83ac40c1c83987fe4bc408e5408166815b88d8 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Thu, 19 Jul 2018 02:28:25 +0200 Subject: [PATCH] lavfi/af_afir,af_aiir: Remove a variable that is always -1. Fixes two warnings: libavfilter/af_afir.c:194:45: warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Wstrict-overflow] int dx = FFABS(x1-x0), sx = x0 < x1 ? 1 : -1; ~~~~~~~~~~~~^~~~ libavfilter/af_aiir.c:689:45: warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Wstrict-overflow] int dx = FFABS(x1-x0), sx = x0 < x1 ? 1 : -1; ~~~~~~~~~~~~^~~~ --- libavfilter/af_afir.c | 4 ++-- libavfilter/af_aiir.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libavfilter/af_afir.c b/libavfilter/af_afir.c index 75de147..a4a7160 100644 --- a/libavfilter/af_afir.c +++ b/libavfilter/af_afir.c @@ -191,7 +191,7 @@ static void drawtext(AVFrame *pic, int x, int y, const char *txt, uint32_t color static void draw_line(AVFrame *out, int x0, int y0, int x1, int y1, uint32_t color) { - int dx = FFABS(x1-x0), sx = x0 < x1 ? 1 : -1; + int dx = FFABS(x1-x0); int dy = FFABS(y1-y0), sy = y0 < y1 ? 1 : -1; int err = (dx>dy ? dx : -dy) / 2, e2; @@ -205,7 +205,7 @@ static void draw_line(AVFrame *out, int x0, int y0, int x1, int y1, uint32_t col if (e2 >-dx) { err -= dy; - x0 += sx; + x0--; } if (e2 < dy) { diff --git a/libavfilter/af_aiir.c b/libavfilter/af_aiir.c index 65c8201..9a4769c 100644 --- a/libavfilter/af_aiir.c +++ b/libavfilter/af_aiir.c @@ -686,7 +686,7 @@ static void drawtext(AVFrame *pic, int x, int y, const char *txt, uint32_t color static void draw_line(AVFrame *out, int x0, int y0, int x1, int y1, uint32_t color) { - int dx = FFABS(x1-x0), sx = x0 < x1 ? 1 : -1; + int dx = FFABS(x1-x0); int dy = FFABS(y1-y0), sy = y0 < y1 ? 1 : -1; int err = (dx>dy ? dx : -dy) / 2, e2; @@ -700,7 +700,7 @@ static void draw_line(AVFrame *out, int x0, int y0, int x1, int y1, uint32_t col if (e2 >-dx) { err -= dy; - x0 += sx; + x0--; } if (e2 < dy) { -- 1.7.10.4