5b8c4168d4807c729fc8b1f199d9eb03c9411069 galt Thu Mar 3 18:40:54 2016 -0800 Replacing simple literal NOSQLINJ in string with the #define NOSQLINJ. This is slightly better because the compiler can catch a mis-spelling of the NOSQLINJ keyword. This was suggested by Angie. diff --git src/hg/snpException/snpException.c src/hg/snpException/snpException.c index 571cdb5..79858fb 100644 --- src/hg/snpException/snpException.c +++ src/hg/snpException/snpException.c @@ -23,31 +23,31 @@ errAbort("snpException - Get exceptions to a snp invariant rule.\n" "Usage: \tsnpException database exceptionId fileBase\n" "Example:\tsnpException hg17 1 hg17snpException\n" "where the exceptionId is the primary key from the snpExceptions table,\n" "\tand using exceptionId=0 will process all invariant rules. \n"); } struct slName *getChromList(char *db) /* Get list of all chromosomes. */ { struct sqlConnection *conn = hAllocConn(db); struct sqlResult *sr = NULL; char **row = NULL; struct slName *list = NULL; struct slName *el = NULL; -char *query = "NOSQLINJ select chrom from chromInfo"; +char *query = NOSQLINJ "select chrom from chromInfo"; sr = sqlGetResult(conn, query); while ((row=sqlNextRow(sr))!=NULL) { el = newSlName(row[0]); slAddHead(&list, el); } slReverse(&list); sqlFreeResult(&sr); hFreeConn(&conn); return list; } struct slName *getGroupList(char *db, char *group) /* Get list of all rsIds from where clause. */ @@ -68,31 +68,31 @@ } slReverse(&list); sqlFreeResult(&sr); hFreeConn(&conn); return list; } struct snpExceptions *getExceptionList(char *db, int inputExceptionId) /* Get list of all exceptions to be tested. */ { struct sqlConnection *conn = hAllocConn(db); struct sqlResult *sr = NULL; char **row = NULL; struct snpExceptions *list = NULL; struct snpExceptions *el = NULL; -char query[256] = "NOSQLINJ select * from snpExceptions"; +char query[256] = NOSQLINJ "select * from snpExceptions"; if (inputExceptionId>0) sqlSafef(query, sizeof(query), "select * from snpExceptions where exceptionId=%d", inputExceptionId); sr = sqlGetResult(conn, query); while ((row=sqlNextRow(sr))!=NULL) { el = snpExceptionsLoad(row); slAddHead(&list, el); } slReverse(&list); sqlFreeResult(&sr); hFreeConn(&conn); return list; }