mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Cleanup use of macro inspection to use @typekind and @typeid macros.
This commit is contained in:
@@ -94,7 +94,7 @@ bitstruct UInt128LE : uint128 @littleendian
|
||||
macro read(bytes, $Type)
|
||||
{
|
||||
char[] s;
|
||||
$switch ($typeof(bytes).kindof)
|
||||
$switch (@typekind(bytes))
|
||||
$case POINTER:
|
||||
s = (*bytes)[:$Type.sizeof];
|
||||
$default:
|
||||
@@ -110,7 +110,7 @@ macro read(bytes, $Type)
|
||||
macro write(x, bytes, $Type)
|
||||
{
|
||||
char[] s;
|
||||
$switch ($typeof(bytes).kindof)
|
||||
$switch (@typekind(bytes))
|
||||
$case POINTER:
|
||||
s = (*bytes)[:$Type.sizeof];
|
||||
$default:
|
||||
@@ -146,7 +146,7 @@ macro is_bitorder($Type)
|
||||
|
||||
macro bool is_array_or_sub_of_char(bytes)
|
||||
{
|
||||
$switch ($typeof(bytes).kindof)
|
||||
$switch (@typekind(bytes))
|
||||
$case POINTER:
|
||||
var $Inner = $typefrom($typeof(bytes).inner);
|
||||
$if $Inner.kindof == ARRAY:
|
||||
@@ -164,7 +164,7 @@ macro bool is_array_or_sub_of_char(bytes)
|
||||
|
||||
macro bool is_arrayptr_or_sub_of_char(bytes)
|
||||
{
|
||||
$switch ($typeof(bytes).kindof)
|
||||
$switch (@typekind(bytes))
|
||||
$case POINTER:
|
||||
var $Inner = $typefrom($typeof(bytes).inner);
|
||||
$if $Inner.kindof == ARRAY:
|
||||
|
||||
Reference in New Issue
Block a user