ruby-changes:62087
From: Nobuyoshi <ko1@a...>
Date: Tue, 30 Jun 2020 19:32:56 +0900 (JST)
Subject: [ruby-changes:62087] 74ac12830b (master): Evaluate macros argument just once
https://git.ruby-lang.org/ruby.git/commit/?id=74ac12830b From 74ac12830b2a623aeadd0bd5036e651114d0da7f Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Wed, 3 Jun 2020 08:21:22 +0900 Subject: Evaluate macros argument just once diff --git a/method.h b/method.h index 3aa4deb..cd59963 100644 --- a/method.h +++ b/method.h @@ -70,11 +70,11 @@ typedef struct rb_callable_method_entry_struct { /* same fields with rb_method_e https://github.com/ruby/ruby/blob/trunk/method.h#L70 #define METHOD_ENTRY_VISI(me) (rb_method_visibility_t)(((me)->flags & (IMEMO_FL_USER0 | IMEMO_FL_USER1)) >> (IMEMO_FL_USHIFT+0)) #define METHOD_ENTRY_BASIC(me) (int) (((me)->flags & (IMEMO_FL_USER2 )) >> (IMEMO_FL_USHIFT+2)) #define METHOD_ENTRY_COMPLEMENTED(me) ((me)->flags & IMEMO_FL_USER3) -#define METHOD_ENTRY_COMPLEMENTED_SET(me) ((me)->flags = (me)->flags | IMEMO_FL_USER3) +#define METHOD_ENTRY_COMPLEMENTED_SET(me) ((me)->flags |= IMEMO_FL_USER3) #define METHOD_ENTRY_CACHED(me) ((me)->flags & IMEMO_FL_USER4) -#define METHOD_ENTRY_CACHED_SET(me) ((me)->flags = (me)->flags | IMEMO_FL_USER4) +#define METHOD_ENTRY_CACHED_SET(me) ((me)->flags |= IMEMO_FL_USER4) #define METHOD_ENTRY_INVALIDATED(me) ((me)->flags & IMEMO_FL_USER5) -#define METHOD_ENTRY_INVALIDATED_SET(me) ((me)->flags = (me)->flags | IMEMO_FL_USER5) +#define METHOD_ENTRY_INVALIDATED_SET(me) ((me)->flags |= IMEMO_FL_USER5) static inline void METHOD_ENTRY_VISI_SET(rb_method_entry_t *me, rb_method_visibility_t visi) -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/