Skip to content

Commit

Permalink
run clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
wengxt committed Apr 1, 2024
1 parent f45c693 commit 37f3d5d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/lib/fcitx-utils/cutf8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "utf8.h"

/** check utf8 character */
#define FCITX_ISUTF8_CB(c) (((c)&0xc0) == 0x80)
#define FCITX_ISUTF8_CB(c) (((c) & 0xc0) == 0x80)

#define CONT(i) FCITX_ISUTF8_CB(in[i])
#define VAL(i, s) ((in[i] & 0x3f) << s)
Expand All @@ -27,8 +27,8 @@
: ((Char) < 0x4000000 ? 5 : 6)))))

#define UNICODE_VALID(Char) \
((Char) < 0x110000 && (((Char)&0xFFFFF800) != 0xD800) && \
((Char) < 0xFDD0 || (Char) > 0xFDEF) && ((Char)&0xFFFE) != 0xFFFE)
((Char) < 0x110000 && (((Char) & 0xFFFFF800) != 0xD800) && \
((Char) < 0xFDD0 || (Char) > 0xFDEF) && ((Char) & 0xFFFE) != 0xFFFE)

size_t fcitx_utf8_strlen(const char *s) {
size_t l = 0;
Expand Down
5 changes: 3 additions & 2 deletions src/lib/fcitx-utils/utf8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
namespace fcitx::utf8 {

bool UCS4IsValid(uint32_t code) {
return ((code) < 0x110000 && (((code)&0xFFFFF800) != 0xD800) &&
((code) < 0xFDD0 || (code) > 0xFDEF) && ((code)&0xFFFE) != 0xFFFE);
return ((code) < 0x110000 && (((code) & 0xFFFFF800) != 0xD800) &&
((code) < 0xFDD0 || (code) > 0xFDEF) &&
((code) & 0xFFFE) != 0xFFFE);
}

std::string UCS4ToUTF8(uint32_t code) {
Expand Down

0 comments on commit 37f3d5d

Please sign in to comment.