35226edec48008ed881612dd4a9c25d834c0c34e kate Thu Feb 12 13:32:12 2015 -0800 Readability changes diff --git src/hg/lib/hui.c src/hg/lib/hui.c index 1c40f2c..8860f06 100644 --- src/hg/lib/hui.c +++ src/hg/lib/hui.c @@ -6851,62 +6851,63 @@ } } } } puts("</TABLE>"); freeMem(matchedViewTracks); return TRUE; } char *compositeLabelWithVocabLink(char *db,struct trackDb *parentTdb, struct trackDb *childTdb, char *vocabType, char *label) // If the parentTdb has a controlledVocabulary setting and the vocabType is found, // then label will be wrapped with the link to display it. Return string is cloned. { char *vocab = trackDbSetting(parentTdb, "controlledVocabulary"); -(void)metadataForTable(db,childTdb,NULL); if (vocab == NULL) return cloneString(label); // No wrapping! -char *words[15]; -int count,ix; -boolean found=FALSE; -if ((count = chopByWhite(cloneString(vocab), words,15)) <= 1) +#define BUFSIZ 16 +char *words[BUFSIZ]; +int count; +if ((count = chopByWhite(cloneString(vocab), words, BUFSIZ)) <= 1) return cloneString(label); char *suffix = NULL; char *rootLabel = labelRoot(label, &suffix); +boolean found = FALSE; +int ix; for (ix=1;ix<count && !found;ix++) { if (sameString(vocabType,words[ix])) // controlledVocabulary setting matches tag { // so all labels are linked char *link = wgEncodeVocabLink(words[0],"term",words[ix],rootLabel,rootLabel,suffix); return link; } else if (countChars(words[ix],'=') == 1 && childTdb != NULL) // The name of a trackDb setting follows and will be the controlled vocab term { strSwapChar(words[ix],'=',0); if (sameString(vocabType,words[ix])) // tags match, but search for term { char * cvSetting = words[ix] + strlen(words[ix]) + 1; const char * cvTerm = metadataFindValue(childTdb,cvSetting); if (cvTerm != NULL) { - char *link = wgEncodeVocabLink(words[0],(sameWord(cvSetting,"antibody") ? - "target" : "term"), + char *link = wgEncodeVocabLink(words[0], + (sameWord(cvSetting,"antibody") ? "target" : "term"), (char *)cvTerm,(char *)cvTerm,rootLabel,suffix); return link; } } } } freeMem(words[0]); freeMem(rootLabel); return cloneString(label); } #ifdef BUTTONS_BY_CSS #define BUTTON_MAT "<span class='pmButton' onclick=\"matSetMatrixCheckBoxes(%s%s%s%s)\">%c</span>" #else///ifndef BUTTONS_BY_CSS #define PM_BUTTON_UC "<IMG height=18 width=18 onclick=\"return " \