f460524877c4c3228a70da6ccb97f1cee80d6481 kent Tue Apr 17 21:33:33 2012 -0700 Dealing with a name conflict I just introduced between lib and hg/lib. diff --git src/lib/asParse.c src/lib/asParse.c index e87ffa8..e90ed66 100644 --- src/lib/asParse.c +++ src/lib/asParse.c @@ -405,40 +405,41 @@ { return asParseLineFile(lineFileOpen(fileName, TRUE)); } struct asObject *asParseText(char *text) /* Parse autoSql from text (as opposed to file). */ { char *dupe = cloneString(text); struct lineFile *lf = lineFileOnString("text", TRUE, dupe); struct asObject *objList = asParseLineFile(lf); freez(&dupe); return objList; } -struct asColumn *asColumnFind(struct asObject *as, char *name) -/* Return column of given name from object, or NULL if not found. */ +struct asColumn *asColumnFind(struct asObject *asObj, char *name) +// Return named column. { -struct asColumn *col; -for (col = as->columnList; col != NULL; col = col->next) +struct asColumn *asCol = NULL; +if (asObj!= NULL) { - if (sameString(col->name, name)) - return col; + for (asCol = asObj->columnList; asCol != NULL; asCol = asCol->next) + if (sameString(asCol->name, name)) + break; } -return NULL; +return asCol; } boolean asCompareObjs(char *name1, struct asObject *as1, char *name2, struct asObject *as2, int numColumnsToCheck, int *retNumColumnsSame, boolean abortOnDifference) /* Compare as-objects as1 and as2 making sure several important fields show they are the same name and type. * If difference found, print it to stderr. If abortOnDifference, errAbort. * Othewise, return TRUE if the objects columns match through the first numColumnsToCheck fields. * If retNumColumnsSame is not NULL, then it will be set to the number of contiguous matching columns. */ { boolean differencesFound = FALSE; struct asColumn *col1 = as1->columnList, *col2 = as2->columnList; int checkCount = 0; int verboseLevel = 2; if (abortOnDifference) verboseLevel = 1;