IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 7, 2008, 3:31:01 PM (18 years ago)
Author:
eugene
Message:

big update from eam_branch_20081124 with updates to Opihi math

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/dvo/dbBooleanCond.c

    r15717 r20936  
    33// evaluate the expression in inStack as a boolean; necessary db field values are
    44// 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
     6int dbBooleanCond (dbStack *inStack, int NinStack, dbValue *fields) {
    67 
    78  float value;
     
    2122
    2223    /***** 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)) {
    2425
    2526      // pre-test that op and entries match
     
    4142
    4243    /***** unary operators **/
    43     if (stack[i][0].type == 9) {
     44    if (stack[i][0].type == DB_STACK_UNARY) {
    4445
    4546      // pre-test that op and entries match
     
    6162
    6263  // 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) {
    6465    N = stack[0][0].field;
    65     value = fields[N];
     66    value = (stack[0][0].type & DB_STACK_INT) ? fields[N].Int : fields[N].Flt;
    6667  } else {
    67     value = stack[0][0].Float;
     68    value = (stack[0][0].type & DB_STACK_INT) ? stack[0][0].IntValue : stack[0][0].FltValue;
    6869  }
    6970   
Note: See TracChangeset for help on using the changeset viewer.