13b4184b2e434953f411f20dd87104f99b550275 hiram Fri Oct 2 11:53:27 2015 -0700 fixup gcc warnings for -Wunused-but-set-variable refs #16121 diff --git src/hg/lib/hgFind.c src/hg/lib/hgFind.c index f1e8434..ab5b08a 100644 --- src/hg/lib/hgFind.c +++ src/hg/lib/hgFind.c @@ -482,37 +482,35 @@ hFreeConn(&conn); return result; } static boolean findKnownGeneExact(char *db, char *spec, char *geneSymbol, struct hgPositions *hgp, char *tableName) /* Look for position in Known Genes table. */ { struct sqlConnection *conn; struct sqlResult *sr = NULL; char query[256]; char **row; boolean ok = FALSE; struct hgPosTable *table = NULL; struct hgPos *pos = NULL; -int rowOffset; char *localName; localName = spec; if (!hTableExists(db, tableName)) return FALSE; -rowOffset = hOffsetPastBin(db, NULL, tableName); conn = hAllocConn(db); sqlSafef(query, sizeof query, "SELECT chrom, txStart, txEnd, name FROM %s WHERE name='%s'", tableName, localName); sr = sqlGetResult(conn, query); while ((row = sqlNextRow(sr)) != NULL) { if (ok == FALSE) { ok = TRUE; AllocVar(table); if (hTableExists(db, "kgProtMap2")) table->description = cloneString("UCSC Genes"); else table->description = cloneString("Known Genes"); table->name = cloneString("knownGene"); @@ -771,37 +769,35 @@ trixClose(&trix); return gotIt; } static boolean findKnownGeneDescLike(char *db, char *spec, struct hgPositions *hgp, char *tableName) /* Look for position in gene prediction table. */ { struct sqlConnection *conn; struct sqlResult *sr = NULL; struct dyString *query; char **row; boolean ok = FALSE; struct hgPosTable *table = NULL; struct hgPos *pos = NULL; -int rowOffset; char *localName; localName = spec; if (!hTableExists(db, tableName)) return FALSE; -rowOffset = hOffsetPastBin(db, NULL, tableName); conn = hAllocConn(db); query = newDyString(256); sqlDyStringPrintf(query, "SELECT chrom, txStart, txEnd, name, description FROM %s, kgXref " "WHERE description LIKE '%%%s%%' and kgId=name", tableName, localName); sr = sqlGetResult(conn, query->string); while ((row = sqlNextRow(sr)) != NULL) { if (ok == FALSE) { ok = TRUE; table = addKnownGeneTable(db, hgp); } AllocVar(pos); pos->chrom = hgOfficialChromName(db, row[0]); @@ -818,37 +814,35 @@ sqlFreeResult(&sr); hFreeConn(&conn); return ok; } static boolean findKnownGeneLike(char *db, char *spec, struct hgPositions *hgp, char *tableName) /* Look for position in gene prediction table. */ { struct sqlConnection *conn; struct sqlResult *sr = NULL; struct dyString *query; char **row; boolean ok = FALSE; struct hgPosTable *table = NULL; struct hgPos *pos = NULL; -int rowOffset; char *localName; localName = spec; if (!hTableExists(db, tableName)) return FALSE; -rowOffset = hOffsetPastBin(db, NULL, tableName); conn = hAllocConn(db); query = newDyString(256); sqlDyStringPrintf(query, "SELECT chrom, txStart, txEnd, name FROM %s " "WHERE name LIKE '%s%%'", tableName, localName); sr = sqlGetResult(conn, query->string); while ((row = sqlNextRow(sr)) != NULL) { if (ok == FALSE) { ok = TRUE; table = addKnownGeneTable(db, hgp); slAddHead(&hgp->tableList, table); } @@ -2299,37 +2293,33 @@ hFreeConn(&conn); } /* End of Lowe Lab stuff */ static boolean findGenePredPattern(char *db, char *pattern, struct hgPositions *hgp, char *tableName, struct hgPosTable *table) /* Look for position pattern in gene prediction table. */ { struct sqlConnection *conn; struct sqlResult *sr = NULL; struct dyString *query; char **row; boolean ok = FALSE; struct hgPos *pos = NULL; -int rowOffset; -char *localName; -localName = pattern; if (!hTableExists(db, tableName)) return FALSE; -rowOffset = hOffsetPastBin(db, NULL, tableName); conn = hAllocConn(db); query = newDyString(256); sqlDyStringPrintf(query, "SELECT chrom, txStart, txEnd, name FROM %s WHERE name LIKE '%s'", tableName, pattern); sr = sqlGetResult(conn, query->string); while ((row = sqlNextRow(sr)) != NULL) { if (ok == FALSE) { ok = TRUE; if (table == NULL) { AllocVar(table); dyStringClear(query); @@ -2811,34 +2801,33 @@ * overflow. */ { char *truncStr = " [truncated]"; int sz = vsnprintf(buf, size, format, args); /* note that some version return -1 if too small */ if ((sz < 0) || (sz >= size)) strncpy(buf + size - 1 - strlen(truncStr), truncStr, strlen(truncStr)); buf[size-1] = 0; return sz; } void truncatef(char *buf, int size, char *format, ...) /* Like safef, but truncates the formatted string instead of barfing on * overflow. */ { -int sz; va_list args; va_start(args, format); -sz = vatruncatef(buf, size, format, args); +vatruncatef(buf, size, format, args); // ignore returned size va_end(args); } static boolean doQuery(char *db, struct hgFindSpec *hfs, char *xrefTerm, char *term, struct hgPositions *hgp, boolean relativeFlag, int relStart, int relEnd, boolean multiTerm) /* Perform a query as specified in hfs, assuming table existence has been * checked and xref'ing has been taken care of. */ { struct slName *tableList = hSplitTableNames(db, hfs->searchTable); struct slName *tPtr = NULL; struct hgPosTable *table = NULL; struct hgPos *pos = NULL; struct sqlConnection *conn = hAllocConn(db);