From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.1 Date: Fri, 13 Dec 2019 00:19:36 +0300 From: Andrey Savchenko To: ALT Linux Team development discussions Message-Id: <20191213001936.68fc71a7cc78600422b82b4e@altlinux.org> In-Reply-To: <20191212095730.83787-12-darktemplar@altlinux.org> References: <20191211234857.GB17949@altlinux.org> <20191212095730.83787-1-darktemplar@altlinux.org> <20191212095730.83787-12-darktemplar@altlinux.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA512"; boundary="Signature=_Fri__13_Dec_2019_00_19_36_+0300_D=u_Fgr7266rmfgj" Subject: Re: [devel] [PATCH for apt v2 11/21] Remove useless variable shadowing X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 21:19:44 -0000 Archived-At: List-Archive: List-Post: --Signature=_Fri__13_Dec_2019_00_19_36_+0300_D=u_Fgr7266rmfgj Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, 12 Dec 2019 12:57:20 +0300 Aleksei Nikiforov wrote: > Found via cppcheck: > [apt/cmdline/apt-cdrom.cc:66] -> [apt/cmdline/apt-cdrom.cc:149]: > (style) Local variable 'Buf' shadows outer variable > --- > apt/cmdline/apt-cdrom.cc | 1 - > 1 file changed, 1 deletion(-) >=20 > diff --git a/apt/cmdline/apt-cdrom.cc b/apt/cmdline/apt-cdrom.cc > index eded525..93ad41d 100644 > --- a/apt/cmdline/apt-cdrom.cc > +++ b/apt/cmdline/apt-cdrom.cc > @@ -146,7 +146,6 @@ bool FindPackages(string CD,vector &List,vect= or &SList, > #endif > =20 > // See if the name is a sub directory > - struct stat Buf; > if (stat(Dir->d_name,&Buf) !=3D 0) > continue; =20 > =20 LGTM since Buf declared outside of the for loop is not used after the loop and it is unlikely it will be ever dereferenced after the loop. Best regards, Andrew Savchenko --Signature=_Fri__13_Dec_2019_00_19_36_+0300_D=u_Fgr7266rmfgj Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE63ZIHsdeM+1XgNer9lNaM7oe5I0FAl3yrugACgkQ9lNaM7oe 5I0XdRAAtLNcWn3Jayw/IJHN19cLGRcwJBfQimGZ8WFN9Bu36f0kwofCmIEnepgt Rc4FvYsycb4Nj2JkvyZKtAlD5Da5pglynHd6fuczdAyiYAnw948tNAIHShs9S/ER n8SwLWptUZmedfEoqRzEkCvia2TNCOeAoip0V0O5FeIyD7XK5PY9K4ayizo7wim3 Fo+iTex2rnTLhZXhB2NCoxYK4EBfqPLSivDnC6Wd1M+PAoRWOrluIRCmu9ycMCNK m1jbAg9ynAdiAnpS8ut6x+cMMo8SrNCp+w4uI+Mn8+aqr8ZqBHi+87Pgm36r9Sst NfO5Oi7QEn0aOr11NYXjQxguhVts8+JmPHCLh45inKdSYCs9R42Hg8mqV1yUZ2bA 22Q16vvGbbipWRM3iYXKFWEKgyoKP8NXQV1Ldu6Nee9iuEcbRC3tbU4Cql0hlBzc veTVLJK8O938JUhW1pBh+38wGNVexW6TIGOkibCqIyM9kRiIh9vC/49wfq9v+lYz PMG5oJZnEGTRE4V/wsIGNmh1x+cQZA2/bttS1YmvNp5ThShSdU3aPRHwUH+XpCrm 4h/kbmHUXnRGmRiEHKu8ha2WkeSzd/bq4eKLKbDZqvY5iTxz5Ka+4q2MwfblO3/T M++r4R6qVkWMssRXhX3H+ex+FsEJkGCy3+T3a1p8ZbLtNTw/fO0= =qSZD -----END PGP SIGNATURE----- --Signature=_Fri__13_Dec_2019_00_19_36_+0300_D=u_Fgr7266rmfgj--