1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-15 10:07:39 -05:00

Remove some redundant variables and assignments.

This fixes a batch of clang-analyzer warnings of the form 'you
declared / assigned this variable and then never use it'. It doesn't
fix _all_ of them - some are there so that when I add code in the
future _it_ can use the variable without me having to remember to
start setting it - but these are the ones I thought it would make the
code better instead of worse to fix.
This commit is contained in:
Simon Tatham
2018-12-01 14:06:44 +00:00
parent d2ff948207
commit b54147de4b
9 changed files with 19 additions and 29 deletions

View File

@ -735,13 +735,10 @@ static void columns_alloc_horiz(Columns *cols, gint ourwidth,
ColumnsChild *child;
GList *children;
gint i, ncols, colspan, border, *colxpos, childwidth;
const gint *percentages;
static const gint onecol[] = { 100 };
border = gtk_container_get_border_width(GTK_CONTAINER(cols));
ncols = 1;
percentages = onecol;
/* colxpos gives the starting x position of each column.
* We supply n+1 of them, so that we can find the RH edge easily.
* All ending x positions are expected to be adjusted afterwards by
@ -759,12 +756,11 @@ static void columns_alloc_horiz(Columns *cols, gint ourwidth,
/* Column reconfiguration. */
ncols = child->ncols;
percentages = child->percentages;
colxpos = g_renew(gint, colxpos, ncols + 1);
colxpos[0] = 0;
percent = 0;
for (i = 0; i < ncols; i++) {
percent += percentages[i];
percent += child->percentages[i];
colxpos[i+1] = (((ourwidth - 2*border) + cols->spacing)
* percent / 100);
}