[PATCH libxtrans] Clean up some 'unused variable' warnings
whydoubt at yahoo.com
Mon Mar 22 19:02:32 PDT 2010
----- Original Message ----
From: Ian Romanick <idr at freedesktop.org>
To: Jeff Smith <whydoubt at yahoo.com>
Cc: xorg-devel at lists.x.org
Sent: Mon, March 22, 2010 4:38:08 PM
Subject: Re: [PATCH libxtrans] Clean up some 'unused variable' warnings
> Specific comments below. Given the nature of the changes and some of my
> comments, I think these should be broken into a separate patch for each
> variable. If nothing else, it makes reviewing the changes easier.
I had figured given their close proximity, a single patch would be fine, but OK.
> If tmpport is only assigned to once, make it const.
> I always get nervous about patches that move variable declarations in
> the presence of heavily ifdef'ed code. Whichever #if paths you don't
> test are broken. :) sockname is also used previously around lines 1534
> and 1575 in the unpatched code.
I already checked for other instances of the variables. For the locations you
mention, "sockname" is actually just part of a text string.
> Both hostp and servp are used in a single if-block. I think they should
> be moved into those blocks and get the same const treatment (becoming
> 'struct hostent *const hostp') that I recommended for tmpport.
More information about the xorg-devel