efc5d694c63bb43de24814a20506798fb60b73ae
angie
  Wed Aug 9 14:49:54 2017 -0700
wiggleCart: Use theCart arg instead of global cart because not all mains define cart.

diff --git src/hg/lib/wiggleCart.c src/hg/lib/wiggleCart.c
index e8709b7..ddf8e81 100644
--- src/hg/lib/wiggleCart.c
+++ src/hg/lib/wiggleCart.c
@@ -2,32 +2,30 @@
  *	wiggle trackDb optional settings and the same values that may be
  *	in the cart.
  */
 
 /* Copyright (C) 2014 The Regents of the University of California 
  * See README in this or parent directory for licensing information. */
 #include "common.h"
 #include "jksql.h"
 #include "trackDb.h"
 #include "cart.h"
 #include "dystring.h"
 #include "hui.h"
 #include "wiggle.h"
 
 
-extern struct cart *cart;      /* defined in hgTracks.c or hgTrackUi */
-
 #define correctOrder(min,max) if (max < min) \
         { double d; d = max; max = min; min = d; }
 /* check a min,max pair (doubles) and keep them properly in order */
 
 #if defined(DEBUG)      /*      dbg     */
 
 #include "portable.h"
 
 static long wigProfileEnterTime = 0;
 
 void wigProfileEnter()
 {
 wigProfileEnterTime = clock1000();
 }
 
@@ -255,31 +253,31 @@
     *retMin = cartMin;
 if (cartMaxStr)
     *retMax = cartMax;
 }       /*      void wigFetchMinMaxYWithCart()  */
 
 void wigFetchMinMaxPixelsWithCart(struct cart *theCart, struct trackDb *tdb, char *name, 
                                         int *Min, int *Max, int *Default)
 /*      Min, Max, Default Pixel height of track
  *      Limits may be defined in trackDb with the maxHeightPixels string,
  *	Or user requested limits are defined in the cart.
  *	And default opening display limits may optionally be defined with the
  *		maxHeightPixels declaration from trackDb
  *****************************************************************************/
 {
 int settingsDefault;    // default track height
-cartTdbFetchMinMaxPixels(cart, tdb, MIN_HEIGHT_PER, atoi(DEFAULT_HEIGHT_PER), atoi(DEFAULT_HEIGHT_PER),
+cartTdbFetchMinMaxPixels(theCart, tdb, MIN_HEIGHT_PER, atoi(DEFAULT_HEIGHT_PER), atoi(DEFAULT_HEIGHT_PER),
                                 Min, Max, &settingsDefault, Default);  // Default is actually current setting
 }
 
 static char *wigCheckBinaryOption(struct trackDb *tdb, char *Default,
     char *notDefault, char *tdbString, char *secondTdbString)
 /*      A common operation for binary options (two values possible)
  *	check for trackDb.ra, then tdb->settings values
  *	return one of the two possibilities if found
  *	(the tdbString and secondTdbString are a result of
  *		early naming conventions changing over time resulting in
  *		two possible names for the same thing ...)
  */
 {
 char *tdbDefault = trackDbSettingClosestToHomeOrDefault(tdb, tdbString, "NONE");
 char *ret;