mirror of
https://github.com/cc65/cc65.git
synced 2025-01-14 00:32:08 +00:00
Added some code to handle floats/doubles.
git-svn-id: svn://svn.cc65.org/cc65/trunk@2487 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
89d4ba5553
commit
f1b0fb9763
@ -63,6 +63,7 @@
|
|||||||
#define CF_INT 0x0001 /* Operation on ints */
|
#define CF_INT 0x0001 /* Operation on ints */
|
||||||
#define CF_PTR CF_INT /* Alias for readability */
|
#define CF_PTR CF_INT /* Alias for readability */
|
||||||
#define CF_LONG 0x0000 /* Operation on longs */
|
#define CF_LONG 0x0000 /* Operation on longs */
|
||||||
|
#define CF_FLOAT 0x0004 /* Operation on a float */
|
||||||
|
|
||||||
#define CF_NOKEEP 0x0008 /* Value may get destroyed when storing */
|
#define CF_NOKEEP 0x0008 /* Value may get destroyed when storing */
|
||||||
|
|
||||||
|
@ -570,6 +570,11 @@ unsigned TypeOf (const type* T)
|
|||||||
case T_ULONG:
|
case T_ULONG:
|
||||||
return CF_LONG | CF_UNSIGNED;
|
return CF_LONG | CF_UNSIGNED;
|
||||||
|
|
||||||
|
case T_FLOAT:
|
||||||
|
case T_DOUBLE:
|
||||||
|
/* These two are identical in the backend */
|
||||||
|
return CF_FLOAT;
|
||||||
|
|
||||||
case T_FUNC:
|
case T_FUNC:
|
||||||
F = DecodePtr (T+1);
|
F = DecodePtr (T+1);
|
||||||
return (F->Flags & FD_VARIADIC)? 0 : CF_FIXARGC;
|
return (F->Flags & FD_VARIADIC)? 0 : CF_FIXARGC;
|
||||||
|
@ -502,6 +502,18 @@ static void ParseTypeSpec (DeclSpec* D, int Default)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case TOK_FLOAT:
|
||||||
|
NextToken ();
|
||||||
|
D->Type[0] = T_FLOAT;
|
||||||
|
D->Type[1] = T_END;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TOK_DOUBLE:
|
||||||
|
NextToken ();
|
||||||
|
D->Type[0] = T_DOUBLE;
|
||||||
|
D->Type[1] = T_END;
|
||||||
|
break;
|
||||||
|
|
||||||
case TOK_STRUCT:
|
case TOK_STRUCT:
|
||||||
case TOK_UNION:
|
case TOK_UNION:
|
||||||
StructType = (CurTok.Tok == TOK_STRUCT)? T_STRUCT : T_UNION;
|
StructType = (CurTok.Tok == TOK_STRUCT)? T_STRUCT : T_UNION;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user