67177a6e5612ac45b606ff2ae34920191bed7516 tdreszer Wed Jul 11 15:43:00 2012 -0700 Next batch of many checkins as dictated by Jim. Formatting if and limiting lines to 100 chars. Changes limited to lines last touched by tdreszer (git blame) so as not to ruin history. None of these changes should affect executables in any way. diff --git src/hg/hgc/hgc.c src/hg/hgc/hgc.c index 0fd2e89..18d2927 100644 --- src/hg/hgc/hgc.c +++ src/hg/hgc/hgc.c @@ -1112,33 +1112,34 @@ safef(query, sizeof(query), "select * from %s order by score desc limit %d", filterTable, filterCt); } else { hFindSplitTable(database, seqName, tdb->table, table, &hasBin); safef(query, sizeof(query), "select * from %s where chrom = '%s' and chromEnd > %d and " "chromStart < %d order by score desc", table, seqName, winStart, winEnd); } sr = sqlGetResult(conn, query); while ((row = sqlNextRow(sr)) != NULL) { bed = bedLoadN(row+hasBin, 5); - if (!filterTable || - (sameString(bed->chrom, seqName) && - bed->chromStart < winEnd && bed->chromEnd > winStart)) + if (!filterTable + || ( sameString(bed->chrom, seqName) + && bed->chromStart < winEnd + && bed->chromEnd > winStart)) { slAddHead(&bedList, bed); } else bedFree(&bed); } sqlFreeResult(&sr); if (bedList == NULL) return; slReverse(&bedList); showBedTopScorers(bedList, item, start, maxScorers); } void getBedTopScorers(struct sqlConnection *conn, struct trackDb *tdb, char *table, char *item, int start, int bedSize) @@ -1213,31 +1214,32 @@ if(title==NULL) // Must have title continue; *title = '\0'; title++; if((table = strchr(words[ix],'.')) == NULL) table = tdb->table; else { *table++ = '\0'; // assigns before advance if((words[ix] = strchr(table,'.')) != NULL) { *words[ix] = '\0'; column = ++words[ix]; // advance before assigns } } - safef(query,sizeof(query),"select chrom,chromStart,chromEnd from %s.%s where %s=\"%s\";",db,table,column,name); + safef(query,sizeof(query),"select chrom,chromStart,chromEnd from %s.%s where %s=\"%s\";", + db,table,column,name); struct sqlResult *sr = sqlGetResult(conn, query); if(sr == NULL) continue; char **row = sqlNextRow(sr); if(row == NULL) continue; char *chrom = *row++; int beg = atoi(*row++); int end = atoi(*row); if(!gotOne) { gotOne = TRUE; printf("

The item \"%s\" has been located in other genomes:\n