shithub: orca

Download patch

ref: d4b2ef259e41cc779a1549a740773251fe36e011
parent: 691ec7d34cc9cb9237f808de079cc4a947bbd23a
author: cancel <cancel@cancel.fm>
date: Thu Jan 23 20:03:18 EST 2020

Clean up naming of fn attributes

--- a/bank.h
+++ b/bank.h
@@ -62,7 +62,7 @@
 void oevent_list_init(Oevent_list *olist);
 void oevent_list_deinit(Oevent_list *olist);
 void oevent_list_clear(Oevent_list *olist);
-ORCA_FORCE_NO_INLINE
+ORCA_NOINLINE
 void oevent_list_copy(Oevent_list const *src, Oevent_list *dest);
-ORCA_FORCE_NO_INLINE
+ORCA_NOINLINE
 Oevent *oevent_list_alloc_item(Oevent_list *olist);
--- a/base.h
+++ b/base.h
@@ -18,17 +18,14 @@
 
 // (gcc / clang) or msvc or other
 #if defined(__GNUC__) || defined(__clang__)
-#define ORCA_FORCE_INLINE __attribute__((always_inline)) inline
-#define ORCA_FORCE_STATIC_INLINE __attribute__((always_inline)) static inline
-#define ORCA_FORCE_NO_INLINE __attribute__((noinline))
+#define ORCA_FORCEINLINE __attribute__((always_inline)) inline
+#define ORCA_NOINLINE __attribute__((noinline))
 #elif defined(_MSC_VER)
-#define ORCA_FORCE_INLINE __forceinline
-#define ORCA_FORCE_STATIC_INLINE __forceinline static
-#define ORCA_FORCE_NO_INLINE __declspec(noinline)
+#define ORCA_FORCEINLINE __forceinline
+#define ORCA_NOINLINE __declspec(noinline)
 #else
-#define ORCA_FORCE_INLINE inline
-#define ORCA_FORCE_STATIC_INLINE inline static
-#define ORCA_FORCE_NO_INLINE
+#define ORCA_FORCEINLINE inline
+#define ORCA_NOINLINE
 #endif
 
 // (gcc / clang) or other
@@ -79,7 +76,7 @@
 typedef char Glyph;
 typedef U8 Mark;
 
-ORCA_FORCE_STATIC_INLINE Usz orca_round_up_power2(Usz x) {
+ORCA_FORCEINLINE static Usz orca_round_up_power2(Usz x) {
   assert(x <= SIZE_MAX / 2 + 1);
   x -= 1;
   x |= (x >> 1);
--- a/gbuffer.h
+++ b/gbuffer.h
@@ -35,13 +35,13 @@
   gbuf[(Usz)y0 * width + (Usz)x0] = g;
 }
 
-ORCA_FORCE_NO_INLINE
+ORCA_NOINLINE
 void gbuffer_copy_subrect(Glyph *src, Glyph *dest, Usz src_grid_h,
                           Usz src_grid_w, Usz dest_grid_h, Usz dest_grid_w,
                           Usz src_y, Usz src_x, Usz dest_y, Usz dest_x,
                           Usz height, Usz width);
 
-ORCA_FORCE_NO_INLINE
+ORCA_NOINLINE
 void gbuffer_fill_subrect(Glyph *gbuf, Usz grid_h, Usz grid_w, Usz y, Usz x,
                           Usz height, Usz width, Glyph fill_char);
 
--- a/sim.c
+++ b/sim.c
@@ -126,7 +126,7 @@
   mbuffer[offs] |= Mark_flag_sleep;
 }
 
-#define OPER_FUNCTION_ATTRIBS ORCA_FORCE_NO_INLINE static void
+#define OPER_FUNCTION_ATTRIBS ORCA_NOINLINE static void
 
 #define BEGIN_OPERATOR(_oper_name)                                             \
   OPER_FUNCTION_ATTRIBS oper_behavior_##_oper_name(                            \
--- a/sysmisc.c
+++ b/sysmisc.c
@@ -5,7 +5,7 @@
 #include <errno.h>
 #include <sys/stat.h>
 
-ORCA_FORCE_NO_INLINE
+ORCA_NOINLINE
 Cboard_error cboard_copy(Glyph const *gbuffer, Usz field_height,
                          Usz field_width, Usz rect_y, Usz rect_x, Usz rect_h,
                          Usz rect_w) {
@@ -28,7 +28,7 @@
   return status ? Cboard_error_process_exit_error : Cboard_error_none;
 }
 
-ORCA_FORCE_NO_INLINE
+ORCA_NOINLINE
 Cboard_error cboard_paste(Glyph *gbuffer, Usz height, Usz width, Usz y, Usz x,
                           Usz *out_h, Usz *out_w) {
   FILE *fp =
@@ -69,7 +69,7 @@
   return status ? Cboard_error_process_exit_error : Cboard_error_none;
 }
 
-ORCA_FORCE_NO_INLINE
+ORCA_NOINLINE
 Conf_read_result conf_read_line(FILE *file, char *buf, Usz bufsize,
                                 char **out_left, Usz *out_leftsize,
                                 char **out_right, Usz *out_rightsize) {
--- a/term_util.c
+++ b/term_util.c
@@ -69,8 +69,7 @@
   while (qnav_stack.count != 0)
     qnav_stack_pop();
 }
