Browse Source

[Automated] Change style to right-pointers

master
cancel 5 years ago
parent
commit
beeb85720e
  1. 1
      .clang-format
  2. 7
      term_util.c
  3. 4
      term_util.h

1
.clang-format

@ -1,5 +1,4 @@
BasedOnStyle: LLVM BasedOnStyle: LLVM
PointerAlignment: Left
ReflowComments: false ReflowComments: false
MacroBlockBegin: "^BEGIN_OPERATOR" MacroBlockBegin: "^BEGIN_OPERATOR"

7
term_util.c

@ -30,7 +30,8 @@ void term_util_init_colors() {
} }
#define ORCA_CONTAINER_OF(ptr, type, member) \ #define ORCA_CONTAINER_OF(ptr, type, member) \
((type*)((char*)(1 ? (ptr) : &((type*)0)->member) - offsetof(type, member))) ((type *)((char *)(1 ? (ptr) : &((type *)0)->member) - \
offsetof(type, member)))
struct Qmsg { struct Qmsg {
Qblock qblock; Qblock qblock;
@ -319,8 +320,8 @@ qmenu_allocitems(Qmenu* qm, Usz count, Usz* out_idx, ITEM*** out_items,
Usz old_extras_offset = sizeof(ITEM *) * old_cap; Usz old_extras_offset = sizeof(ITEM *) * old_cap;
Usz new_extras_offset = sizeof(ITEM *) * new_cap; Usz new_extras_offset = sizeof(ITEM *) * new_cap;
Usz old_extras_size = sizeof(struct Qmenu_item_extra) * old_count; Usz old_extras_size = sizeof(struct Qmenu_item_extra) * old_count;
memmove((char*)items + new_extras_offset, (char*)items + old_extras_offset, memmove((char *)items + new_extras_offset,
old_extras_size); (char *)items + old_extras_offset, old_extras_size);
qm->ncurses_items = new_items; qm->ncurses_items = new_items;
qm->items_cap = new_cap; qm->items_cap = new_cap;
} }

4
term_util.h

@ -34,8 +34,8 @@ typedef enum {
A_reverse = A_REVERSE, A_reverse = A_REVERSE,
} Term_attr; } Term_attr;
static ORCA_FORCE_INLINE ORCA_OK_IF_UNUSED static ORCA_FORCE_INLINE ORCA_OK_IF_UNUSED attr_t fg_bg(Color_name fg,
attr_t fg_bg(Color_name fg, Color_name bg) { Color_name bg) {
return COLOR_PAIR(1 + fg * Colors_count + bg); return COLOR_PAIR(1 + fg * Colors_count + bg);
} }

Loading…
Cancel
Save