src/lib/bbiRead.c 1.11

1.11 2009/08/05 23:06:27 kent
Fixed integer overflow that was causing right half of display to be empty at some zoom values. Added back a comment that got deleted as well.
Index: src/lib/bbiRead.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/lib/bbiRead.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -b -B -U 4 -r1.10 -r1.11
--- src/lib/bbiRead.c	15 Mar 2009 00:17:52 -0000	1.10
+++ src/lib/bbiRead.c	5 Aug 2009 23:06:27 -0000	1.11
@@ -473,9 +473,9 @@
     interval = intervalList;
     for (i=0; i<summarySize; ++i)
         {
 	/* Calculate end of this part of summary */
-	baseEnd = start + baseCount*(i+1)/summarySize;
+	baseEnd = start + (bits64)baseCount*(i+1)/summarySize;
 	int end1 = baseEnd;
 	if (end1 == baseStart)
 	    end1 = baseStart+1;
 
@@ -526,8 +526,13 @@
 
 boolean bbiSummaryArray(struct bbiFile *bbi, char *chrom, bits32 start, bits32 end,
 	BbiFetchIntervals fetchIntervals,
 	enum bbiSummaryType summaryType, int summarySize, double *summaryValues)
+/* Fill in summaryValues with  data from indicated chromosome range in bigWig file.
+ * Be sure to initialize summaryValues to a default value, which will not be touched
+ * for regions without data in file.  (Generally you want the default value to either
+ * be 0.0 or nan("") depending on the application.)  Returns FALSE if no data
+ * at that position. */
 {
 struct bbiSummaryElement *elements;
 AllocArray(elements, summarySize);
 boolean ret = bbiSummaryArrayExtended(bbi, chrom, start, end,