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/bedDetail.c src/hg/lib/bedDetail.c index 78bdccb..d1d7da0 100644 --- src/hg/lib/bedDetail.c +++ src/hg/lib/bedDetail.c @@ -381,53 +381,48 @@ } else item->reserved = lineFileNeedNum(lf, row, 8); } if (wordCount > 9) item->blockCount = lineFileNeedNum(lf, row, 9); if (wordCount > 10) { sqlSignedDynamicArray(row[10], &item->blockSizes, &count); if (count != item->blockCount) lineFileAbort(lf, "expecting %d elements in array", item->blockCount); } if (wordCount > 11) { int i; - int lastEnd, lastStart; sqlSignedDynamicArray(row[11], &item->chromStarts, &count); if (count != item->blockCount) lineFileAbort(lf, "expecting %d elements in array", item->blockCount); // tell the user if they appear to be using absolute starts rather than // relative... easy to forget! Also check block order, coord ranges... - lastStart = -1; - lastEnd = 0; for (i=0; i < item->blockCount; i++) { if (item->chromStarts[i]+item->chromStart >= item->chromEnd) { if (item->chromStarts[i] >= item->chromStart) lineFileAbort(lf, "BED chromStarts offsets must be relative to chromStart, " "not absolute. Try subtracting chromStart from each offset " "in chromStarts."); else lineFileAbort(lf, "BED chromStarts[i]+chromStart must be less than chromEnd."); } - lastStart = item->chromStarts[i]; - lastEnd = item->chromStart + item->chromStarts[i] + item->blockSizes[i]; } if (item->chromStarts[0] != 0) lineFileAbort(lf, "BED blocks must span chromStart to chromEnd. " "BED chromStarts[0] must be 0 (==%d) so that (chromStart + " "chromStarts[0]) equals chromStart.", item->chromStarts[0]); i = item->blockCount-1; if ((item->chromStart + item->chromStarts[i] + item->blockSizes[i]) != item->chromEnd) { lineFileAbort(lf, "BED blocks must span chromStart to chromEnd. (chromStart + " "chromStarts[last] + blockSizes[last]) must equal chromEnd."); } }