xp_comm_proj/gnrlhist/genhisto.c
/* takes a value in an untyped location,               */
/* the value's AVS datatype and returns it as a double */
takes a value in an untyped location,
the value's AVS datatype and returns it as a double
takes a value in an untyped location the value ' s AVS datatype and returns it as a double
double readvalue(int d_type, char *input)
{
   double result;
   switch (d_type){
           case DTYPE_CHAR: 
              result= (double)*(char *)(input);
              break;
       	    case DTYPE_BYTE:
              result= (double)*(char *)(input);
              break;
	    case DTYPE_SHORT:
              result= (double)*(short *)(input);
              break;
	    case DTYPE_INT:
              result= (double)*(int *)(input);
              break;
	    case DTYPE_FLOAT:
              result= (double)*(float *)(input);
              break; 
	    case DTYPE_DOUBLE:
              result= (double)*(double *)(input);
              break;
	    default:
	      ERROR("Node data is of an unknown data type.");
    }
  return result;
}
double readvalue ( int d_type , char * input ) { double result ; switch ( d_type ) { case DTYPE_CHAR : result = ( double ) * ( char * ) ( input ) ; break ; case DTYPE_BYTE : result = ( double ) * ( char * ) ( input ) ; break ; case DTYPE_SHORT : result = ( double ) * ( short * ) ( input ) ; break ; case DTYPE_INT : result = ( double ) * ( int * ) ( input ) ; break ; case DTYPE_FLOAT : result = ( double ) * ( float * ) ( input ) ; break ; case DTYPE_DOUBLE : result = ( double ) * ( double * ) ( input ) ; break ; default : ERROR ( " " ) ; } return result ; }
takes a value in an untyped location,
the value's AVS datatype and returns it as a double
takes a value in an untyped location the value ' s AVS datatype and returns it as a double