From ecf59842e472d28a54a16acffe4aaa2f882108c6 Mon Sep 17 00:00:00 2001 From: Flavio Cruz Date: Tue, 19 Apr 2016 03:05:13 -0400 Subject: Make MIG recognize the basic C integral types. Also removed itMakeIntType which was not used anymore. Users can use char, int, and short types without having to define them. These types are defined using the builtin MACH_MSG_TYPE_* types and are architecture independent since they have the same size as the C char, short and int. If these basic types are redefined, MIG will still produce stub code but will produce a warning. * cpu.sym: Define sizeof_int, char, short. * tests/base_types.defs: Remove int. * tests/good/complex-types.defs: Use byte instead of char. * tests/good/directions: Remove char and int. * tests/good/types.defs: Remove char and also use short as a parameter in 'alltypes'. * type.c: Define itCIntTypeDecl. Remove itMakeIntType. Call itInsert for char, short and int. Message-Id: <20160419070513.GA12642@debian> --- tests/base_types.defs | 1 - tests/good/complex-types.defs | 4 ++-- tests/good/directions.defs | 3 --- tests/good/types.defs | 3 +-- 4 files changed, 3 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/base_types.defs b/tests/base_types.defs index a226056..5118ea2 100644 --- a/tests/base_types.defs +++ b/tests/base_types.defs @@ -1,4 +1,3 @@ -type int = MACH_MSG_TYPE_INTEGER_32; type int64_t = MACH_MSG_TYPE_INTEGER_64; type int32_t = MACH_MSG_TYPE_INTEGER_32; type mach_port_t = MACH_MSG_TYPE_COPY_SEND; diff --git a/tests/good/complex-types.defs b/tests/good/complex-types.defs index a10fc21..0a5c952 100644 --- a/tests/good/complex-types.defs +++ b/tests/good/complex-types.defs @@ -22,8 +22,8 @@ subsystem types 0; import ; import "types.h"; -type char = MACH_MSG_TYPE_BYTE; -type intptr_t = ^char; +type byte = MACH_MSG_TYPE_BYTE; +type intptr_t = ^byte; type pointer_t = ^array[] of MACH_MSG_TYPE_BYTE ctype: vm_offset_t; diff --git a/tests/good/directions.defs b/tests/good/directions.defs index 37c5767..daae678 100644 --- a/tests/good/directions.defs +++ b/tests/good/directions.defs @@ -19,9 +19,6 @@ /* Tests arguments with different directions. */ subsystem directions 100; -type char = MACH_MSG_TYPE_BYTE; -type int = MACH_MSG_TYPE_INTEGER_32; - type mach_port_t = MACH_MSG_TYPE_COPY_SEND; type mach_port_array_t = array[] of mach_port_t; diff --git a/tests/good/types.defs b/tests/good/types.defs index a27c191..5ef041c 100644 --- a/tests/good/types.defs +++ b/tests/good/types.defs @@ -23,7 +23,6 @@ import ; import "types.h"; #include "../base_types.defs" -type char = MACH_MSG_TYPE_CHAR; type int16_t = MACH_MSG_TYPE_INTEGER_16; type boolean_t = MACH_MSG_TYPE_BOOLEAN; type uint16_t = MACH_MSG_TYPE_INTEGER_16; @@ -50,7 +49,7 @@ type trans_int = int outtran: int int8_to_int(int8_t); routine alltypes(port : mach_port_t; - c : char; s : int16_t; i : int; + c : char; s1 : int16_t; s2 : short; i : int; i32 : int32_t; i64 : int64_t; bool : boolean_t; ui16 : uint16_t; ui32 : uint32_t; ui64 : uint64_t); -- cgit v1.2.3