-static ORCA_FORCE_NO_INLINE void qnav_stack_push(Qblock *qb, int height,
-                                                 int width) {
+static ORCA_NOINLINE void qnav_stack_push(Qblock *qb, int height, int width) {
 #ifndef NDEBUG
   for (Usz i = 0; i < qnav_stack.count; ++i) {
     assert(qnav_stack.blocks[i] != qb);
@@ -313,7 +312,7 @@
 }
 void qmenu_destroy(Qmenu *qm) { qmenu_free(qm); }
 int qmenu_id(Qmenu const *qm) { return qm->id; }
-static ORCA_FORCE_NO_INLINE void
+static ORCA_NOINLINE void
 qmenu_allocitems(Qmenu *qm, Usz count, Usz *out_idx, ITEM ***out_items,
                  struct Qmenu_item_extra **out_extras) {
   Usz old_count = qm->items_count;
@@ -349,7 +348,7 @@
   *out_extras =
       (struct Qmenu_item_extra *)((char *)items + extras_offset) + old_count;
 }
-ORCA_FORCE_STATIC_INLINE struct Qmenu_item_extra *
+ORCA_FORCEINLINE static struct Qmenu_item_extra *
 qmenu_item_extras_ptr(Qmenu *qm) {
   Usz offset = sizeof(ITEM *) * qm->items_cap;
   return (struct Qmenu_item_extra *)((char *)qm->ncurses_items + offset);
@@ -356,9 +355,8 @@
 }
 // Get the curses menu item user pointer out, turn it to an int, and use it as
 // an index into the 'extras' arrays.
-ORCA_FORCE_STATIC_INLINE
-struct Qmenu_item_extra *qmenu_itemextra(struct Qmenu_item_extra *extras,
-                                         ITEM *item) {
+ORCA_FORCEINLINE static struct Qmenu_item_extra *
+qmenu_itemextra(struct Qmenu_item_extra *extras, ITEM *item) {
   return extras + (int)(intptr_t)(item_userptr(item));
 }
 void qmenu_set_title(Qmenu *qm, char const *title) {
@@ -520,7 +518,7 @@
   free(qm);
 }
 
-ORCA_FORCE_NO_INLINE
+ORCA_NOINLINE
 static void qmenu_drive_upordown(Qmenu *qm, int req_up_or_down) {
   struct Qmenu_item_extra *extras = qmenu_item_extras_ptr(qm);
   ITEM *starting = current_item(qm->ncurses_menu);
--- a/term_util.h
+++ b/term_util.h
@@ -43,8 +43,8 @@
   A_reverse = A_REVERSE,
 } Term_attr;
 
-static ORCA_FORCE_INLINE ORCA_OK_IF_UNUSED attr_t fg_bg(Color_name fg,
-                                                        Color_name bg) {
+static ORCA_FORCEINLINE ORCA_OK_IF_UNUSED attr_t fg_bg(Color_name fg,
+                                                       Color_name bg) {
   return COLOR_PAIR(1 + fg * Colors_count + bg);
 }
 
--- a/tui_main.c
+++ b/tui_main.c
@@ -958,7 +958,7 @@
   a->midi_mode = midi_mode;
 }
 
-static ORCA_FORCE_NO_INLINE void //
+static ORCA_NOINLINE void //
 send_midi_chan_msg(Oosc_dev *oosc_dev, Midi_mode const *midi_mode,
                    int type /*0..15*/, int chan /*0.. 15*/,
                    int byte1 /*0..127*/, int byte2 /*0..127*/) {
@@ -996,7 +996,7 @@
   }
 }
 
-static ORCA_FORCE_NO_INLINE void //
+static ORCA_NOINLINE void //
 send_midi_note_offs(Oosc_dev *oosc_dev, Midi_mode const *midi_mode,
                     Susnote const *start, Susnote const *end) {
   for (; start != end; ++start) {
@@ -2512,7 +2512,7 @@
 char const *const prefval_plain = "plain";
 char const *const prefval_fancy = "fancy";
 
-ORCA_FORCE_NO_INLINE
+ORCA_NOINLINE
 bool plainorfancy(char const *val, bool *out) {
   if (strcmp(val, prefval_plain) == 0) {
     *out = false;
@@ -2525,7 +2525,7 @@
   return false;
 }
 
-ORCA_FORCE_NO_INLINE
+ORCA_NOINLINE
 bool conf_read_boolish(char const *val, bool *out) {
   static char const *const trues[] = {"1", "true", "yes"};
   static char const *const falses[] = {"0", "false", "no"};
@@ -2544,7 +2544,7 @@
   return false;
 }
 
-ORCA_FORCE_NO_INLINE
+ORCA_NOINLINE
 Prefs_load_error prefs_load_from_conf_file(Prefs *p) {
   Ezconf_r ez;
   for (ezconf_r_start(&ez); ezconf_r_step(&ez, confopts, Confoptslen);) {