Skip to content

Commit

Permalink
Fix clang format
Browse files Browse the repository at this point in the history
  • Loading branch information
wengxt committed Jul 9, 2024
1 parent c798f6e commit 7536d60
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 1 addition & 3 deletions src/frontend/ibusfrontend/ibusfrontend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,9 +597,7 @@ class IBusInputContext : public InputContext,
}
FCITX_OBJECT_VTABLE_WRITABLE_PROPERTY(
contentType, "ContentType", "(uu)",
([]() -> dbus::DBusStruct<uint32_t, uint32_t> {
return {0, 0};
}),
([]() -> dbus::DBusStruct<uint32_t, uint32_t> { return {0, 0}; }),
([this](dbus::DBusStruct<uint32_t, uint32_t> type) {
setContentType(std::get<0>(type), std::get<1>(type));
}),
Expand Down
12 changes: 8 additions & 4 deletions src/lib/fcitx-utils/event_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@
#include <cstring>
#include "event.h"

#define USEC_INFINITY ((uint64_t)-1)
#define USEC_PER_SEC ((uint64_t)1000000ULL)
#define NSEC_PER_USEC ((uint64_t)1000ULL)

namespace fcitx {

namespace {

constexpr uint64_t USEC_INFINITY = static_cast<uint64_t>(-1);
constexpr uint64_t USEC_PER_SEC = 1000000ULL;
constexpr uint64_t NSEC_PER_USEC = 1000ULL;

} // namespace

// From systemd :)
uint64_t timespec_load(const struct timespec *ts) {
if (ts->tv_sec == (time_t)-1 && ts->tv_nsec == (long)-1) {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/classic/xcbui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ void XCBUI::readXSettings() {
if (!readCard16(&nameLen)) {
return;
}
#define XSETTINGS_PAD(n, m) (((n) + (m)-1) & (~((m)-1)))
#define XSETTINGS_PAD(n, m) (((n) + (m) - 1) & (~((m) - 1)))
uint32_t namePad = XSETTINGS_PAD(nameLen, 4);
if (std::distance(iter, data.cend()) < namePad) {
return;
Expand Down

0 comments on commit 7536d60

Please sign in to comment.