From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 2A46F4A3A6 for ; Wed, 27 Mar 2024 12:15:47 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5F3A368D657; Wed, 27 Mar 2024 14:15:45 +0200 (EET) Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9E5B968D62B for ; Wed, 27 Mar 2024 14:15:38 +0200 (EET) Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-56c441e66a5so171334a12.0 for ; Wed, 27 Mar 2024 05:15:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711541737; x=1712146537; darn=ffmpeg.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:to:from:date:from:to:cc:subject :date:message-id:reply-to; bh=Al2x8/1DE+jKhs495IrA0F0amjzAB2elQlCDnuVcrzc=; b=OvfiPfpcAyl3xVR2LCe90ZRmBB5b5vhATkXoNDGsc8vO7rafEwBzdCkU4mQPiJtRg4 y489geJCQus85hB/3zEN9Chyx3oESiCJolXMz4MJqh8xgBAnwhDnPA9IdA/DRDvVDO5U 4fp6eIJ4/KRoqlNsjaxX0BvN0m6KYxsc+F3Zu+B/OurUzenTDs0w4NA7FwYPF5dV7M68 4AwLje+tGRKluaf9l+oTTpCa62D+nMPwvLoxaoeNDMWZ8p8YIA12wwOsWdVFP6YnI6QI rdiwzgNcq/2UxhzlvYRNbCtCk+WeETtv7xu8/vIvOCn5VzWWWUzj+M1cWAixo905MSFc LXig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711541737; x=1712146537; h=user-agent:in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Al2x8/1DE+jKhs495IrA0F0amjzAB2elQlCDnuVcrzc=; b=Kd19BKo6SReZgmX5mKqQvzTm5+YbkDHiVKC7lAX/TEHHvOg8tzTbKix2RJv8JYGAQw O+f5vMvRapHlTswItHql8JyA94P1Tklr2xwX5v+2q/dNSU30CaJMmnBCqnxC8Z5FrZgZ rtI3npZWW/vvveIz32rZgXVgWfRN3YBJkokbHIGTPNt3rEJoi2BV4xnEsqiwt8UgQzfk 2EOgHzLyYveeeGjpSGC5RDyCqtiaSg7j3mPooIN4sHLuoPqCFDrCe/WFZ9ElDBsrCYxQ Z9RlofUemKOMZSdEEwoQoX/irq++c5pOCHjifPf4qq8zdeZ/sCgiCp8dDbmK9dB+ZXg9 hm4A== X-Gm-Message-State: AOJu0Yx5ArEPGynuDl3uAG0MJ6yzoNHqePR0vQSsQJR0SBUDi8zoMZSb ZKKftCXZHIBqJAA/pnTU0Nsq/iW+7Mg5Cv5l742TSMR40MJpVvgDJn6FO+kU X-Google-Smtp-Source: AGHT+IGRkvb269nr3sDcj0VPUlghA8nTUdVOhuVNhiFNjVNPaFoIcAOnbTnsdCmL2rlClKLqjidP+g== X-Received: by 2002:a50:d71a:0:b0:566:777:af4f with SMTP id t26-20020a50d71a000000b005660777af4fmr1775786edi.1.1711541736901; Wed, 27 Mar 2024 05:15:36 -0700 (PDT) Received: from mariano (net-93-70-84-101.cust.vodafonedsl.it. [93.70.84.101]) by smtp.gmail.com with ESMTPSA id ij5-20020a056402158500b0056c09fda4e6sm3853448edb.54.2024.03.27.05.15.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 05:15:36 -0700 (PDT) Received: by mariano (Postfix, from userid 1000) id 83FE8BFCE4; Wed, 27 Mar 2024 13:08:05 +0100 (CET) Date: Wed, 27 Mar 2024 13:08:05 +0100 From: Stefano Sabatini To: FFmpeg development discussions and patches Message-ID: Mail-Followup-To: FFmpeg development discussions and patches References: <20240326201749.1543553-1-marth64@proxyid.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.1.4 (2021-12-11) Subject: Re: [FFmpeg-devel] [PATCH] avformat/dvdvideodec: remove `if ((ret = ...) < 0)` pattern 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On date Wednesday 2024-03-27 12:32:11 +0100, Andreas Rheinhardt wrote: > Marth64: > > Recent advice plus my own experience agree that this pattern > > is error-prone. Instead, set `ret` in its own line and do > > the error validation after. Also, explicitly return 0 on success > > in dvdvideo_chapters_setup_preindex() > > > > Signed-off-by: Marth64 > > --- > > libavformat/dvdvideodec.c | 132 +++++++++++++++++++++++++------------- > > 1 file changed, 86 insertions(+), 46 deletions(-) [...] > When I argued against the "if ((ret = ...) < 0)" pattern, I meant single > checks. In chained cases like the above the compactness outweighs the > potential precedence problem. Holding the patch for now, so it can be reworked to reduce the scope of this change. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".