fixed some errors
This commit is contained in:
@@ -27,12 +27,14 @@ static inline List(T) List_##T##_construct(T* data_ptr, u32 occupied_len, u32 ca
|
|||||||
\
|
\
|
||||||
static inline List(T) List_##T##_alloc(u32 initial_capacity) { \
|
static inline List(T) List_##T##_alloc(u32 initial_capacity) { \
|
||||||
List_ l = _List_alloc(initial_capacity, sizeof(T)); \
|
List_ l = _List_alloc(initial_capacity, sizeof(T)); \
|
||||||
return *(List(T)*)(void*)&l; \
|
void* l_ptr = &l; \
|
||||||
|
return *(List(T)*)l_ptr; \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
static inline List(T) List_##T##_copy(const List(T)* src) { \
|
static inline List(T) List_##T##_copy(const List(T)* src) { \
|
||||||
List_ l = _List_copy((void*)src); \
|
List_ l = _List_copy((void*)src); \
|
||||||
return *(List(T)*)(void*)&l; \
|
void* l_ptr = &l; \
|
||||||
|
return *(List(T)*)l_ptr; \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
static inline void List_##T##_destroy(List(T)* self) { _List_destroy((void*)self); } \
|
static inline void List_##T##_destroy(List(T)* self) { _List_destroy((void*)self); } \
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ typedef struct Result_ {
|
|||||||
RESULT_ERROR_CODE_FMT(NONE, 0, FORMAT ,##ARGS)
|
RESULT_ERROR_CODE_FMT(NONE, 0, FORMAT ,##ARGS)
|
||||||
|
|
||||||
#define RESULT_ERROR_ERRNO() \
|
#define RESULT_ERROR_ERRNO() \
|
||||||
RESULT_ERROR_CODE(LIBC_ERRNO, errno, strerror_malloc(errno), true)
|
RESULT_ERROR_CODE(LIBC_ERRNO, errno, str_from_cstr(strerror_malloc(errno)), true)
|
||||||
|
|
||||||
#define RESULT_VOID (Result_){ .error = NULL, .u = 0 }
|
#define RESULT_VOID (Result_){ .error = NULL, .u = 0 }
|
||||||
#define RESULT_VALUE(FIELD, V) (Result_){ .error = NULL, .FIELD = V }
|
#define RESULT_VALUE(FIELD, V) (Result_){ .error = NULL, .FIELD = V }
|
||||||
@@ -141,7 +141,7 @@ typedef struct Result_ {
|
|||||||
#define _try_stderrcode(CALL, N) do {\
|
#define _try_stderrcode(CALL, N) do {\
|
||||||
int _rname(N) = CALL;\
|
int _rname(N) = CALL;\
|
||||||
if(_rname(N) != 0){\
|
if(_rname(N) != 0){\
|
||||||
Return RESULT_ERROR_CODE(LIBC_ERRNO, _rname(N), strerror_malloc(_rname(N)), true);\
|
Return RESULT_ERROR_CODE(LIBC_ERRNO, _rname(N), str_from_cstr(strerror_malloc(_rname(N))), true);\
|
||||||
}\
|
}\
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user