IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20860


Ignore:
Timestamp:
Nov 30, 2008, 2:46:46 PM (17 years ago)
Author:
eugene
Message:

set vectors to use INT or FLT types as needed; cleanup type information in dbStack (use enum)

Location:
branches/eam_branch_20081124/Ohana/src/opihi
Files:
2 deleted
46 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20081124/Ohana/src/opihi/cmd.astro/cgrid.c

    r20857 r20860  
    391391  graphmode.ptype = 100; /* connect a pair */
    392392  graphmode.etype = 0;
    393   PlotVectorPair (kapa, Xvec, Yvec, &graphmode);
    394 
    395   free (Xvec.elements.Flt);
    396   free (Yvec.elements.Flt);
     393  PlotVectorPair (kapa, &Xvec, &Yvec, &graphmode);
     394
     395  free (Xvec.elements.Ptr);
     396  free (Yvec.elements.Ptr);
    397397  return (TRUE);
    398398
  • branches/eam_branch_20081124/Ohana/src/opihi/cmd.astro/cplot.c

    r20859 r20860  
    3131  }
    3232
    33   ResetVector (Xvec, OPIHI_FLT, xvec[0].Nelements);
    34   ResetVector (Yvec, OPIHI_FLT, xvec[0].Nelements);
     33  ResetVector (&Xvec, OPIHI_FLT, xvec[0].Nelements);
     34  ResetVector (&Yvec, OPIHI_FLT, xvec[0].Nelements);
    3535 
    3636  r = xvec[0].elements.Flt;
     
    7777
    7878  graphmode.etype = 0;
    79   PlotVectorPair (kapa, Xvec, Yvec, &graphmode);
     79  PlotVectorPair (kapa, &Xvec, &Yvec, &graphmode);
    8080 
    81   free (Xvec.elements.Flt);
    82   free (Yvec.elements.Flt);
     81  free (Xvec.elements.Ptr);
     82  free (Yvec.elements.Ptr);
    8383   
    8484  return (TRUE);
  • branches/eam_branch_20081124/Ohana/src/opihi/cmd.astro/czplot.c

    r20859 r20860  
    3838    return (FALSE);
    3939  }
    40   ResetVector (Xvec, OPIHI_FLT, xvec[0].Nelements);
    41   ResetVector (Yvec, OPIHI_FLT, xvec[0].Nelements);
    42   ResetVector (Zvec, OPIHI_FLT, xvec[0].Nelements);
     40  ResetVector (&Xvec, OPIHI_FLT, xvec[0].Nelements);
     41  ResetVector (&Yvec, OPIHI_FLT, xvec[0].Nelements);
     42  ResetVector (&Zvec, OPIHI_FLT, xvec[0].Nelements);
    4343 
    4444  r   = xvec[0].elements.Flt;
     
    6767  graphmode.size = -1; /* point size determined by Zvec */
    6868  graphmode.etype = 0;
    69   PlotVectorTriplet (kapa, Xvec, Yvec, Zvec, &graphmode);
     69  PlotVectorTriplet (kapa, &Xvec, &Yvec, &Zvec, &graphmode);
    7070
    7171  free (Xvec.elements.Flt);
  • branches/eam_branch_20081124/Ohana/src/opihi/cmd.astro/profile.c

    r20859 r20860  
    2828  if ((yvec = SelectVector (argv[3], ANYVECTOR, TRUE)) == NULL) return (FALSE);
    2929
    30   ResetVector (xvec, OPIHI_FLT, (int)SQ(2*N+1);
    31   ResetVector (yvec, OPIHI_FLT, (int)SQ(2*N+1);
     30  ResetVector (xvec, OPIHI_FLT, (int)SQ(2*N+1));
     31  ResetVector (yvec, OPIHI_FLT, (int)SQ(2*N+1));
    3232
    3333  bzero (yvec[0].elements.Flt, (int)SQ(2*N+1)*sizeof(opihi_flt)+1);
  • branches/eam_branch_20081124/Ohana/src/opihi/cmd.data/applyfit.c

    r20859 r20860  
    66  char *c, name[64];
    77  double *C, X;
    8   opihi_flt *x, *y;
     8  opihi_flt *y;
    99  Vector *xvec, *yvec;
    1010
  • branches/eam_branch_20081124/Ohana/src/opihi/cmd.data/applyfit2d.c

    r20859 r20860  
    66  char *c, name[64];
    77  double **C, X, Y;
    8   opihi_flt *x, *y, *z;
     8  opihi_flt *z;
    99  Vector *xvec, *yvec, *zvec;
    1010
  • branches/eam_branch_20081124/Ohana/src/opihi/cmd.data/concat.c

    r20859 r20860  
    55  int  i, j, Nin;
    66  double value;
     7  opihi_flt *temp;
    78  Vector *ivec, *ovec;
    89
  • branches/eam_branch_20081124/Ohana/src/opihi/cmd.data/dbselect.c

    r20859 r20860  
    8686        ResetVector (vec[i], OPIHI_FLT, Nrows);
    8787        break;
     88    }
    8889  }
    8990
  • branches/eam_branch_20081124/Ohana/src/opihi/cmd.data/gaussj.c

    r20859 r20860  
    77  opihi_int *vi;
    88  double **a, **b;
    9   int i, j, N, status, QUIET;
     9  int i, j, N, status, QUIET, isFloat;
    1010  Vector *B;
    1111  Buffer *A;
  • branches/eam_branch_20081124/Ohana/src/opihi/cmd.data/grid.c

    r20859 r20860  
    2323
    2424  N = 0;
    25   ResetVector (Xvec, OPIHI_FLT, 200);
    26   ResetVector (Yvec, OPIHI_FLT, 200);
     25  ResetVector (&Xvec, OPIHI_FLT, 200);
     26  ResetVector (&Yvec, OPIHI_FLT, 200);
    2727
    2828  major = minor = 1;
     
    191191  graphmode.ptype = 100; /* connect a pair */
    192192  graphmode.etype = 0;
    193   PlotVectorPair (kapa, Xvec, Yvec, &graphmode);
     193  PlotVectorPair (kapa, &Xvec, &Yvec, &graphmode);
    194194
    195195  free (Xvec.elements.Flt);
  • branches/eam_branch_20081124/Ohana/src/opihi/cmd.data/histogram.c

    r20859 r20860  
    3535  bzero (yvec[0].elements.Int, sizeof(opihi_int)*yvec[0].Nelements);
    3636  if (Nbins < 1) return (TRUE);
    37   *OUT = yvec[0].elements.Int;
     37  OUT = yvec[0].elements.Int;
    3838
    3939  if (xvec[0].type == OPIHI_FLT) {
  • branches/eam_branch_20081124/Ohana/src/opihi/cmd.data/integrate.c

    r20859 r20860  
    44 
    55  int i, N, VERBOSE, isFloat;
    6   opihi_flt *X, *Y;
     6  opihi_flt *Yf;
     7  opihi_int *Yi;
    78  double start, end, value, range, dvalue;
    89  Vector *vecx, *vecy;
     
    3738      if ((*X >= start) && (*X <= end)) {
    3839        dvalue = (isFloat) ? *Yf : *Yi;
    39         value += *Y * (X[1] - X[0]);
     40        value += dvalue * (X[1] - X[0]);
    4041        range += (X[1] - X[0]);
    4142      }
     
    4647      if ((*X >= start) && (*X <= end)) {
    4748        dvalue = (isFloat) ? *Yf : *Yi;
    48         value += *Y * (X[1] - X[0]);
     49        value += dvalue * (X[1] - X[0]);
    4950        range += (X[1] - X[0]);
    5051      }
  • branches/eam_branch_20081124/Ohana/src/opihi/cmd.data/interpolate.c

    r20857 r20860  
    2121  if ((yout = SelectVector (argv[4],  ANYVECTOR, TRUE)) == NULL) return (FALSE);
    2222
    23   REQUIRE_VECTOR_FLT (in, FALSE);
    24   REQUIRE_VECTOR_FLT (xv, FALSE);
    25   REQUIRE_VECTOR_FLT (yv, FALSE);
     23  REQUIRE_VECTOR_FLT (xin, FALSE);
     24  REQUIRE_VECTOR_FLT (yin, FALSE);
     25  REQUIRE_VECTOR_FLT (xout, FALSE);
    2626  ResetVector (yout, OPIHI_FLT, xout[0].Nelements);
    2727
  • branches/eam_branch_20081124/Ohana/src/opihi/cmd.data/peak.c

    r20857 r20860  
    55  int i, N, imax, QUIET;
    66  double start, end, xmax, ymax;
    7   opihi_flt *X, *Y;
    87  Vector *vecx, *vecy;
    98
     
    3130
    3231  imax = -1;
     32  xmax = -HUGE_VAL;
     33  ymax = -HUGE_VAL;
    3334
    34   if (vecx[0].type == OPIHI_FLT) {
     35  if ((vecx[0].type == OPIHI_FLT) && (vecy[0].type == OPIHI_FLT)) {
    3536    opihi_flt *X = vecx[0].elements.Flt;
    36     xmax = X[start];
    37     ymax = (vecy[0].type == OPIHI_FLT) ? vecy[0].elements.Flt[start] : vecy[0].elements.Int[start];
    38     for (i = 1; i < vecx[0].Nelements-1; i++, X++, Y++) {
    39       if ((*X >= start) && (*X <= end)) {
    40         if ((imax == -1) || (*Y > ymax)) {
    41           xmax = *X;
    42           ymax = (vecy[0].type == OPIHI_FLT) ? vecy[0].elements.Flt[i] : vecy[0].elements.Int[i];
    43           imax = i;
    44         }
    45       }
     37    opihi_flt *Y = vecy[0].elements.Flt;
     38    for (i = 0; i < vecx[0].Nelements; i++, X++, Y++) {
     39      if (*X < start) continue;
     40      if (*X > end) continue;
     41      if (*Y < ymax) continue;
     42      xmax = *X;
     43      ymax = *Y;
     44      imax = i;
    4645    }     
    47   } else {
     46  }
     47  if ((vecx[0].type == OPIHI_FLT) && (vecy[0].type == OPIHI_INT)) {
     48    opihi_flt *X = vecx[0].elements.Flt;
     49    opihi_int *Y = vecy[0].elements.Int;
     50    for (i = 0; i < vecx[0].Nelements; i++, X++, Y++) {
     51      if (*X < start) continue;
     52      if (*X > end) continue;
     53      if (*Y < ymax) continue;
     54      xmax = *X;
     55      ymax = *Y;
     56      imax = i;
     57    }     
     58  }
     59  if ((vecx[0].type == OPIHI_INT) && (vecy[0].type == OPIHI_FLT)) {
    4860    opihi_int *X = vecx[0].elements.Int;
    49     xmax = X[start];
    50     ymax = (vecy[0].type == OPIHI_FLT) ? vecy[0].elements.Flt[start] : vecy[0].elements.Int[start];
    51     for (i = 1; i < vecx[0].Nelements-1; i++, X++, Y++) {
    52       if ((*X >= start) && (*X <= end)) {
    53         if ((imax == -1) || (*Y > ymax)) {
    54           xmax = *X;
    55           ymax = (vecy[0].type == OPIHI_FLT) ? vecy[0].elements.Flt[i] : vecy[0].elements.Int[i];
    56           imax = i;
    57         }
    58       }
     61    opihi_flt *Y = vecy[0].elements.Flt;
     62    for (i = 0; i < vecx[0].Nelements; i++, X++, Y++) {
     63      if (*X < start) continue;
     64      if (*X > end) continue;
     65      if (*Y < ymax) continue;
     66      xmax = *X;
     67      ymax = *Y;
     68      imax = i;
     69    }     
     70  }
     71  if ((vecx[0].type == OPIHI_INT) && (vecy[0].type == OPIHI_INT)) {
     72    opihi_int *X = vecx[0].elements.Int;
     73    opihi_int *Y = vecy[0].elements.Int;
     74    for (i = 0; i < vecx[0].Nelements; i++, X++, Y++) {
     75      if (*X < start) continue;
     76      if (*X > end) continue;
     77      if (*Y < ymax) continue;
     78      xmax = *X;
     79      ymax = *Y;
     80      imax = i;
    5981    }     
    6082  }
  • branches/eam_branch_20081124/Ohana/src/opihi/cmd.data/read_vectors.c

    r20857 r20860  
    159159int read_table_vectors (int argc, char **argv, char *extname) {
    160160
    161   int i, j, k, N, Nbytes, Nextend, Ny, Binary;
     161  int i, j, k, N, Nbytes, Nextend, Ny, Binary, vecType;
    162162  char type[16], ID[80], *CCDKeyword;
    163163  FTable table;
  • branches/eam_branch_20081124/Ohana/src/opihi/cmd.data/sort.c

    r20859 r20860  
    101101      }
    102102      /* swap .elements.Flt (== V) and itemp */
    103       vec[i][0].elements.Flt = itemp;
     103      vec[i][0].elements.Int = itemp;
    104104      itemp = V;
    105105    }
    106106  }
    107   free (temp);
     107  free (itemp);
     108  free (ftemp);
    108109  free (vec);
    109110  free (index);
  • branches/eam_branch_20081124/Ohana/src/opihi/cmd.data/uniq.c

    r20857 r20860  
    1515
    1616  /* allocate the maximum possible needed */
    17   ResetVector (out, ivec->type, ivec->Nelements);
     17  ResetVector (ovec, ivec->type, ivec->Nelements);
    1818
    1919  Nnew = 0;
     
    4848
    4949  // free up extra memory
    50   ResetVector (out, ivec->type, Nnew);
     50  ResetVector (ovec, ivec->type, Nnew);
    5151
    5252  return (TRUE);
  • branches/eam_branch_20081124/Ohana/src/opihi/cmd.data/vbin.c

    r20857 r20860  
    55  int i, j, n, N, Nin, Nout;
    66  int Normalize, Ignore;
    7   opihi_flt *Vout, *Vin, IgnoreValue;
     7  opihi_flt *Vout, IgnoreValue;
    88  double scale;
    99  Vector *in, *out;
  • branches/eam_branch_20081124/Ohana/src/opihi/cmd.data/vclip.c

    r20857 r20860  
    55  int i, Npix, DO_NAN, DO_INF, DO_CLIP, N;
    66  double min, Vmin, max, Vmax, nan_val, inf_val;
    7   opihi_flt *in;
    87  Vector *vec;
    98
  • branches/eam_branch_20081124/Ohana/src/opihi/cmd.data/vload.c

    r20857 r20860  
    8282    overlay[i].type = type;
    8383    overlay[i].text = NULL;
    84     overlay[i].x = (vec[0].type == OPIHI_FLT) ? vecx[0].elements.Flt[i] : vecx[0].elements.Int[i];
    85     overlay[i].y = (vec[0].type == OPIHI_FLT) ? vecy[0].elements.Flt[i] : vecy[0].elements.Int[i];
     84    overlay[i].x = (vecx[0].type == OPIHI_FLT) ? vecx[0].elements.Flt[i] : vecx[0].elements.Int[i];
     85    overlay[i].y = (vecy[0].type == OPIHI_FLT) ? vecy[0].elements.Flt[i] : vecy[0].elements.Int[i];
    8686    overlay[i].x += 0.5;
    8787    overlay[i].y += 0.5;
  • branches/eam_branch_20081124/Ohana/src/opihi/cmd.data/zplot.c

    r20857 r20860  
    4141    }
    4242  } else {
    43     opihi_int *in = zvec[0].elements.Flt;
     43    opihi_int *in = zvec[0].elements.Int;
    4444    for (i = 0; i < Zvec.Nelements; i++, in++, out++) {
    4545      *out = MIN (1.0, MAX (0.01, (*in - min) / range));
     
    5151  graphmode.size = -1; /* point size determined by Zvec */
    5252  graphmode.etype = 0; /* no errorbars */
    53   PlotVectorTriplet (kapa, xvec, yvec, Zvec, &graphmode);
     53  PlotVectorTriplet (kapa, xvec, yvec, &Zvec, &graphmode);
    5454
    55   free (Zvec.elements.Flt);
     55  free (Zvec.elements.Ptr);
    5656
    5757  return (TRUE);
  • branches/eam_branch_20081124/Ohana/src/opihi/dvo/avextract.c

    r20857 r20860  
    11# include "dvoshell.h"
    22
    3 // XXX need to promote values (and dbStack entries) to opihi_flt, but wait until done testing
    43int avextract (int argc, char **argv) {
    54 
     
    7372
    7473  /* create output storage vectors */
    75   ALLOCATE (values, float, Nfields);
     74  ALLOCATE (values, dbValue, Nfields);
    7675  ALLOCATE (vec, Vector *, Nreturn);
    7776  for (i = 0; i < Nreturn; i++) {
  • branches/eam_branch_20081124/Ohana/src/opihi/dvo/dbBooleanCond.c

    r20857 r20860  
    44// supplied by fields, in order 0 - Nfields (validate before calling)
    55// XXX fields needs to be typed (dbValue), stack math needs to deal with the type cases
    6 int dbBooleanCond (dbStack *inStack, int NinStack, float *fields) {
     6int dbBooleanCond (dbStack *inStack, int NinStack, dbValue *fields) {
    77 
    88  float value;
     
    2222
    2323    /***** binary operators *****/
    24     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)) {
    2525
    2626      // pre-test that op and entries match
     
    4242
    4343    /***** unary operators **/
    44     if (stack[i][0].type == 9) {
     44    if (stack[i][0].type == DB_STACK_UNARY) {
    4545
    4646      // pre-test that op and entries match
     
    6262
    6363  // the result here is a single stack entry with a value:
    64   if (stack[0][0].type == 'F') {
     64  if (stack[0][0].type & DB_STACK_FIELD) {
    6565    N = stack[0][0].field;
    66     value = fields[N];
     66    value = (stack[0][0].type & DB_STACK_INT) ? fields[N].Int : fields[N].Flt;
    6767  } else {
    68     value = stack[0][0].Float;
     68    value = (stack[0][0].type & DB_STACK_INT) ? stack[0][0].IntValue : stack[0][0].FltValue;
    6969  }
    7070   
  • branches/eam_branch_20081124/Ohana/src/opihi/dvo/dbCheckStack.c

    r20820 r20860  
    11# include "dvoshell.h"
     2
     3// XXX we are using a fairly bogus set of char values to distinguish a few cases:
     4// 's', 'S' : value is a scalar (upper == float; lower == int)
     5// 'f', 'F' : value is a field (upper == float; lower == int)
     6// 't', 'T' : value is a temp scalar (upper == float; lower == int)
     7// these would be better done using bit values to test for field? temp? float?
    28
    39int dbCheckStack (dbStack *stack, int Nstack, int table, dbField **inFields, int *inNfields) {
    410
    511  int i, j, status, NFIELDS, Nfields;
    6   char *c;
     12  char *c1, *c2;
    713  dbField *fields;
    814
     
    1420
    1521  for (i = 0; i < Nstack; i++) {
    16     if (stack[i].type == 'X') {
     22    if (stack[i].type == DB_STACK_VALUE) {
    1723
    18       /** if this is a number, put it on the list of scalers and move on **/
    19       stack[i].Float = strtod (stack[i].name, &c);
    20       if (c == stack[i].name + strlen (stack[i].name)) {
    21         stack[i].type  = 'S';
     24      /** if this is a number, put it on the list of scalars and move on.  assume value is
     25       * an int unless proven otherwise **/
     26      stack[i].FltValue = strtod (stack[i].name, &c1);
     27      stack[i].IntValue = strtol (stack[i].name, &c2, 0);
     28      if (c2 == stack[i].name + strlen (stack[i].name)) {
     29        stack[i].type  |= DB_STACK_INT;
     30        continue;
     31      }
     32      if (c1 == stack[i].name + strlen (stack[i].name)) {
     33        // this is a float value
    2234        continue;
    2335      }
     
    4456          code = GetPhotcodebyName (tmpstring);
    4557          if (code) {
    46               stack[i].Float = code->code;
    47               stack[i].type  = 'S';
     58              stack[i].IntValue = code->code;
     59              stack[i].type = DB_STACK_INT;
    4860              continue;
    4961          }
     
    6072      if (j < Nfields) {
    6173        stack[i].field = j;
    62         stack[i].type  = 'F';
     74        stack[i].type |= DB_STACK_FIELD;
     75        if (fields[j].type == OPIHI_INT) {
     76          stack[i].type |= DB_STACK_INT;
     77        }
    6378        stack[i].name  = NULL;
    64         stack[i].Float = 0.0;
     79        stack[i].FltValue = 0.0;
     80        stack[i].IntValue =   0;
    6581        continue;
    6682      }
     
    7894      }
    7995      stack[i].field = Nfields;
    80       stack[i].type  = 'F';
     96      stack[i].type |= DB_STACK_FIELD;
     97      if (fields[Nfields].type == OPIHI_INT) {
     98        stack[i].type |= DB_STACK_INT;
     99      }
    81100      stack[i].name  = NULL;
    82       stack[i].Float = 0.0;
     101      stack[i].FltValue = 0.0; // 'F'
     102      stack[i].IntValue =   0; // 'f'
    83103
    84104      Nfields ++;
  • branches/eam_branch_20081124/Ohana/src/opihi/dvo/dbCmdlineFields.c

    r20820 r20860  
    155155
    156156  stack[0][N +  0].name = strcreate (Rname);
    157   stack[0][N +  0].type = 'X';
     157  stack[0][N +  0].type = DB_STACK_VALUE;
    158158  stack[0][N +  1].name = strfloat (Rmin);
    159   stack[0][N +  1].type = 'X';
     159  stack[0][N +  1].type = DB_STACK_VALUE;
    160160  stack[0][N +  2].name = strcreate (">");
    161   stack[0][N +  2].type = 4;
    162   // stack[0][N +  3].name = strcreate ("A");
    163   // stack[0][N +  3].type = 3;
     161  stack[0][N +  2].type = DB_STACK_COMPARE;
    164162
    165163  stack[0][N +  3].name = strcreate (Rname);
    166   stack[0][N +  3].type = 'X';
     164  stack[0][N +  3].type = DB_STACK_VALUE;
    167165  stack[0][N +  4].name = strfloat (Rmax);
    168   stack[0][N +  4].type = 'X';
     166  stack[0][N +  4].type = DB_STACK_VALUE;
    169167  stack[0][N +  5].name = strcreate ("<");
    170   stack[0][N +  5].type = 4;
     168  stack[0][N +  5].type = DB_STACK_COMPARE;
    171169  stack[0][N +  6].name = strcreate ("A");
    172   stack[0][N +  6].type = 3;
     170  stack[0][N +  6].type = DB_STACK_LOGIC;
    173171
    174172  stack[0][N +  7].name = strcreate (Dname);
    175   stack[0][N +  7].type = 'X';
     173  stack[0][N +  7].type = DB_STACK_VALUE;
    176174  stack[0][N +  8].name = strfloat (Dmin);
    177   stack[0][N +  8].type = 'X';
     175  stack[0][N +  8].type = DB_STACK_VALUE;
    178176  stack[0][N +  9].name = strcreate (">");
    179   stack[0][N +  9].type = 4;
     177  stack[0][N +  9].type = DB_STACK_COMPARE;
    180178  stack[0][N + 10].name = strcreate ("A");
    181   stack[0][N + 10].type = 3;
     179  stack[0][N + 10].type = DB_STACK_LOGIC;
    182180
    183181  stack[0][N + 11].name = strcreate (Dname);
    184   stack[0][N + 11].type = 'X';
     182  stack[0][N + 11].type = DB_STACK_VALUE;
    185183  stack[0][N + 12].name = strfloat (Dmax);
    186   stack[0][N + 12].type = 'X';
     184  stack[0][N + 12].type = DB_STACK_VALUE;
    187185  stack[0][N + 13].name = strcreate ("<");
    188   stack[0][N + 13].type = 4;
     186  stack[0][N + 13].type = DB_STACK_COMPARE;
    189187  stack[0][N + 14].name = strcreate ("A");
    190   stack[0][N + 14].type = 3;
     188  stack[0][N + 14].type = DB_STACK_LOGIC;
    191189
    192190  if (N == 0) {
     
    194192  } else {
    195193    stack[0][N + 15].name = strcreate ("A");
    196     stack[0][N + 15].type = 3;
     194    stack[0][N + 15].type = DB_STACK_LOGIC;
    197195    N += 16;
    198196  }   
  • branches/eam_branch_20081124/Ohana/src/opihi/dvo/dbFields.c

    r20857 r20860  
    107107  if (!strcasecmp (fieldName, "GLON"))       {
    108108    dbExtractMeasuresInitTransform (COORD_GALACTIC);
    109     ESCAPE (MEAS_GLON, MAG_NONE);
     109    ESCAPE (MEAS_GLON, MAG_NONE, OPIHI_FLT);
    110110  }
    111111  if (!strcasecmp (fieldName, "GLAT")) {
    112112    dbExtractMeasuresInitTransform (COORD_GALACTIC);
    113     ESCAPE (MEAS_GLAT, MAG_NONE);
     113    ESCAPE (MEAS_GLAT, MAG_NONE, OPIHI_FLT);
    114114  }
    115115  if (!strcasecmp (fieldName, "GLON:AVE")) {
    116116    dbExtractMeasuresInitTransform (COORD_GALACTIC);
    117     ESCAPE (MEAS_GLON_AVE, MAG_NONE);
     117    ESCAPE (MEAS_GLON_AVE, MAG_NONE, OPIHI_FLT);
    118118  }
    119119  if (!strcasecmp (fieldName, "GLAT:AVE")) {
    120120    dbExtractMeasuresInitTransform (COORD_GALACTIC);
    121     ESCAPE (MEAS_GLAT_AVE, MAG_NONE);
     121    ESCAPE (MEAS_GLAT_AVE, MAG_NONE, OPIHI_FLT);
    122122  }
    123123
    124124  if (!strcasecmp (fieldName, "ELON"))       {
    125125    dbExtractMeasuresInitTransform (COORD_ECLIPTIC);
    126     ESCAPE (MEAS_ELON, MAG_NONE);
     126    ESCAPE (MEAS_ELON, MAG_NONE, OPIHI_FLT);
    127127  }
    128128  if (!strcasecmp (fieldName, "ELAT")) {
    129129    dbExtractMeasuresInitTransform (COORD_ECLIPTIC);
    130     ESCAPE (MEAS_ELAT, MAG_NONE);
     130    ESCAPE (MEAS_ELAT, MAG_NONE, OPIHI_FLT);
    131131  }
    132132  if (!strcasecmp (fieldName, "ELON:AVE")) {
    133133    dbExtractMeasuresInitTransform (COORD_ECLIPTIC);
    134     ESCAPE (MEAS_ELON_AVE, MAG_NONE);
     134    ESCAPE (MEAS_ELON_AVE, MAG_NONE, OPIHI_FLT);
    135135  }
    136136  if (!strcasecmp (fieldName, "ELAT:AVE")) {
    137137    dbExtractMeasuresInitTransform (COORD_ECLIPTIC);
    138     ESCAPE (MEAS_ELAT_AVE, MAG_NONE);
     138    ESCAPE (MEAS_ELAT_AVE, MAG_NONE, OPIHI_FLT);
    139139  }
    140140
     
    218218  if (!strcasecmp (fieldName, "GLON"))  {
    219219    dbExtractAveragesInitTransform (COORD_GALACTIC);
    220     ESCAPE (AVE_GLON, MAG_NONE);
     220    ESCAPE (AVE_GLON, MAG_NONE, OPIHI_FLT);
    221221  }
    222222  if (!strcasecmp (fieldName, "GLAT"))  {
    223223    dbExtractAveragesInitTransform (COORD_GALACTIC);
    224     ESCAPE (AVE_GLAT, MAG_NONE);
     224    ESCAPE (AVE_GLAT, MAG_NONE, OPIHI_FLT);
    225225  }
    226226
     
    229229  if (!strcasecmp (fieldName, "ELON"))  {
    230230    dbExtractAveragesInitTransform (COORD_ECLIPTIC);
    231     ESCAPE (AVE_ELON, MAG_NONE);
     231    ESCAPE (AVE_ELON, MAG_NONE, OPIHI_FLT);
    232232  }
    233233  if (!strcasecmp (fieldName, "ELAT"))  {
    234234    dbExtractAveragesInitTransform (COORD_ECLIPTIC);
    235     ESCAPE (AVE_ELAT, MAG_NONE);
     235    ESCAPE (AVE_ELAT, MAG_NONE, OPIHI_FLT);
    236236  }
    237237
  • branches/eam_branch_20081124/Ohana/src/opihi/dvo/dbRPN.c

    r13479 r20860  
    2121   
    2222    /* decide on priority of object */
    23     type = 0;
     23    type = DB_STACK_NONE;
    2424    /* unary operations */
    25     if (!strcmp (argv[i], "abs"))    { type = 9; goto gotit; }
    26     if (!strcmp (argv[i], "int"))    { type = 9; goto gotit; }
    27     if (!strcmp (argv[i], "exp"))    { type = 9; goto gotit; }
    28     if (!strcmp (argv[i], "ten"))    { type = 9; goto gotit; }
    29     if (!strcmp (argv[i], "log"))    { type = 9; goto gotit; }
    30     if (!strcmp (argv[i], "ln"))     { type = 9; goto gotit; }
    31     if (!strcmp (argv[i], "sqrt"))   { type = 9; goto gotit; }
    32     if (!strcmp (argv[i], "erf"))    { type = 9; goto gotit; }
    33 
    34     if (!strcmp (argv[i], "sinh"))   { type = 9; goto gotit; }
    35     if (!strcmp (argv[i], "cosh"))   { type = 9; goto gotit; }
    36     if (!strcmp (argv[i], "asinh"))  { type = 9; goto gotit; }
    37     if (!strcmp (argv[i], "acosh"))  { type = 9; goto gotit; }
    38 
    39     if (!strcmp (argv[i], "sin"))    { type = 9; goto gotit; }
    40     if (!strcmp (argv[i], "cos"))    { type = 9; goto gotit; }
    41     if (!strcmp (argv[i], "tan"))    { type = 9; goto gotit; }
    42     if (!strcmp (argv[i], "dsin"))   { type = 9; goto gotit; }
    43     if (!strcmp (argv[i], "dcos"))   { type = 9; goto gotit; }
    44     if (!strcmp (argv[i], "dtan"))   { type = 9; goto gotit; }
    45     if (!strcmp (argv[i], "asin"))   { type = 9; goto gotit; }
    46     if (!strcmp (argv[i], "acos"))   { type = 9; goto gotit; }
    47     if (!strcmp (argv[i], "atan"))   { type = 9; goto gotit; }
    48     if (!strcmp (argv[i], "dasin"))  { type = 9; goto gotit; }
    49     if (!strcmp (argv[i], "dacos"))  { type = 9; goto gotit; }
    50     if (!strcmp (argv[i], "datan"))  { type = 9; goto gotit; }
    51 
    52     if (!strcmp (argv[i], "lgamma")) { type = 9; goto gotit; }
    53 
    54     if (!strcmp (argv[i], "rnd"))    { type = 9; goto gotit; }
    55     if (!strcmp (argv[i], "xramp"))  { type = 9; goto gotit; }
    56     if (!strcmp (argv[i], "yramp"))  { type = 9; goto gotit; }
    57     if (!strcmp (argv[i], "ramp"))   { type = 9; goto gotit; }
    58     if (!strcmp (argv[i], "zero"))   { type = 9; goto gotit; }
    59     if (!strcmp (argv[i], "--"))     { type = 9; goto gotit; }
    60     if (!strcmp (argv[i], "not"))    { type = 9; goto gotit; }
    61     if (!strcmp (argv[i], "isinf"))  { type = 9; goto gotit; }
    62     if (!strcmp (argv[i], "isnan"))  { type = 9; goto gotit; }
     25    if (!strcmp (argv[i], "abs"))    { type = DB_STACK_UNARY; goto gotit; }
     26    if (!strcmp (argv[i], "int"))    { type = DB_STACK_UNARY; goto gotit; }
     27    if (!strcmp (argv[i], "exp"))    { type = DB_STACK_UNARY; goto gotit; }
     28    if (!strcmp (argv[i], "ten"))    { type = DB_STACK_UNARY; goto gotit; }
     29    if (!strcmp (argv[i], "log"))    { type = DB_STACK_UNARY; goto gotit; }
     30    if (!strcmp (argv[i], "ln"))     { type = DB_STACK_UNARY; goto gotit; }
     31    if (!strcmp (argv[i], "sqrt"))   { type = DB_STACK_UNARY; goto gotit; }
     32    if (!strcmp (argv[i], "erf"))    { type = DB_STACK_UNARY; goto gotit; }
     33    if (!strcmp (argv[i], "sinh"))   { type = DB_STACK_UNARY; goto gotit; }
     34    if (!strcmp (argv[i], "cosh"))   { type = DB_STACK_UNARY; goto gotit; }
     35    if (!strcmp (argv[i], "asinh"))  { type = DB_STACK_UNARY; goto gotit; }
     36    if (!strcmp (argv[i], "acosh"))  { type = DB_STACK_UNARY; goto gotit; }
     37    if (!strcmp (argv[i], "sin"))    { type = DB_STACK_UNARY; goto gotit; }
     38    if (!strcmp (argv[i], "cos"))    { type = DB_STACK_UNARY; goto gotit; }
     39    if (!strcmp (argv[i], "tan"))    { type = DB_STACK_UNARY; goto gotit; }
     40    if (!strcmp (argv[i], "dsin"))   { type = DB_STACK_UNARY; goto gotit; }
     41    if (!strcmp (argv[i], "dcos"))   { type = DB_STACK_UNARY; goto gotit; }
     42    if (!strcmp (argv[i], "dtan"))   { type = DB_STACK_UNARY; goto gotit; }
     43    if (!strcmp (argv[i], "asin"))   { type = DB_STACK_UNARY; goto gotit; }
     44    if (!strcmp (argv[i], "acos"))   { type = DB_STACK_UNARY; goto gotit; }
     45    if (!strcmp (argv[i], "atan"))   { type = DB_STACK_UNARY; goto gotit; }
     46    if (!strcmp (argv[i], "dasin"))  { type = DB_STACK_UNARY; goto gotit; }
     47    if (!strcmp (argv[i], "dacos"))  { type = DB_STACK_UNARY; goto gotit; }
     48    if (!strcmp (argv[i], "datan"))  { type = DB_STACK_UNARY; goto gotit; }
     49    if (!strcmp (argv[i], "lgamma")) { type = DB_STACK_UNARY; goto gotit; }
     50    if (!strcmp (argv[i], "rnd"))    { type = DB_STACK_UNARY; goto gotit; }
     51    if (!strcmp (argv[i], "xramp"))  { type = DB_STACK_UNARY; goto gotit; }
     52    if (!strcmp (argv[i], "yramp"))  { type = DB_STACK_UNARY; goto gotit; }
     53    if (!strcmp (argv[i], "ramp"))   { type = DB_STACK_UNARY; goto gotit; }
     54    if (!strcmp (argv[i], "zero"))   { type = DB_STACK_UNARY; goto gotit; }
     55    if (!strcmp (argv[i], "--"))     { type = DB_STACK_UNARY; goto gotit; }
     56    if (!strcmp (argv[i], "not"))    { type = DB_STACK_UNARY; goto gotit; }
     57    if (!strcmp (argv[i], "isinf"))  { type = DB_STACK_UNARY; goto gotit; }
     58    if (!strcmp (argv[i], "isnan"))  { type = DB_STACK_UNARY; goto gotit; }
    6359
    6460    /* binary operations */
    65     if (!strcmp (argv[i], "^"))      { type = 8; goto gotit; }
    66 
    67     if (!strcmp (argv[i], "@"))      { type = 7; goto gotit; }
    68     if (!strcmp (argv[i], "/"))      { type = 7; goto gotit; }
    69     if (!strcmp (argv[i], "*"))      { type = 7; goto gotit; }
    70     if (!strcmp (argv[i], "%"))      { type = 7; goto gotit; }
    71 
    72     if (!strcmp (argv[i], "+"))      { type = 6; goto gotit; }
    73     if (!strcmp (argv[i], "-"))      { type = 6; goto gotit; }
     61    if (!strcmp (argv[i], "^"))      { type = DB_STACK_POWER; goto gotit; }
     62
     63    if (!strcmp (argv[i], "@"))      { type = DB_STACK_MULTIPLY; goto gotit; }
     64    if (!strcmp (argv[i], "/"))      { type = DB_STACK_MULTIPLY; goto gotit; }
     65    if (!strcmp (argv[i], "*"))      { type = DB_STACK_MULTIPLY; goto gotit; }
     66    if (!strcmp (argv[i], "%"))      { type = DB_STACK_MULTIPLY; goto gotit; }
     67
     68    if (!strcmp (argv[i], "+"))      { type = DB_STACK_SUM; goto gotit; }
     69    if (!strcmp (argv[i], "-"))      { type = DB_STACK_SUM; goto gotit; }
    7470       
    75     if (!strcmp (argv[i], "&"))      { type = 5; goto gotit; }
    76     if (!strcmp (argv[i], "|"))      { type = 5; goto gotit; }
    77 
    78     if (!strcmp (argv[i], "<"))      { type = 4; goto gotit; }
    79     if (!strcmp (argv[i], ">"))      { type = 4; goto gotit; }
    80     if (!strcmp (argv[i], "=="))     { type = 4; strcpy (argv[i], "E"); goto gotit; }
    81     if (!strcmp (argv[i], "!="))     { type = 4; strcpy (argv[i], "N"); goto gotit; }
    82     if (!strcmp (argv[i], "<="))     { type = 4; strcpy (argv[i], "L"); goto gotit; }
    83     if (!strcmp (argv[i], ">="))     { type = 4; strcpy (argv[i], "G"); goto gotit; }
    84     if (!strcmp (argv[i], ">>"))     { type = 4; strcpy (argv[i], "U"); goto gotit; }
    85     if (!strcmp (argv[i], "<<"))     { type = 4; strcpy (argv[i], "D"); goto gotit; }
    86 
    87     if (!strcmp (argv[i], "&&"))     { type = 3; strcpy (argv[i], "A"); goto gotit; }
    88     if (!strcmp (argv[i], "||"))     { type = 3; strcpy (argv[i], "O"); goto gotit; }
    89 
    90     if (!strcmp (argv[i], "("))      { type = 2; goto gotit; }
    91     if (!strcmp (argv[i], ")"))      { type = 1; goto gotit; }
     71    if (!strcmp (argv[i], "&"))      { type = DB_STACK_BITWISE; goto gotit; }
     72    if (!strcmp (argv[i], "|"))      { type = DB_STACK_BITWISE; goto gotit; }
     73
     74    if (!strcmp (argv[i], "<"))      { type = DB_STACK_COMPARE; goto gotit; }
     75    if (!strcmp (argv[i], ">"))      { type = DB_STACK_COMPARE; goto gotit; }
     76    if (!strcmp (argv[i], "=="))     { type = DB_STACK_COMPARE; strcpy (argv[i], "E"); goto gotit; }
     77    if (!strcmp (argv[i], "!="))     { type = DB_STACK_COMPARE; strcpy (argv[i], "N"); goto gotit; }
     78    if (!strcmp (argv[i], "<="))     { type = DB_STACK_COMPARE; strcpy (argv[i], "L"); goto gotit; }
     79    if (!strcmp (argv[i], ">="))     { type = DB_STACK_COMPARE; strcpy (argv[i], "G"); goto gotit; }
     80    if (!strcmp (argv[i], ">>"))     { type = DB_STACK_COMPARE; strcpy (argv[i], "U"); goto gotit; }
     81    if (!strcmp (argv[i], "<<"))     { type = DB_STACK_COMPARE; strcpy (argv[i], "D"); goto gotit; }
     82
     83    if (!strcmp (argv[i], "&&"))     { type = DB_STACK_LOGIC; strcpy (argv[i], "A"); goto gotit; }
     84    if (!strcmp (argv[i], "||"))     { type = DB_STACK_LOGIC; strcpy (argv[i], "O"); goto gotit; }
     85
     86    if (!strcmp (argv[i], "("))      { type = DB_STACK_OPEN_PAR; goto gotit; }
     87    if (!strcmp (argv[i], ")"))      { type = DB_STACK_CLOSE_PAR; goto gotit; }
    9288
    9389  gotit:
    9490    /* choose how to deal with object */
    9591    switch (type) {
    96       case 8:  /* exponentiation: 2^2^3 = 64 != 256 (precedence is right-to-left, not left-to-right!) */
     92      case DB_STACK_POWER:  /* exponentiation: 2^2^3 = 64 != 256 (precedence is right-to-left, not left-to-right!) */
    9793        /* pop previous, higher operators from OP stack to stack */
    9894        for (j = Nop_stack - 1; (j >= 0) && (op_stack[j].type > type); j--) {
     
    107103        Nop_stack ++;
    108104        break;
    109       case 9: /* unary OPs */
    110       case 7: /* binary OPs */
    111       case 6:
    112       case 5:
    113       case 4:
    114       case 3:
     105      case DB_STACK_UNARY: /* unary OPs */
     106      case DB_STACK_MULTIPLY: /* binary OPs */
     107      case DB_STACK_SUM:
     108      case DB_STACK_BITWISE:
     109      case DB_STACK_COMPARE:
     110      case DB_STACK_LOGIC:
    115111        /* pop previous, higher or equal operators from OP stack to stack */
    116112        for (j = Nop_stack - 1; (j >= 0) && (op_stack[j].type >= type); j--) {
     
    125121        Nop_stack ++;
    126122        break;
    127       case 2
     123      case DB_STACK_OPEN_PAR
    128124        /* push operator on OP stack */
    129125        op_stack[Nop_stack].name = strcreate (argv[i]);
     
    131127        Nop_stack ++;
    132128        break;
    133       case 1:
     129      case DB_STACK_CLOSE_PAR:
    134130        /* pop rest of operators from OP stack to stack, looking for '(' */
    135         for (j = Nop_stack - 1; (j >= 0) && (op_stack[j].type != 2); j--) {
     131        for (j = Nop_stack - 1; (j >= 0) && (op_stack[j].type != DB_STACK_OPEN_PAR); j--) {
    136132          stack[Nstack] = op_stack[j];
    137133          op_stack[j].name = NULL;
     
    139135          Nop_stack --;
    140136        }
    141         if ((j == -1) || (op_stack[j].type != 2)) {
     137        if ((j == -1) || (op_stack[j].type != DB_STACK_OPEN_PAR)) {
    142138          push_error ("syntax error: mismatched parenthesis");
    143139          Nstack = 0;
     
    150146        /* value of 'X' is used as sentinel until we sort out values */
    151147        stack[Nstack].name = strcreate (argv[i]);
    152         stack[Nstack].type = 'X';
     148        stack[Nstack].type = DB_STACK_VALUE;
    153149        Nstack ++;
    154150        break;
     
    156152  }
    157153
    158   /* dump remaining operators on stack, checking for ')' */
     154  /* dump remaining operators on stack, checking for '(' */
    159155  for (j = Nop_stack - 1; j >= 0; j--) {
    160     if (op_stack[j].type == 2) {
     156    if (op_stack[j].type == DB_STACK_OPEN_PAR) {
    161157      push_error ("syntax error: mismatched parenthesis");
    162158      Nstack = 0;
  • branches/eam_branch_20081124/Ohana/src/opihi/dvo/dbStackMath.c

    r15718 r20860  
    44static int NallocUnary = 0;
    55
    6 dbStack *dbBinary (dbStack *V1, dbStack *V2, char *op, float *fields) {
     6dbStack *dbBinary (dbStack *V1, dbStack *V2, char *op, dbValue *fields) {
    77
    8   int N;
    9   float M1, M2;
    108  dbStack *OUT;
    119 
    12   if (V1->type == 'F') {
    13     N = V1->field;
    14     M1 = fields[N];
    15   } else {
    16     M1 = V1->Float;
    17   }
    18  
    19   if (V2->type == 'F') {
    20     N = V2->field;
    21     M2 = fields[N];
    22   } else {
    23     M2 = V2->Float;
     10# define SS_FUNC(OP) {                                                  \
     11    if (!(V1->type & DB_STACK_INT) && !(V2->type & DB_STACK_INT)) {     \
     12      opihi_flt M1 = (V1->type & DB_STACK_FIELD) ? fields[V1->field].Flt : V1->FltValue; \
     13      opihi_flt M2 = (V2->type & DB_STACK_FIELD) ? fields[V2->field].Flt : V2->FltValue; \
     14      OUT[0].type = DB_STACK_VALUE | DB_STACK_TEMP;                     \
     15      OUT[0].FltValue = OP;                                             \
     16      break;                                                            \
     17    }                                                                   \
     18    if ((V1->type & DB_STACK_INT) && !(V2->type & DB_STACK_INT)) {      \
     19      opihi_int M1 = (V1->type & DB_STACK_FIELD) ? fields[V1->field].Int : V1->IntValue; \
     20      opihi_flt M2 = (V2->type & DB_STACK_FIELD) ? fields[V2->field].Flt : V2->FltValue; \
     21      OUT[0].type = DB_STACK_VALUE | DB_STACK_TEMP;                     \
     22      OUT[0].FltValue = OP;                                             \
     23      break;                                                            \
     24    }                                                                   \
     25    if (!(V1->type & DB_STACK_INT) && (V2->type & DB_STACK_INT)) {      \
     26      opihi_flt M1 = (V1->type & DB_STACK_FIELD) ? fields[V1->field].Flt : V1->FltValue; \
     27      opihi_int M2 = (V2->type & DB_STACK_FIELD) ? fields[V2->field].Int : V2->IntValue; \
     28      OUT[0].type = DB_STACK_VALUE | DB_STACK_TEMP;                     \
     29      OUT[0].FltValue = OP;                                             \
     30      break;                                                            \
     31    }                                                                   \
     32    if ((V1->type & DB_STACK_INT) && (V2->type & DB_STACK_INT)) {       \
     33      opihi_int M1 = (V1->type & DB_STACK_FIELD) ? fields[V1->field].Int : V1->IntValue; \
     34      opihi_int M2 = (V2->type & DB_STACK_FIELD) ? fields[V2->field].Int : V2->IntValue; \
     35      OUT[0].type = DB_STACK_VALUE | DB_STACK_TEMP | DB_STACK_INT;      \
     36      OUT[0].IntValue = OP;                                             \
     37      break;                                                            \
     38    }                                                                   \
    2439  }
    2540
    2641  NallocBinary ++;
    2742  ALLOCATE (OUT, dbStack, 1);
    28   OUT->type = 'T';
    2943  OUT->name = NULL;
    3044
    31   // use an enum for the op...
     45  // XXX use an enum for the op...
    3246  switch (op[0]) {
    33   case '+':
    34     OUT->Float = M1 + M2;
    35     break;
    36   case '-':
    37     OUT->Float = M1 - M2;
    38     break;
    39   case '*':
    40     OUT->Float = M1 * M2;
    41     break;
    42   case '/':
    43     OUT->Float = M1 / M2;
    44     break;
    45   case '%':
    46     OUT->Float = (int) M1 % (int) M2;
    47     break;
    48   case 0x5e:
    49     OUT->Float = pow (M1, M2);
    50     break;
    51   case 'D':
    52     OUT->Float = MIN (M1, M2);
    53     break;
    54   case 'U':
    55     OUT->Float = MAX (M1, M2);
    56     break;
    57   case '<':
    58     OUT->Float = (M1 < M2) ? 1 : 0;
    59     break;
    60   case '>':
    61     OUT->Float = (M1 > M2) ? 1 : 0;
    62     break;
    63   case '&':
    64     OUT->Float = ((int)M1 & (int)M2);
    65     break;
    66   case '|':
    67     OUT->Float = ((int)M1 | (int)M2);
    68     break;
    69   case 'E':
    70     OUT->Float = (M1 == M2) ? 1 : 0;
    71     break;
    72   case 'N':
    73     OUT->Float = (M1 != M2) ? 1 : 0;
    74     break;
    75   case 'L':
    76     OUT->Float = (M1 <= M2) ? 1 : 0;
    77     break;
    78   case 'G':
    79     OUT->Float = (M1 >= M2) ? 1 : 0;
    80     break;
    81   case 'A':
    82     OUT->Float = (M1 && M2) ? 1 : 0;
    83     break;
    84   case 'O':
    85     OUT->Float = (M1 || M2) ? 1 : 0;
    86     break;
     47    case '+': SS_FUNC(M1 + M2);
     48    case '-': SS_FUNC(M1 - M2);
     49    case '*': SS_FUNC(M1 * M2);
     50    case '/': SS_FUNC(M1 / M2);
     51    case '%': SS_FUNC((int) M1 % (int) M2);
     52    case '^': SS_FUNC(pow (M1, M2));
     53    case 'D': SS_FUNC(MIN (M1, M2));
     54    case 'U': SS_FUNC(MAX (M1, M2));
     55    case '<': SS_FUNC((M1 < M2) ? 1 : 0);
     56    case '>': SS_FUNC((M1 > M2) ? 1 : 0);
     57    case '&': SS_FUNC(((int)M1 & (int)M2));
     58    case '|': SS_FUNC(((int)M1 | (int)M2));
     59    case 'E': SS_FUNC((M1 == M2) ? 1 : 0);
     60    case 'N': SS_FUNC((M1 != M2) ? 1 : 0);
     61    case 'L': SS_FUNC((M1 <= M2) ? 1 : 0);
     62    case 'G': SS_FUNC((M1 >= M2) ? 1 : 0);
     63    case 'A': SS_FUNC((M1 && M2) ? 1 : 0);
     64    case 'O': SS_FUNC((M1 || M2) ? 1 : 0);
    8765  default:
    8866    return (NULL);
    8967  }
    90 
     68# undef SS_FUNC
     69 
    9170  return (OUT);
    9271}
    9372
    94 dbStack *dbUnary (dbStack *V1, char *op, float *fields) {
     73dbStack *dbUnary (dbStack *V1, char *op, dbValue *fields) {
    9574
    96   int N;
    97   float M1;
    9875  dbStack *OUT;
     76 
     77# define S_FUNC(OP,FTYPE) {                                             \
     78    if (!(V1->type & DB_STACK_INT)) {                                   \
     79      opihi_flt M1 = (V1->type & DB_STACK_FIELD) ? fields[V1->field].Flt : V1->FltValue; \
     80      OUT[0].type = DB_STACK_VALUE | DB_STACK_TEMP;                     \
     81      OUT[0].FltValue = OP;                                             \
     82      return (OUT);                                                     \
     83    }                                                                   \
     84    if ((FTYPE != DB_STACK_INT) && (V1->type & DB_STACK_INT)) {         \
     85      opihi_int M1 = (V1->type & DB_STACK_FIELD) ? fields[V1->field].Int : V1->IntValue; \
     86      OUT[0].type = DB_STACK_VALUE | DB_STACK_TEMP;                     \
     87      OUT[0].FltValue = OP;                                             \
     88      return (OUT);                                                     \
     89    }                                                                   \
     90    if ((FTYPE == DB_STACK_INT) && (V1->type & DB_STACK_INT)) {         \
     91      opihi_int M1 = (V1->type & DB_STACK_FIELD) ? fields[V1->field].Int : V1->IntValue; \
     92      OUT[0].type = DB_STACK_VALUE | DB_STACK_TEMP | DB_STACK_INT;      \
     93      OUT[0].IntValue = OP;                                             \
     94      return (OUT);                                                     \
     95    }                                                                   \
     96  }
    9997
    100   if (V1->type == 'F') {
    101     N = V1->field;
    102     M1 = fields[N];
    103   } else {
    104     M1 = V1->Float;
    105   }
    106  
    10798  NallocUnary ++;
    10899  ALLOCATE (OUT, dbStack, 1);
    109   OUT->type = 'T';
    110100  OUT->name = NULL;
    111101
    112   if (!strcmp (op, "="))      {   OUT->Float = M1;                 }
    113   if (!strcmp (op, "abs"))    {   OUT->Float = fabs(M1);           }
    114   if (!strcmp (op, "int"))    {   OUT->Float = (float)(int)(M1);   }
    115   if (!strcmp (op, "exp"))    {   OUT->Float = exp (M1);           }
    116   if (!strcmp (op, "ten"))    {   OUT->Float = pow (10.0,M1);      }
    117   if (!strcmp (op, "log"))    {   OUT->Float = log10 (M1);         }
    118   if (!strcmp (op, "ln"))     {   OUT->Float = log (M1);           }
    119   if (!strcmp (op, "sqrt"))   {   OUT->Float = sqrt (M1);          }
    120   if (!strcmp (op, "erf"))    {   OUT->Float = erf (M1);           }
    121                                                      
    122   if (!strcmp (op, "sinh"))   {   OUT->Float = sinh (M1);          }
    123   if (!strcmp (op, "cosh"))   {   OUT->Float = cosh (M1);          }
    124   if (!strcmp (op, "asinh"))  {   OUT->Float = asinh (M1);         }
    125   if (!strcmp (op, "acosh"))  {   OUT->Float = acosh (M1);         }
    126   if (!strcmp (op, "lgamma")) {   OUT->Float = lgamma (M1);        }
     102  if (!strcmp (op, "="))      S_FUNC(M1,0);
     103  if (!strcmp (op, "abs"))    S_FUNC(fabs(M1),0);
     104  if (!strcmp (op, "int"))    S_FUNC((int)(M1),DB_STACK_INT);
     105  if (!strcmp (op, "exp"))    S_FUNC(exp (M1),0);
     106  if (!strcmp (op, "ten"))    S_FUNC(pow (10.0,M1),0);
     107  if (!strcmp (op, "log"))    S_FUNC(log10 (M1),0);
     108  if (!strcmp (op, "ln"))     S_FUNC(log (M1),0);
     109  if (!strcmp (op, "sqrt"))   S_FUNC(sqrt (M1),0);
     110  if (!strcmp (op, "erf"))    S_FUNC(erf (M1),0);
    127111
    128   if (!strcmp (op, "sin"))    {   OUT->Float = sin (M1);           }
    129   if (!strcmp (op, "cos"))    {   OUT->Float = cos (M1);           }
    130   if (!strcmp (op, "tan"))    {   OUT->Float = tan (M1);           }
    131   if (!strcmp (op, "dsin"))   {   OUT->Float = sin (M1*RAD_DEG);   }
    132   if (!strcmp (op, "dcos"))   {   OUT->Float = cos (M1*RAD_DEG);   }
    133   if (!strcmp (op, "dtan"))   {   OUT->Float = tan (M1*RAD_DEG);   }
    134   if (!strcmp (op, "asin"))   {   OUT->Float = asin (M1);          }
    135   if (!strcmp (op, "acos"))   {   OUT->Float = acos (M1);          }
    136   if (!strcmp (op, "atan"))   {   OUT->Float = atan (M1);          }
    137   if (!strcmp (op, "dasin"))  {   OUT->Float = asin (M1)*DEG_RAD;  }
    138   if (!strcmp (op, "dacos"))  {   OUT->Float = acos (M1)*DEG_RAD;  }
    139   if (!strcmp (op, "datan"))  {   OUT->Float = atan (M1)*DEG_RAD;  }
    140   if (!strcmp (op, "rnd"))    {   OUT->Float = drand48();          }
    141   if (!strcmp (op, "not"))    {   OUT->Float = !(M1);              }
    142   if (!strcmp (op, "--"))     {   OUT->Float = - (M1);             }
    143   if (!strcmp (op, "isinf"))  {   OUT->Float = !finite(M1);        }
    144   if (!strcmp (op, "isnan"))  {   OUT->Float = isnan(M1);          }
     112  if (!strcmp (op, "sinh"))   S_FUNC(sinh (M1),0);
     113  if (!strcmp (op, "cosh"))   S_FUNC(cosh (M1),0);
     114  if (!strcmp (op, "asinh"))  S_FUNC(asinh (M1),0);
     115  if (!strcmp (op, "acosh"))  S_FUNC(acosh (M1),0);
     116  if (!strcmp (op, "lgamma")) S_FUNC(lgamma (M1),0);
     117
     118  if (!strcmp (op, "sin"))    S_FUNC(sin (M1),0);
     119  if (!strcmp (op, "cos"))    S_FUNC(cos (M1),0);
     120  if (!strcmp (op, "tan"))    S_FUNC(tan (M1),0);
     121  if (!strcmp (op, "dsin"))   S_FUNC(sin (M1*RAD_DEG),0);
     122  if (!strcmp (op, "dcos"))   S_FUNC(cos (M1*RAD_DEG),0);
     123  if (!strcmp (op, "dtan"))   S_FUNC(tan (M1*RAD_DEG),0);
     124  if (!strcmp (op, "asin"))   S_FUNC(asin (M1),0);
     125  if (!strcmp (op, "acos"))   S_FUNC(acos (M1),0);
     126  if (!strcmp (op, "atan"))   S_FUNC(atan (M1),0);
     127  if (!strcmp (op, "dasin"))  S_FUNC(asin (M1)*DEG_RAD,0);
     128  if (!strcmp (op, "dacos"))  S_FUNC(acos (M1)*DEG_RAD,0);
     129  if (!strcmp (op, "datan"))  S_FUNC(atan (M1)*DEG_RAD,0);
     130  if (!strcmp (op, "rnd"))    S_FUNC(M1*0.0 + drand48(),0);
     131  if (!strcmp (op, "not"))    S_FUNC(!(M1),DB_STACK_INT);
     132  if (!strcmp (op, "--"))     S_FUNC(- (M1),DB_STACK_INT);
     133  if (!strcmp (op, "isinf"))  S_FUNC(!finite(M1),DB_STACK_INT);
     134  if (!strcmp (op, "isnan"))  S_FUNC(isnan(M1),DB_STACK_INT);
    145135
    146136  return (OUT);
  • branches/eam_branch_20081124/Ohana/src/opihi/dvo/dbStackOps.c

    r15719 r20860  
    22
    33void dbInitStack (dbStack *stack) {
    4   stack[0].type   = 0;
     4  stack[0].type   = DB_STACK_NONE;
    55  stack[0].name   = NULL;
    66}
     
    3434void dbFreeTempEntry (dbStack *stack) {
    3535
    36   if (stack->type != 'T') return;
     36  if (stack->type & DB_STACK_TEMP) return;
    3737
    3838  if (stack[0].name != NULL)  free (stack[0].name);
  • branches/eam_branch_20081124/Ohana/src/opihi/dvo/fitcolors.c

    r20857 r20860  
    318318        graphdata.color = KapaColorByName ("red");
    319319
    320         KapaPrepPlot (kapa, 11, graphmode);
     320        KapaPrepPlot (kapa, 11, &graphdata);
    321321        KapaPlotVector (kapa, 11, colorFit, "x");
    322322        KapaPlotVector (kapa, 11, deltaFit, "y");
  • branches/eam_branch_20081124/Ohana/src/opihi/dvo/images.c

    r20859 r20860  
    113113
    114114  npts = NPTS = 200;
    115   ResetVector (Xvec, OPIHI_FLT, NPTS);
    116   ResetVector (Yvec, OPIHI_FLT, NPTS);
     115  ResetVector (&Xvec, OPIHI_FLT, NPTS);
     116  ResetVector (&Yvec, OPIHI_FLT, NPTS);
    117117
    118118  ALLOCATE (plist, int, NPTS);
     
    281281    graphmode.ptype = 100; /* connect pairs of points */
    282282    graphmode.etype = 0;
    283     PlotVectorPair (kapa, Xvec, Yvec, &graphmode);
     283    PlotVectorPair (kapa, &Xvec, &Yvec, &graphmode);
    284284  }
    285285
  • branches/eam_branch_20081124/Ohana/src/opihi/dvo/imbox.c

    r20859 r20860  
    3636 
    3737  /* project this image to screen display coords */
    38   ResetVector (Xvec, OPIHI_FLT, 8);
    39   ResetVector (Yvec, OPIHI_FLT, 8);
     38  ResetVector (&Xvec, OPIHI_FLT, 8);
     39  ResetVector (&Yvec, OPIHI_FLT, 8);
    4040
    4141  while (gfits_fread_header (f, &header)) {
     
    104104      graphmode.ptype = 100; /* connect pairs of points */
    105105      graphmode.etype = 0;
    106       PlotVectorPair (kapa, Xvec, Yvec, &graphmode);
     106      PlotVectorPair (kapa, &Xvec, &Yvec, &graphmode);
    107107    }
    108108  skip:
  • branches/eam_branch_20081124/Ohana/src/opihi/dvo/imdense.c

    r20859 r20860  
    3232  N = 0;
    3333  NPTS = 200;
    34   ResetVector (Xvec, OPIHI_FLT, Npts);
    35   ResetVector (Yvec, OPIHI_FLT, Npts);
     34  ResetVector (&Xvec, OPIHI_FLT, NPTS);
     35  ResetVector (&Yvec, OPIHI_FLT, NPTS);
    3636
    3737  for (i = 0; i < Nimage; i++) {
     
    6464    graphmode.style = 2; /* points */
    6565    graphmode.etype = 0;
    66     PlotVectorPair (kapa, Xvec, Yvec, &graphmode);
     66    PlotVectorPair (kapa, &Xvec, &Yvec, &graphmode);
    6767  }
    6868
  • branches/eam_branch_20081124/Ohana/src/opihi/dvo/imstats.c

    r20859 r20860  
    3333
    3434  /* assign vector values */
    35   ResetVector (Xvec, OPIHI_FLT, Nimage);
    36   ResetVector (Yvec, OPIHI_FLT, Nimage);
     35  ResetVector (&Xvec, OPIHI_FLT, Nimage);
     36  ResetVector (&Yvec, OPIHI_FLT, Nimage);
    3737
    3838  gprint (GP_LOG, "seq  ra (J2000) dec    time (s)   Nstars\n");
     
    5353  graphmode.style = 2;
    5454  graphmode.etype = 0;
    55   PlotVectorPair (kapa, Xvec, Yvec, &graphmode);
     55  PlotVectorPair (kapa, &Xvec, &Yvec, &graphmode);
    5656 
    5757  free (Xvec.elements.Flt);
  • branches/eam_branch_20081124/Ohana/src/opihi/dvo/lcurve.c

    r20859 r20860  
    104104  N = 0;
    105105  NPTS = 100;
    106   ResetVector (Xvec, OPIHI_FLT, NPTS);
    107   ResetVector (Yvec, OPIHI_FLT, NPTS);
     106  ResetVector (&Xvec, OPIHI_FLT, NPTS);
     107  ResetVector (&Yvec, OPIHI_FLT, NPTS);
    108108  dYvec.elements.Flt = NULL;
    109109  if (ErrorBars) {   
    110     ResetVector (Yvec, OPIHI_FLT, NPTS);
     110    ResetVector (&dYvec, OPIHI_FLT, NPTS);
    111111  }
    112112
     
    157157
    158158  if (ErrorBars) {
    159     PlotVectorPairErrors (kapa, Xvec, Yvec, dYvec, &graphmode);
     159    PlotVectorPairErrors (kapa, &Xvec, &Yvec, &dYvec, &graphmode);
    160160  } else {
    161     PlotVectorPair (kapa, Xvec, Yvec, &graphmode);
     161    PlotVectorPair (kapa, &Xvec, &Yvec, &graphmode);
    162162  }
    163163
  • branches/eam_branch_20081124/Ohana/src/opihi/dvo/lightcurve.c

    r20859 r20860  
    8787  N = 0;
    8888  NPTS = 100;
    89   ResetVector (tvec, OPIHI_FLT, Npts);
    90   ResetVector (mvec, OPIHI_FLT, Npts);
    91   ResetVector (dmvec, OPIHI_FLT, Npts);
     89  ResetVector (tvec, OPIHI_FLT, NPTS);
     90  ResetVector (mvec, OPIHI_FLT, NPTS);
     91  ResetVector (dmvec, OPIHI_FLT, NPTS);
    9292 
    9393  GetTimeFormat (&TimeReference, &TimeFormat);
  • branches/eam_branch_20081124/Ohana/src/opihi/dvo/mextract.c

    r20857 r20860  
    8888
    8989  /* create storage vector */
     90  Npts = 0;
     91  NPTS = 1000;
    9092  ALLOCATE (values, dbValue, Nfields);
    9193  ALLOCATE (vec, Vector *, Nreturn);
     
    9799    }
    98100    if ((vec[i] = SelectVector (name, ANYVECTOR, TRUE)) == NULL) goto escape;
    99     ResetVector (vec[i], fields[i].type, NNN);
    100   }
    101 
    102   Npts = 0;
    103   NPTS = 1;
     101    ResetVector (vec[i], fields[i].type, NPTS);
     102  }
    104103
    105104  // grab data from all selected sky regions
     
    166165
    167166  for (n = 0; n < Nreturn; n++) {
    168     vec[n][0].Nelements = Npts;
    169     REALLOCATE (vec[n][0].elements.Flt, opihi_flt, MAX(1,Npts));
     167    ResetVector (vec[n], fields[n].type, MAX(1,Npts));
    170168  }
    171169
  • branches/eam_branch_20081124/Ohana/src/opihi/dvo/paverage.c

    r20857 r20860  
    144144      }
    145145      if ((Npts > NCHUNK) || (Nloaded >= 25)) {
    146         KapaPrepPlot (kapa, Npts, graphmode);
     146        KapaPrepPlot (kapa, Npts, &graphmode);
    147147        KapaPlotVector (kapa, Npts, Xvec, "x");
    148148        KapaPlotVector (kapa, Npts, Yvec, "y");
     
    156156  }
    157157  if (Npts > 0) {
    158     KapaPrepPlot (kapa, Npts, graphmode);
     158    KapaPrepPlot (kapa, Npts, &graphmode);
    159159    KapaPlotVector (kapa, Npts, Xvec, "x");
    160160    KapaPlotVector (kapa, Npts, Yvec, "y");
  • branches/eam_branch_20081124/Ohana/src/opihi/dvo/pmeasure.c

    r20857 r20860  
    229229        }
    230230        if ((Npts > NCHUNK) || (Nloaded >= 25)) {
    231           KapaPrepPlot (kapa, Npts, graphmode);
     231          KapaPrepPlot (kapa, Npts, &graphmode);
    232232          KapaPlotVector (kapa, Npts, Xvec, "x");
    233233          KapaPlotVector (kapa, Npts, Yvec, "y");
     
    242242  }
    243243  if (Npts > 0) {
    244     KapaPrepPlot (kapa, Npts, graphmode);
     244    KapaPrepPlot (kapa, Npts, &graphmode);
    245245    KapaPlotVector (kapa, Npts, Xvec, "x");
    246246    KapaPlotVector (kapa, Npts, Yvec, "y");
  • branches/eam_branch_20081124/Ohana/src/opihi/dvo/procks.c

    r20859 r20860  
    9595
    9696  /* data has been loaded, get ready to plot it */
    97   ResetVector (Xvec, OPIHI_FLT, 3*Nrocks);
    98   ResetVector (Yvec, OPIHI_FLT, 3*Nrocks);
     97  ResetVector (&Xvec, OPIHI_FLT, 3*Nrocks);
     98  ResetVector (&Yvec, OPIHI_FLT, 3*Nrocks);
    9999 
    100100  /* project stars to screen display coords */
     
    113113  graphmode.style = 2; /* set style to points */
    114114  graphmode.etype = 0; /* no errorbars */
    115   PlotVectorPair (kapa, Xvec, Yvec, &graphmode);
     115  PlotVectorPair (kapa, &Xvec, &Yvec, &graphmode);
    116116
    117117  /* now plot vectors between two extrema */
     
    146146  graphmode.etype = 0; /* no errorbars */
    147147
    148   PlotVectorPair (kapa, Xvec, Yvec, &graphmode);
     148  PlotVectorPair (kapa, &Xvec, &Yvec, &graphmode);
    149149
    150150  free (Xvec.elements.Flt);
  • branches/eam_branch_20081124/Ohana/src/opihi/dvo/showtile.c

    r20859 r20860  
    2222  N = 0;
    2323  NPTS = 200;
    24   ResetVector (Xvec, OPIHI_FLT, NPTS);
    25   ResetVector (Yvec, OPIHI_FLT, NPTS);
     24  ResetVector (&Xvec, OPIHI_FLT, NPTS);
     25  ResetVector (&Yvec, OPIHI_FLT, NPTS);
    2626
    2727  /* starting position */
     
    8686    graphmode.ptype = 100; /* connect pairs of points */
    8787    graphmode.etype = 0;
    88     PlotVectorPair (kapa, Xvec, Yvec, &graphmode);
     88    PlotVectorPair (kapa, &Xvec, &Yvec, &graphmode);
    8989  }
    9090
  • branches/eam_branch_20081124/Ohana/src/opihi/dvo/simage.c

    r20859 r20860  
    9292
    9393  /* set up storage buffers */
    94   ResetVector (Xvec, OPIHI_FLT, Ntars);
    95   ResetVector (Yvec, OPIHI_FLT, Ntars);
    96   ResetVector (Zvec, OPIHI_FLT, Ntars);
     94  ResetVector (&Xvec, OPIHI_FLT, Nstars);
     95  ResetVector (&Yvec, OPIHI_FLT, Nstars);
     96  ResetVector (&Zvec, OPIHI_FLT, Nstars);
    9797  ALLOCATE (buffer, char, (BLOCK*BYTES_STAR));
    9898
     
    152152  Npts = Xvec.Nelements;
    153153
    154   PlotVectorTriplet (kapa, Xvec, Yvec, Zvec, &graphmode);
     154  PlotVectorTriplet (kapa, &Xvec, &Yvec, &Zvec, &graphmode);
    155155
    156156  free (Xvec.elements.Flt);
  • branches/eam_branch_20081124/Ohana/src/opihi/dvo/skycat.c

    r20859 r20860  
    101101    graphmode.ptype = 100; /* connect pairs of points */
    102102    graphmode.etype = 0;
    103     PlotVectorPair (kapa, Xvec, Yvec, &graphmode);
     103    PlotVectorPair (kapa, &Xvec, &Yvec, &graphmode);
    104104  }
    105105
    106   free (Xvec.elements.Flt);
    107   free (Yvec.elements.Flt);
     106  free (Xvec.elements.Ptr);
     107  free (Yvec.elements.Ptr);
    108108  free (regions);
    109109
  • branches/eam_branch_20081124/Ohana/src/opihi/include/dvomath.h

    r20857 r20860  
    1414    gprint (GP_ERR, "function requires vector of type FLT\n"); \
    1515    return (RVAL); \
    16   }
     16  } }
    1717
    18 # define REQUIRE_VECTOR_INT(VECT,RVAL) { \
     18# define REQUIRE_VECTOR_INT(VECT,RVAL) {        \
    1919  if (VECT->type != OPIHI_INT) { \
    2020    gprint (GP_ERR, "function requires vector of type INT\n"); \
    2121    return (RVAL); \
    22   }
     22  } }
    2323
    2424enum {ANYVECTOR, NEWVECTOR, OLDVECTOR};
     
    109109void          InitVectors           PROTO((void));
    110110int           CopyVector            PROTO((Vector *out, Vector *in));
     111int           ResetVector           PROTO((Vector *vec, char type, int Nelements));
     112int           CastVector            PROTO((Vector *vec, char type));
    111113int           MatchVector           PROTO((Vector *out, Vector *in, char type));
    112114int           MoveVector            PROTO((Vector *out, Vector *in));
  • branches/eam_branch_20081124/Ohana/src/opihi/include/dvoshell.h

    r20857 r20860  
    55# ifndef DVOSHELL_H
    66# define DVOSHELL_H
     7
     8typedef enum {
     9  DB_STACK_NONE  = 0,
     10  DB_STACK_INT   = 0x01,
     11  DB_STACK_FIELD = 0x02,
     12  DB_STACK_TEMP  = 0x04,
     13  DB_STACK_VALUE = 0x08,
     14  DB_STACK_CLOSE_PAR = 0x10,
     15  DB_STACK_OPEN_PAR,
     16  DB_STACK_LOGIC,
     17  DB_STACK_COMPARE,
     18  DB_STACK_BITWISE,
     19  DB_STACK_SUM,
     20  DB_STACK_MULTIPLY,
     21  DB_STACK_POWER,
     22  DB_STACK_UNARY,
     23} dbStackTypes;
    724
    825/* magnitude types */
     
    145162  char    type;
    146163  int     field;
    147   float   Float;
     164  opihi_flt FltValue;
     165  opihi_int IntValue;
    148166} dbStack;
    149167
     
    234252dbStack     *dbRPN                  PROTO((int argc, char **argv, int *nstack));
    235253int          dbCheckStack           PROTO((dbStack *stack, int Nstack, int table, dbField **inFields, int *Nfields));
    236 int          dbBooleanCond          PROTO((dbStack *inStack, int NinStack, float *fields));
     254int          dbBooleanCond          PROTO((dbStack *inStack, int NinStack, dbValue *fields));
    237255void         dbInitStack            PROTO((dbStack *stack));
    238256void         dbFreeStack            PROTO((dbStack *stack, int Nstack));
     
    240258void         dbFreeTempEntry        PROTO((dbStack *stack));
    241259
    242 dbStack     *dbBinary               PROTO((dbStack *V1, dbStack *V2, char *op, float *fields));
    243 dbStack     *dbUnary                PROTO((dbStack *V1, char *op, float *fields));
     260dbStack     *dbBinary               PROTO((dbStack *V1, dbStack *V2, char *op, dbValue *fields));
     261dbStack     *dbUnary                PROTO((dbStack *V1, char *op, dbValue *fields));
    244262
    245263int          GetMagMode             PROTO((char *string));
     
    248266int          ParseAverageField      PROTO((dbField *field, char *fieldName));
    249267
    250 double       dbExtractAverages      PROTO((Average *average, SecFilt *secfilt, Measure *measure, dbField *field));
    251 double       dbExtractMeasures      PROTO((Average *average, SecFilt *secfilt, Measure *measure, dbField *field));
     268dbValue      dbExtractAverages      PROTO((Average *average, SecFilt *secfilt, Measure *measure, dbField *field));
     269dbValue      dbExtractMeasures      PROTO((Average *average, SecFilt *secfilt, Measure *measure, dbField *field));
    252270void         dbExtractMeasuresInit  PROTO(());
    253271
  • branches/eam_branch_20081124/Ohana/src/opihi/lib.shell/VectorOps.c

    r20859 r20860  
    190190int CastVector (Vector *vec, char type) {
    191191
     192  int i;
     193
    192194  // the trivial case
    193195  if (vec[0].type == type) return TRUE;
Note: See TracChangeset for help on using the changeset viewer.