diff --git a/core/dynlib/lib.odin b/core/dynlib/lib.odin index 141154f02..7feed73da 100644 --- a/core/dynlib/lib.odin +++ b/core/dynlib/lib.odin @@ -1,3 +1,3 @@ package dynlib -Library :: #opaque rawptr; +Library :: distinct rawptr; diff --git a/core/sys/unix/pthread_darwin.odin b/core/sys/unix/pthread_darwin.odin index 8460c4852..a958e0b84 100644 --- a/core/sys/unix/pthread_darwin.odin +++ b/core/sys/unix/pthread_darwin.odin @@ -14,44 +14,44 @@ PTHREAD_ONCE_SIZE :: 8; PTHREAD_RWLOCK_SIZE :: 192; PTHREAD_RWLOCKATTR_SIZE :: 16; -pthread_t :: #opaque u64; +pthread_t :: distinct u64; -pthread_attr_t :: #opaque struct #align 16 { +pthread_attr_t :: struct #align 16 { sig: c.long, _: [PTHREAD_ATTR_SIZE] c.char, }; -pthread_cond_t :: #opaque struct #align 16 { +pthread_cond_t :: struct #align 16 { sig: c.long, _: [PTHREAD_COND_SIZE] c.char, }; -pthread_condattr_t :: #opaque struct #align 16 { +pthread_condattr_t :: struct #align 16 { sig: c.long, _: [PTHREAD_CONDATTR_SIZE] c.char, }; -pthread_mutex_t :: #opaque struct #align 16 { +pthread_mutex_t :: struct #align 16 { sig: c.long, _: [PTHREAD_MUTEX_SIZE] c.char, }; -pthread_mutexattr_t :: #opaque struct #align 16 { +pthread_mutexattr_t :: struct #align 16 { sig: c.long, _: [PTHREAD_MUTEXATTR_SIZE] c.char, }; -pthread_once_t :: #opaque struct #align 16 { +pthread_once_t :: struct #align 16 { sig: c.long, _: [PTHREAD_ONCE_SIZE] c.char, }; -pthread_rwlock_t :: #opaque struct #align 16 { +pthread_rwlock_t :: struct #align 16 { sig: c.long, _: [PTHREAD_RWLOCK_SIZE] c.char, }; -pthread_rwlockattr_t :: #opaque struct #align 16 { +pthread_rwlockattr_t :: struct #align 16 { sig: c.long, _: [PTHREAD_RWLOCKATTR_SIZE] c.char, }; diff --git a/core/sys/unix/pthread_freebsd.odin b/core/sys/unix/pthread_freebsd.odin index cbd7e99f1..c2b493fbc 100644 --- a/core/sys/unix/pthread_freebsd.odin +++ b/core/sys/unix/pthread_freebsd.odin @@ -26,32 +26,32 @@ when size_of(int) == 8 { PTHREAD_BARRIER_T_SIZE :: 20; } -pthread_cond_t :: #opaque struct #align 16 { +pthread_cond_t :: struct #align 16 { _: [PTHREAD_COND_T_SIZE] c.char, }; -pthread_mutex_t :: #opaque struct #align 16 { +pthread_mutex_t :: struct #align 16 { _: [PTHREAD_MUTEX_T_SIZE] c.char, }; -pthread_rwlock_t :: #opaque struct #align 16 { +pthread_rwlock_t :: struct #align 16 { _: [PTHREAD_RWLOCK_T_SIZE] c.char, }; -pthread_barrier_t :: #opaque struct #align 16 { +pthread_barrier_t :: struct #align 16 { _: [PTHREAD_BARRIER_T_SIZE] c.char, }; -pthread_attr_t :: #opaque struct #align 16 { +pthread_attr_t :: struct #align 16 { _: [PTHREAD_ATTR_T_SIZE] c.char, }; -pthread_condattr_t :: #opaque struct #align 16 { +pthread_condattr_t :: struct #align 16 { _: [PTHREAD_CONDATTR_T_SIZE] c.char, }; -pthread_mutexattr_t :: #opaque struct #align 16 { +pthread_mutexattr_t :: struct #align 16 { _: [PTHREAD_MUTEXATTR_T_SIZE] c.char, }; -pthread_rwlockattr_t :: #opaque struct #align 16 { +pthread_rwlockattr_t :: struct #align 16 { _: [PTHREAD_RWLOCKATTR_T_SIZE] c.char, }; -pthread_barrierattr_t :: #opaque struct #align 16 { +pthread_barrierattr_t :: struct #align 16 { _: [PTHREAD_BARRIERATTR_T_SIZE] c.char, }; diff --git a/core/sys/unix/pthread_linux.odin b/core/sys/unix/pthread_linux.odin index 76a0719fb..25d828d81 100644 --- a/core/sys/unix/pthread_linux.odin +++ b/core/sys/unix/pthread_linux.odin @@ -33,32 +33,32 @@ when size_of(int) == 8 { PTHREAD_BARRIER_T_SIZE :: 20; } -pthread_cond_t :: #opaque struct #align 16 { +pthread_cond_t :: struct #align 16 { _: [PTHREAD_COND_T_SIZE] c.char, }; -pthread_mutex_t :: #opaque struct #align 16 { +pthread_mutex_t :: struct #align 16 { _: [PTHREAD_MUTEX_T_SIZE] c.char, }; -pthread_rwlock_t :: #opaque struct #align 16 { +pthread_rwlock_t :: struct #align 16 { _: [PTHREAD_RWLOCK_T_SIZE] c.char, }; -pthread_barrier_t :: #opaque struct #align 16 { +pthread_barrier_t :: struct #align 16 { _: [PTHREAD_BARRIER_T_SIZE] c.char, }; -pthread_attr_t :: #opaque struct #align 16 { +pthread_attr_t :: struct #align 16 { _: [PTHREAD_ATTR_T_SIZE] c.char, }; -pthread_condattr_t :: #opaque struct #align 16 { +pthread_condattr_t :: struct #align 16 { _: [PTHREAD_CONDATTR_T_SIZE] c.char, }; -pthread_mutexattr_t :: #opaque struct #align 16 { +pthread_mutexattr_t :: struct #align 16 { _: [PTHREAD_MUTEXATTR_T_SIZE] c.char, }; -pthread_rwlockattr_t :: #opaque struct #align 16 { +pthread_rwlockattr_t :: struct #align 16 { _: [PTHREAD_RWLOCKATTR_T_SIZE] c.char, }; -pthread_barrierattr_t :: #opaque struct #align 16 { +pthread_barrierattr_t :: struct #align 16 { _: [PTHREAD_BARRIERATTR_T_SIZE] c.char, }; diff --git a/src/parser.cpp b/src/parser.cpp index 7277f6128..834aa664d 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -2507,19 +2507,6 @@ Ast *parse_operand(AstFile *f, bool lhs) { return ast_inline_asm_expr(f, token, open, close, param_types, return_type, asm_string, constraints_string, has_side_effects, is_align_stack, dialect); } - default: { - #if 0 - Ast *type = parse_type_or_ident(f); - if (type != nullptr) { - // TODO(bill): Is this correct??? - // NOTE(bill): Sanity check as identifiers should be handled already - TokenPos pos = ast_token(type).pos; - GB_ASSERT_MSG(type->kind != Ast_Ident, "Type cannot be identifier %.*s(%td:%td)", LIT(pos.file), pos.line, pos.column); - return type; - } - #endif - break; - } } return nullptr; @@ -2659,9 +2646,6 @@ Ast *parse_atom_expr(AstFile *f, Ast *operand, bool lhs) { } case Token_OpenBracket: { - if (lhs) { - // TODO(bill): Handle this - } bool prev_allow_range = f->allow_range; f->allow_range = false;