cosmopolitan/libc/str/mb.internal.h
Jōshin 89fc95fefd
Rerun clang-format on the repo (#1217)
🚨 clang-format changes output per version!

This is with version 19.0.0. The modifications seem to be fixing the old
version’s errors - mainly involving omitted whitespace around binary ops
and inserted whitespace between goto labels and colons (if followed by a
curly brace.)

Also fixes a few mistakes made by e.g. someone (ahem) forgetting to pass
his ctl/string.h modifications through it.

We should add this to .git-blame-ignore-revs once we have its final hash
on master.
2024-06-15 16:34:48 -04:00

17 lines
588 B
C

#ifndef COSMOPOLITAN_LIBC_STR_MB_INTERNAL_H_
#define COSMOPOLITAN_LIBC_STR_MB_INTERNAL_H_
COSMOPOLITAN_C_START_
#define SA 0xc2u
#define SB 0xf4u
#define CODEUNIT(c) (0xdfff & (signed char)(c))
#define IS_CODEUNIT(c) ((unsigned)(c) - 0xdf80 < 0x80)
#define R(a, b) ((uint32_t)((a == 0x80 ? 0x40u - b : 0u - a) << 23))
#define FAILSTATE R(0x80, 0x80)
#define OOB(c, b) \
(((((b) >> 3) - 0x10) | (((b) >> 3) + ((int32_t)(c) >> 26))) & ~7)
extern const uint32_t kMbBittab[51];
COSMOPOLITAN_C_END_
#endif /* COSMOPOLITAN_LIBC_STR_MB_INTERNAL_H_ */