summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-03-10 22:24:36 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-03-10 22:24:36 +0900
commit86a48b7c48fad8cdaf747449c3df672ec24f3659 (patch)
tree2792113a4e641416107813861344eb14f8c14019
parent04dffc239be2aed8215ac673241b530eb6abc68b (diff)
parent49a048c54428fef85f8b52b82916b1a39112a51e (diff)
downloadmruby-86a48b7c48fad8cdaf747449c3df672ec24f3659.tar.gz
mruby-86a48b7c48fad8cdaf747449c3df672ec24f3659.zip
Merge pull request #1840 from ksss/bit-field
set bit field for mrb_bool
-rw-r--r--mrbgems/mruby-random/src/mt19937ar.h2
-rw-r--r--src/string.c2
-rw-r--r--src/symbol.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/mrbgems/mruby-random/src/mt19937ar.h b/mrbgems/mruby-random/src/mt19937ar.h
index 504355193..9bf150190 100644
--- a/mrbgems/mruby-random/src/mt19937ar.h
+++ b/mrbgems/mruby-random/src/mt19937ar.h
@@ -15,7 +15,7 @@ typedef struct {
};
mrb_int seed;
- mrb_bool has_seed;
+ mrb_bool has_seed : 1;
} mt_state;
void mrb_random_init_genrand(mt_state *, unsigned long);
diff --git a/src/string.c b/src/string.c
index 3d3f084ca..dff8de90f 100644
--- a/src/string.c
+++ b/src/string.c
@@ -41,7 +41,7 @@
const char mrb_digitmap[] = "0123456789abcdefghijklmnopqrstuvwxyz";
typedef struct mrb_shared_string {
- mrb_bool nofree;
+ mrb_bool nofree : 1;
int refcnt;
char *ptr;
mrb_int len;
diff --git a/src/symbol.c b/src/symbol.c
index cc99c15fc..f2ead15ff 100644
--- a/src/symbol.c
+++ b/src/symbol.c
@@ -12,7 +12,7 @@
/* ------------------------------------------------------ */
typedef struct symbol_name {
- mrb_bool lit;
+ mrb_bool lit : 1;
uint16_t len;
const char *name;
} symbol_name;