13b4184b2e434953f411f20dd87104f99b550275 hiram Fri Oct 2 11:53:27 2015 -0700 fixup gcc warnings for -Wunused-but-set-variable refs #16121 diff --git src/hg/lib/genoLay.c src/hg/lib/genoLay.c index 9de5cd5..bd31b0f 100644 --- src/hg/lib/genoLay.c +++ src/hg/lib/genoLay.c @@ -156,31 +156,31 @@ *retSexList = sexList; } struct genoLay *genoLayNew(struct genoLayChrom *chromList, MgFont *font, int picWidth, int betweenChromHeight, int minLeftLabelWidth, int minRightLabelWidth, char *how) /* Figure out layout. For human and most mammals this will be * two columns with sex chromosomes on bottom. This is complicated * by the platypus having a bunch of sex chromosomes. */ { int margin = 3; struct slRef *refList = NULL, *ref, *left, *right; struct genoLayChrom *chrom; struct genoLay *gl; -int autoCount, halfCount, bases, chromInLine; +int autoCount, halfCount, bases; int leftLabelWidth=0, rightLabelWidth=0, labelWidth; int spaceWidth = mgFontCharWidth(font, ' '); int extraLabelPadding = 0; int autosomeOtherPixels=0, sexOtherPixels=0; int autosomeBasesInLine=0; /* Maximum bases in a line for autosome. */ int sexBasesInLine=0; /* Bases in line for sex chromsome. */ double sexBasesPerPixel, autosomeBasesPerPixel, basesPerPixel; int pos = margin; int y = 0; int fontHeight = mgFontLineHeight(font); int chromHeight = fontHeight; int lineHeight = chromHeight + betweenChromHeight; boolean allOneLine = FALSE; refList = refListFromSlList(chromList); @@ -263,31 +263,30 @@ gl->picHeight = 2*margin + lineHeight + fontHeight + 1; gl->allOneLine = TRUE; gl->leftLabelWidth = minLeftLabelWidth; gl->rightLabelWidth = minRightLabelWidth; gl->basesPerPixel = basesPerPixel; gl->pixelsPerBase = 1.0/basesPerPixel; } else { /* Figure out space needed for autosomes. */ left = gl->leftList; right = gl->rightList; while (left || right) { bases = 0; - chromInLine = 0; if (left) { chrom = left->val; labelWidth = mgFontStringWidth(font, chrom->shortName) + spaceWidth; if (leftLabelWidth < labelWidth) leftLabelWidth = labelWidth; bases = chrom->size; left = left->next; } if (right) { chrom = right->val; labelWidth = mgFontStringWidth(font, chrom->shortName) + spaceWidth; if (rightLabelWidth < labelWidth) rightLabelWidth = labelWidth; @@ -498,31 +497,30 @@ char *bandTable = "cytoBandIdeo"; int yOffset = gl->chromOffsetY; genoLayDrawSimpleChroms(gl, hvg, defaultColor); if (sqlTableExists(conn, bandTable) && !gl->allOneLine) { int centromereColor = hCytoBandCentromereColor(hvg); double pixelsPerBase = 1.0/gl->basesPerPixel; int height = gl->chromHeight; int innerHeight = gl->chromHeight-2; struct genoLayChrom *chrom; boolean isDmel = hCytoBandDbIsDmel(db); boolean bColor = hvGfxFindColorIx(hvg, 200, 150, 150); int fontPixelHeight = mgFontPixelHeight(gl->font); for (chrom = gl->chromList; chrom != NULL; chrom = chrom->next) { - boolean gotAny = FALSE; struct sqlResult *sr; char **row; char query[256]; int cenX1=BIGNUM, cenX2=0; int y = chrom->y + yOffset; /* Fetch bands from database and draw them. */ sqlSafef(query, sizeof(query), "select * from %s where chrom='%s'", bandTable, chrom->fullName); sr = sqlGetResult(conn, query); while ((row = sqlNextRow(sr)) != NULL) { struct cytoBand band; int x1, x2; cytoBandStaticLoad(row, &band); @@ -532,31 +530,30 @@ { /* Centromere is represented as two adjacent bands. * We'll just record the extents of it here, and draw it * in one piece later. */ if (x1 < cenX1) cenX1 = x1; if (x2 > cenX2) cenX2 = x2; } else { /* Draw band */ hCytoBandDrawAt(&band, hvg, x1+chrom->x, y+1, x2-x1, innerHeight, isDmel, gl->font, fontPixelHeight, MG_BLACK, bColor, shadesOfGray, maxShade); - gotAny = TRUE; } } sqlFreeResult(&sr); /* Draw box around chromosome */ hvGfxBox(hvg, chrom->x, y, chrom->width, 1, MG_BLACK); hvGfxBox(hvg, chrom->x, y+height-1, chrom->width, 1, MG_BLACK); hvGfxBox(hvg, chrom->x, y, 1, height, MG_BLACK); hvGfxBox(hvg, chrom->x+chrom->width-1, y, 1, height, MG_BLACK); /* Draw centromere if we found one. */ if (cenX2 > cenX1) { hCytoBandDrawCentromere(hvg, cenX1+chrom->x, y, cenX2-cenX1, height, MG_WHITE, centromereColor);