summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortmm1 <tmm1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-11 09:39:13 +0000
committertmm1 <tmm1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-11 09:39:13 +0000
commit8f3934261ad4a7f486d2fffa9c961d7535675d8f (patch)
treec22dd4ac70626fea141728ade96598950b7963dc
parente22d8781c8005b068ffa73ecc88728d720b6e870 (diff)
* internal.h: move common string/hash flags to include file.
* ext/objspace/objspace_dump.c: remove flags shared above. * hash.c: ditto. * string.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--ext/objspace/objspace_dump.c14
-rw-r--r--hash.c3
-rw-r--r--internal.h12
-rw-r--r--string.c11
5 files changed, 19 insertions, 28 deletions
diff --git a/ChangeLog b/ChangeLog
index b563002..ba5f501 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Mon Nov 11 18:31:12 2013 Aman Gupta <ruby@tmm1.net>
+
+ * internal.h: move common string/hash flags to include file.
+ * ext/objspace/objspace_dump.c: remove flags shared above.
+ * hash.c: ditto.
+ * string.c: ditto.
+
Mon Nov 11 04:36:14 2013 Eric Hodel <drbrain@segment7.net>
* lib/rubygems/specification.rb: Include 2.2.0.preview.2 when checking
diff --git a/ext/objspace/objspace_dump.c b/ext/objspace/objspace_dump.c
index 7ee5e7c..290a443 100644
--- a/ext/objspace/objspace_dump.c
+++ b/ext/objspace/objspace_dump.c
@@ -21,20 +21,6 @@
#include "vm_core.h"
#include "objspace.h"
-/* from string.c */
-#define STR_NOEMBED FL_USER1
-#define STR_SHARED FL_USER2 /* = ELTS_SHARED */
-#define STR_ASSOC FL_USER3
-#define STR_SHARED_P(s) FL_ALL((s), STR_NOEMBED|ELTS_SHARED)
-#define STR_ASSOC_P(s) FL_ALL((s), STR_NOEMBED|STR_ASSOC)
-#define STR_NOCAPA (STR_NOEMBED|ELTS_SHARED|STR_ASSOC)
-#define STR_NOCAPA_P(s) (FL_TEST((s),STR_NOEMBED) && FL_ANY((s),ELTS_SHARED|STR_ASSOC))
-#define STR_EMBED_P(str) (!FL_TEST((str), STR_NOEMBED))
-#define is_ascii_string(str) (rb_enc_str_coderange(str) == ENC_CODERANGE_7BIT)
-#define is_broken_string(str) (rb_enc_str_coderange(str) == ENC_CODERANGE_BROKEN)
-/* from hash.c */
-#define HASH_PROC_DEFAULT FL_USER2
-
static VALUE sym_output, sym_stdout, sym_string, sym_file;
struct dump_config {
diff --git a/hash.c b/hash.c
index 83d1799..4a0838c 100644
--- a/hash.c
+++ b/hash.c
@@ -29,9 +29,6 @@
static VALUE rb_hash_s_try_convert(VALUE, VALUE);
-#define HASH_DELETED FL_USER1
-#define HASH_PROC_DEFAULT FL_USER2
-
/*
* Hash WB strategy:
* 1. Check mutate st_* functions
diff --git a/internal.h b/internal.h
index e7ecbbe..508e77d 100644
--- a/internal.h
+++ b/internal.h
@@ -439,6 +439,8 @@ struct st_table *rb_hash_tbl_raw(VALUE hash);
#define RHASH_TBL_RAW(h) rb_hash_tbl_raw(h)
VALUE rb_hash_keys(VALUE hash);
VALUE rb_hash_values(VALUE hash);
+#define HASH_DELETED FL_USER1
+#define HASH_PROC_DEFAULT FL_USER2
/* inits.c */
void rb_call_inits(void);
@@ -675,6 +677,16 @@ VALUE rb_str_locktmp_ensure(VALUE str, VALUE (*func)(VALUE), VALUE arg);
#ifdef RUBY_ENCODING_H
VALUE rb_external_str_with_enc(VALUE str, rb_encoding *eenc);
#endif
+#define STR_NOEMBED FL_USER1
+#define STR_SHARED FL_USER2 /* = ELTS_SHARED */
+#define STR_ASSOC FL_USER3
+#define STR_SHARED_P(s) FL_ALL((s), STR_NOEMBED|ELTS_SHARED)
+#define STR_ASSOC_P(s) FL_ALL((s), STR_NOEMBED|STR_ASSOC)
+#define STR_NOCAPA (STR_NOEMBED|ELTS_SHARED|STR_ASSOC)
+#define STR_NOCAPA_P(s) (FL_TEST((s),STR_NOEMBED) && FL_ANY((s),ELTS_SHARED|STR_ASSOC))
+#define STR_EMBED_P(str) (!FL_TEST((str), STR_NOEMBED))
+#define is_ascii_string(str) (rb_enc_str_coderange(str) == ENC_CODERANGE_7BIT)
+#define is_broken_string(str) (rb_enc_str_coderange(str) == ENC_CODERANGE_BROKEN)
/* struct.c */
VALUE rb_struct_init_copy(VALUE copy, VALUE s);
diff --git a/string.c b/string.c
index ca73d41..310140d 100644
--- a/string.c
+++ b/string.c
@@ -49,13 +49,6 @@ VALUE rb_cSymbol;
#define RUBY_MAX_CHAR_LEN 16
#define STR_TMPLOCK FL_USER7
-#define STR_NOEMBED FL_USER1
-#define STR_SHARED FL_USER2 /* = ELTS_SHARED */
-#define STR_ASSOC FL_USER3
-#define STR_SHARED_P(s) FL_ALL((s), STR_NOEMBED|ELTS_SHARED)
-#define STR_ASSOC_P(s) FL_ALL((s), STR_NOEMBED|STR_ASSOC)
-#define STR_NOCAPA (STR_NOEMBED|ELTS_SHARED|STR_ASSOC)
-#define STR_NOCAPA_P(s) (FL_TEST((s),STR_NOEMBED) && FL_ANY((s),ELTS_SHARED|STR_ASSOC))
#define STR_UNSET_NOCAPA(s) do {\
if (FL_TEST((s),STR_NOEMBED)) FL_UNSET((s),(ELTS_SHARED|STR_ASSOC));\
} while (0)
@@ -65,7 +58,6 @@ VALUE rb_cSymbol;
STR_SET_EMBED_LEN((str), 0);\
} while (0)
#define STR_SET_EMBED(str) FL_UNSET((str), STR_NOEMBED)
-#define STR_EMBED_P(str) (!FL_TEST((str), STR_NOEMBED))
#define STR_SET_EMBED_LEN(str, n) do { \
long tmp_n = (n);\
RBASIC(str)->flags &= ~RSTRING_EMBED_LEN_MASK;\
@@ -129,9 +121,6 @@ VALUE rb_cSymbol;
#define STR_HEAP_PTR(str) (RSTRING(str)->as.heap.ptr)
#define STR_HEAP_SIZE(str) (RSTRING(str)->as.heap.aux.capa + TERM_LEN(str))
-#define is_ascii_string(str) (rb_enc_str_coderange(str) == ENC_CODERANGE_7BIT)
-#define is_broken_string(str) (rb_enc_str_coderange(str) == ENC_CODERANGE_BROKEN)
-
#define STR_ENC_GET(str) rb_enc_from_index(ENCODING_GET(str))
static int fstring_cmp(VALUE a, VALUE b);