Changeset 14287 for trunk/Ohana/src/opihi/dvo/dbCheckStack.c
- Timestamp:
- Jul 18, 2007, 8:46:45 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/dvo/dbCheckStack.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/dvo/dbCheckStack.c
r13479 r14287 1 1 # include "dvoshell.h" 2 2 3 int dbCheckStack (dbStack *stack, int Nstack, int table, dbField **inFields, int * Nfields) {3 int dbCheckStack (dbStack *stack, int Nstack, int table, dbField **inFields, int *inNfields) { 4 4 5 int i, j, status, NFIELDS ;5 int i, j, status, NFIELDS, Nfields; 6 6 char *c; 7 7 dbField *fields; 8 8 9 NFIELDS = *Nfields + 10;10 REALLOCATE (*inFields, dbField, NFIELDS);11 9 fields = *inFields; 10 Nfields = *inNfields; 11 12 NFIELDS = Nfields + 10; 13 REALLOCATE (fields, dbField, NFIELDS); 12 14 13 15 for (i = 0; i < Nstack; i++) { … … 22 24 23 25 // this must be a field : is it already in the list? 24 for (j = 0; (j < *Nfields) && strcasecmp (stack[i].name, fields[j].name); j++);25 if (j < *Nfields) {26 for (j = 0; (j < Nfields) && strcasecmp (stack[i].name, fields[j].name); j++); 27 if (j < Nfields) { 26 28 stack[i].field = j; 27 29 stack[i].type = 'F'; 30 stack[i].name = NULL; 31 stack[i].Float = 0.0; 28 32 continue; 29 33 } … … 31 35 // this must be a field : is it a valid name? 32 36 if (table == DVO_TABLE_MEASURE) { 33 status = ParseMeasureField (&fields[ *Nfields], stack[i].name);37 status = ParseMeasureField (&fields[Nfields], stack[i].name); 34 38 } 35 39 if (table == DVO_TABLE_AVERAGE) { 36 status = ParseAverageField (&fields[ *Nfields], stack[i].name);40 status = ParseAverageField (&fields[Nfields], stack[i].name); 37 41 } 38 42 if (!status) { … … 40 44 return (FALSE); 41 45 } 42 stack[i].field = *Nfields;46 stack[i].field = Nfields; 43 47 stack[i].type = 'F'; 48 stack[i].name = NULL; 49 stack[i].Float = 0.0; 44 50 45 *Nfields ++; 46 CHECK_REALLOCATE (*inFields, dbField, NFIELDS, *Nfields, 10); 47 fields = *inFields; 51 Nfields ++; 52 CHECK_REALLOCATE (fields, dbField, NFIELDS, Nfields, 10); 48 53 } 49 54 } 55 56 *inNfields = Nfields; 57 *inFields = fields; 58 50 59 return (TRUE); 51 60 }
Note:
See TracChangeset
for help on using the changeset viewer.
