typedef c8/c16/c32

This commit is contained in:
dzaima 2023-04-29 14:52:28 +03:00
parent 865257fdb6
commit 56e4863f66
2 changed files with 5 additions and 2 deletions

View File

@ -38,8 +38,6 @@ u8 arrTypeBitsLog[] = {
[t_harr ]=6, [t_hslice ]=6, [t_fillarr]=6,[t_fillslice]=6
};
B m_i8(i8 x) { return m_i32(x); } B m_i16(i16 x) { return m_i32(x); }
B m_c8(u8 x) { return m_c32(x); } B m_c16(u16 x) { return m_c32(x); }
#define TU I8
#define TP(W,X) W##i8##X
#include "tyarrTemplate.c"

View File

@ -508,6 +508,11 @@ FORCE_INLINE f64 o2fG(B x) { return x.f; } FORCE_INLINE f64 o2f(B x)
FORCE_INLINE i64 o2i64G(B x) { return (i64)x.f; } FORCE_INLINE i64 o2i64(B x) { if (!q_i64(x)) thrM("Expected integer"); return o2i64G(x); }
FORCE_INLINE u64 o2u64G(B x) { return (u64)x.f; } FORCE_INLINE u64 o2u64(B x) { if (!q_u64(x)) thrM("Expected integer"); return o2u64G(x); }
// some aliases for macro-generated code
typedef u8 c8; typedef u16 c16; typedef u32 c32;
static B m_i8(i8 x) { return m_i32(x); } static B m_i16(i16 x) { return m_i32(x); }
static B m_c8(u8 x) { return m_c32(x); } static B m_c16(u16 x) { return m_c32(x); }
static B m_B(B x) { return x; } static bool q_B(B x) { return true; }
typedef struct Slice {
struct Arr;