summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMasaki Muranaka <[email protected]>2013-03-13 13:30:40 +0900
committerMasaki Muranaka <[email protected]>2013-03-14 15:13:12 +0900
commit1ffc9ba3255f8b63164c42ea8304115f5a6b2464 (patch)
tree696cc7a62568dd72974e5a20c7fa8486cb5b58e2 /src
parent0739960b7fab2ce61bbeaedef7680cd4805a03f4 (diff)
downloadmruby-1ffc9ba3255f8b63164c42ea8304115f5a6b2464.tar.gz
mruby-1ffc9ba3255f8b63164c42ea8304115f5a6b2464.zip
Define type mrb_bool. It is typedef-ed to _Bool on C99, unsigned int on MSVC.
It is safer than applying 1bit bit-fields to signed int. For forward compatibility, you should substiture only 1 or 0 for the variable typed mrb_bool.
Diffstat (limited to 'src')
-rw-r--r--src/codegen.c2
-rw-r--r--src/gc.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/codegen.c b/src/codegen.c
index ed44f1792..cbbd2d16a 100644
--- a/src/codegen.c
+++ b/src/codegen.c
@@ -49,7 +49,7 @@ typedef struct scope {
int pc;
int lastlabel;
int ainfo:15;
- int mscope:1;
+ mrb_bool mscope:1;
struct loopinfo *loop;
int ensure_level;
diff --git a/src/gc.c b/src/gc.c
index da6844fa5..ab50529f7 100644
--- a/src/gc.c
+++ b/src/gc.c
@@ -197,7 +197,7 @@ struct heap_page {
struct heap_page *next;
struct heap_page *free_next;
struct heap_page *free_prev;
- unsigned int old:1;
+ mrb_bool old:1;
RVALUE objects[MRB_HEAP_PAGE_SIZE];
};