-#if 0
-double
-floatFromVal (value * val)
-{
- double res;
-
- if (!val)
- return 0;
-
- if (val->etype && SPEC_SCLS (val->etype) != S_LITERAL)
- {
- werror (E_CONST_EXPECTED, val->name);
- return 0;
- }
-
- /* if it is not a specifier then we can assume that */
- /* it will be an unsigned long */
- if (!IS_SPEC (val->type)) {
- //return (double) SPEC_CVAL (val->etype).v_ulong;
- res =SPEC_CVAL (val->etype).v_ulong;
- goto ret;
- }
-
- if (SPEC_NOUN (val->etype) == V_FLOAT) {
- //return (double) SPEC_CVAL (val->etype).v_float;
- res =SPEC_CVAL (val->etype).v_float;
- goto ret;
- }
-
- if (SPEC_NOUN (val->etype) == V_FIXED16X16) {
- res =doubleFromFixed16x16( SPEC_CVAL (val->etype).v_fixed16x16 );
- goto ret;
- }
-
- if (SPEC_LONG (val->etype))
- {
- if (SPEC_USIGN (val->etype)) {
- //return (double) SPEC_CVAL (val->etype).v_ulong;
- res =SPEC_CVAL (val->etype).v_ulong;
- goto ret;
- }
- else {
- //return (double) SPEC_CVAL (val->etype).v_long;
- res =SPEC_CVAL (val->etype).v_long;
- goto ret;
- }
- }
-
- if (SPEC_NOUN (val->etype) == V_INT) {
- if (SPEC_USIGN (val->etype)) {
- //return (double) SPEC_CVAL (val->etype).v_uint;
- res =SPEC_CVAL (val->etype).v_uint;
- goto ret;
- }
- else {
- //return (double) SPEC_CVAL (val->etype).v_int;
- res =SPEC_CVAL (val->etype).v_int;
- goto ret;
- }
- }
-
- if (SPEC_NOUN (val->etype) == V_CHAR) {
- if (SPEC_USIGN (val->etype)) {
- //return (double) (unsigned char)SPEC_CVAL (val->etype).v_uint;
- res =(unsigned char)SPEC_CVAL (val->etype).v_uint;
- goto ret;
- }
- else
- {
- res = (signed char)SPEC_CVAL (val->etype).v_int;
- goto ret;
- }
- }
-
- if (IS_BITVAR(val->etype)) {
- //return (double) SPEC_CVAL (val->etype).v_uint;
- res =SPEC_CVAL (val->etype).v_uint;
- goto ret;
- }
-
- if (SPEC_NOUN (val->etype) == V_VOID) {
- //return (double) SPEC_CVAL (val->etype).v_ulong;
- res = SPEC_CVAL (val->etype).v_ulong;
- goto ret;
- }
-
- // we are lost !
- werror (E_INTERNAL_ERROR, __FILE__, __LINE__,
- "floatFromVal: unknown value");
- return 0;
-
-ret:
- printf("floatFromVal(%f)\n", res);
- return res;
-}
-#endif
-