Changeset 20936 for trunk/Ohana/src/opihi/dvo/dbBooleanCond.c
- Timestamp:
- Dec 7, 2008, 3:31:01 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/dvo/dbBooleanCond.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/dvo/dbBooleanCond.c
r15717 r20936 3 3 // evaluate the expression in inStack as a boolean; necessary db field values are 4 4 // supplied by fields, in order 0 - Nfields (validate before calling) 5 int dbBooleanCond (dbStack *inStack, int NinStack, float *fields) { 5 // XXX fields needs to be typed (dbValue), stack math needs to deal with the type cases 6 int dbBooleanCond (dbStack *inStack, int NinStack, dbValue *fields) { 6 7 7 8 float value; … … 21 22 22 23 /***** binary operators *****/ 23 if ((stack[i][0].type >= 3) && (stack[i][0].type <= 8)) {24 if ((stack[i][0].type >= DB_STACK_LOGIC) && (stack[i][0].type <= DB_STACK_POWER)) { 24 25 25 26 // pre-test that op and entries match … … 41 42 42 43 /***** unary operators **/ 43 if (stack[i][0].type == 9) {44 if (stack[i][0].type == DB_STACK_UNARY) { 44 45 45 46 // pre-test that op and entries match … … 61 62 62 63 // the result here is a single stack entry with a value: 63 if (stack[0][0].type == 'F') {64 if (stack[0][0].type & DB_STACK_FIELD) { 64 65 N = stack[0][0].field; 65 value = fields[N];66 value = (stack[0][0].type & DB_STACK_INT) ? fields[N].Int : fields[N].Flt; 66 67 } else { 67 value = stack[0][0].Float;68 value = (stack[0][0].type & DB_STACK_INT) ? stack[0][0].IntValue : stack[0][0].FltValue; 68 69 } 69 70
Note:
See TracChangeset
for help on using the changeset viewer.
