Skip to content

Commit

Permalink
Some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dparo committed Aug 17, 2023
1 parent e65e337 commit 725ca69
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/std.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ extern "C" {
#define PTR_ALIGN_UP_T(ptr) (PTR_ALIGN_UP((ptr), ALIGNOF_EXPR(*(ptr))))
#define PTR_ALIGN_DOWN_T(ptr) (PTR_ALIGN_DOWN((ptr), ALIGNOF_EXPR(*(ptr))))

#define PTR_IS_ALIGNED(ptr, alignment) __ptr_is_aligned(PTRCAST_UINTPTR_EXPR(ptr), alignment)
#define PTR_IS_ALIGNED(ptr, alignment) _ptr_is_aligned(PTRCAST_UINTPTR_EXPR(ptr), alignment)

ATTRIB_ALWAYS_INLINE
static bool __ptr_is_aligned(uintptr_t ptr, size_t alignment) {
static bool _ptr_is_aligned(uintptr_t ptr, size_t alignment) {
return (uintptr_t)PTR_ALIGN_UP(ptr, alignment) == ptr;
}

Expand Down
8 changes: 4 additions & 4 deletions src/utf8str32.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#pragma once

#include "builtins.h"
#include "log.h"

#if __cplusplus
extern "C" {
#endif
Expand All @@ -26,8 +26,8 @@ typedef struct {
cstr_t buf;
} Utf8Str32_t;

#define UTF8STR32(cstr) __utf8str32_from_literal(cstr, strlen(cstr))
#define UTF8STR32_LIT(literal) __utf8str32_from_literal(literal, STRLIT_LEN(literal))
#define UTF8STR32(cstr) _utf8str32_from_literal(cstr, strlen(cstr))
#define UTF8STR32_LIT(literal) _utf8str32_from_literal(literal, STRLIT_LEN(literal))

ATTRIB_ALWAYS_INLINE
static int32_t utf8str32_len(const Utf8Str32_t str) { return str.len; }
Expand All @@ -38,7 +38,7 @@ static bool utf8str32_contains_cstr(const Utf8Str32_t str) {
}

ATTRIB_ALWAYS_INLINE
static Utf8Str32_t __utf8str32_from_literal(cstr_t cstr, size_t len) {
static Utf8Str32_t _utf8str32_from_literal(cstr_t cstr, size_t len) {
const Utf8Str32_t result = {
.len = (int32_t)len,
.cap = (int32_t)len + 1,
Expand Down

0 comments on commit 725ca69

Please sign in to comment.