aboutsummaryrefslogtreecommitdiffstats
path: root/internal.h
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-17 12:03:48 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-03-17 12:03:48 +0000
commit4b5cb8b79ce7d60a15b5edeb22637a8366503bbf (patch)
tree9462b6f69746074cadc0c099d76d7d0c18cdeddb /internal.h
parent505d3191d119856eee13d22ee1957979b3a0dc8e (diff)
downloadruby-4b5cb8b79ce7d60a15b5edeb22637a8366503bbf.tar.gz
* internal.c: struct cmp_opt_data added for refactoring out a data
structure for CMP_OPTIMIZABLE * array.c (struct ary_sort_data): use struct cmp_opt_data. * enum.c (struct min_t, max_t, min_max_t): use struct cmp_opt_data. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'internal.h')
-rw-r--r--internal.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/internal.h b/internal.h
index 89fcea62fd..03b1e1c3d9 100644
--- a/internal.h
+++ b/internal.h
@@ -685,13 +685,18 @@ enum {
cmp_optimizable_count
};
+struct cmp_opt_data {
+ int opt_methods;
+ int opt_inited;
+};
+
#define CMP_OPTIMIZABLE_BIT(type) (1U << TOKEN_PASTE(cmp_opt_,type))
#define CMP_OPTIMIZABLE(data, type) \
- (((data)->opt_inited & CMP_OPTIMIZABLE_BIT(type)) ? \
- ((data)->opt_methods & CMP_OPTIMIZABLE_BIT(type)) : \
- (((data)->opt_inited |= CMP_OPTIMIZABLE_BIT(type)), \
+ (((data).opt_inited & CMP_OPTIMIZABLE_BIT(type)) ? \
+ ((data).opt_methods & CMP_OPTIMIZABLE_BIT(type)) : \
+ (((data).opt_inited |= CMP_OPTIMIZABLE_BIT(type)), \
rb_method_basic_definition_p(TOKEN_PASTE(rb_c,type), id_cmp) && \
- ((data)->opt_methods |= CMP_OPTIMIZABLE_BIT(type))))
+ ((data).opt_methods |= CMP_OPTIMIZABLE_BIT(type))))
/* ment is in method.h */