336446810facfb8bd5fe6665f736d647d7dc20c0 braney Thu Nov 7 10:18:44 2019 -0800 remove brain-dead code that made a distinction between floats and ints in number filtering diff --git src/hg/hgTracks/bigBedTrack.c src/hg/hgTracks/bigBedTrack.c index c380798..00d9104 100644 --- src/hg/hgTracks/bigBedTrack.c +++ src/hg/hgTracks/bigBedTrack.c @@ -50,64 +50,36 @@ fieldNum = fixedField(field); if (fieldNum < 0) errAbort("error building filter with field %s. Field not found.", field); return fieldNum; } struct bigBedFilter *bigBedMakeNumberFilter(struct cart *cart, struct bbiFile *bbi, struct trackDb *tdb, char *filter, char *defaultLimits, char *field) /* Make a filter on this column if the trackDb or cart wants us to. */ { struct bigBedFilter *ret = NULL; char *setting = trackDbSettingClosestToHome(tdb, filter); int fieldNum = getFieldNum(bbi, field); if (setting) { - struct asObject *as = bigBedAsOrDefault(bbi); - // All this isFloat conditional code is here because the cart - // variables used for floats are different than those used for ints - // in ../lib/hui.c so we have to use the correct getScore*() routine - // to access them.. We're doomed. - boolean isFloat = FALSE; - struct asColumn *asCol = asColumnFind(as, field); - if (asCol != NULL) - isFloat = asTypesIsFloating(asCol->lowType->type); boolean invalid = FALSE; double minValueTdb = 0,maxValueTdb = NO_VALUE; double minLimit=NO_VALUE,maxLimit=NO_VALUE,min = minValueTdb,max = maxValueTdb; - if (!isFloat) - { - int minValueTdbInt = 0,maxValueTdbInt = NO_VALUE; - colonPairToInts(setting,&minValueTdbInt,&maxValueTdbInt); - int minLimitInt=NO_VALUE,maxLimitInt=NO_VALUE,minInt=minValueTdbInt,maxInt=maxValueTdbInt; - colonPairToInts(defaultLimits,&minLimitInt,&maxLimitInt); - getScoreIntRangeFromCart(cart,tdb,FALSE,filter,&minLimitInt,&maxLimitInt,&minInt,&maxInt); - - // copy all the ints over to the doubles (sigh) - min = minInt; - max = maxInt; - minLimit = minLimitInt; - maxLimit = maxLimitInt; - minValueTdb = minValueTdbInt; - maxValueTdb = maxValueTdbInt; - } - else - { colonPairToDoubles(setting,&minValueTdb,&maxValueTdb); colonPairToDoubles(defaultLimits,&minLimit,&maxLimit); getScoreFloatRangeFromCart(cart,tdb,FALSE,filter,&minLimit,&maxLimit,&min,&max); - } if ((int)minLimit != NO_VALUE || (int)maxLimit != NO_VALUE) { // assume tdb default values within range! // (don't give user errors that have no consequence) if ((min != minValueTdb && (((int)minLimit != NO_VALUE && min < minLimit) || ((int)maxLimit != NO_VALUE && min > maxLimit))) || (max != maxValueTdb && (((int)minLimit != NO_VALUE && max < minLimit) || ((int)maxLimit != NO_VALUE && max > maxLimit)))) { invalid = TRUE; char value[64]; if ((int)max == NO_VALUE) // min only is allowed, but max only is not safef(value, sizeof(value), "entered minimum (%g)", min); else safef(value, sizeof(value), "entered range (min:%g and max:%g)", min, max);