mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #1674 from cremno/mrb_bool-FALSE-TRUE
use mrb_bool, FALSE and TRUE more
This commit is contained in:
+4
-4
@@ -981,7 +981,7 @@ gen_send_intern(codegen_scope *s)
|
||||
push();
|
||||
}
|
||||
static void
|
||||
gen_literal_array(codegen_scope *s, node *tree, int sym, int val)
|
||||
gen_literal_array(codegen_scope *s, node *tree, mrb_bool sym, int val)
|
||||
{
|
||||
if (val) {
|
||||
int i = 0, j = 0;
|
||||
@@ -1069,7 +1069,7 @@ readint_float(codegen_scope *s, const char *p, int base)
|
||||
}
|
||||
|
||||
static mrb_int
|
||||
readint_mrb_int(codegen_scope *s, const char *p, int base, int neg, int *overflow)
|
||||
readint_mrb_int(codegen_scope *s, const char *p, int base, mrb_bool neg, mrb_bool *overflow)
|
||||
{
|
||||
const char *e = p + strlen(p);
|
||||
mrb_int result = 0;
|
||||
@@ -1926,7 +1926,7 @@ codegen(codegen_scope *s, node *tree, int val)
|
||||
int base = (intptr_t)tree->cdr->car;
|
||||
mrb_int i;
|
||||
mrb_code co;
|
||||
int overflow;
|
||||
mrb_bool overflow;
|
||||
|
||||
i = readint_mrb_int(s, p, base, FALSE, &overflow);
|
||||
if (overflow) {
|
||||
@@ -1982,7 +1982,7 @@ codegen(codegen_scope *s, node *tree, int val)
|
||||
int base = (intptr_t)tree->cdr->car;
|
||||
mrb_int i;
|
||||
mrb_code co;
|
||||
int overflow;
|
||||
mrb_bool overflow;
|
||||
|
||||
i = readint_mrb_int(s, p, base, TRUE, &overflow);
|
||||
if (overflow) {
|
||||
|
||||
+1
-1
@@ -352,7 +352,7 @@ set_backtrace(mrb_state *mrb, mrb_value info, mrb_value bt)
|
||||
}
|
||||
|
||||
static mrb_value
|
||||
make_exception(mrb_state *mrb, int argc, mrb_value *argv, int isstr)
|
||||
make_exception(mrb_state *mrb, int argc, mrb_value *argv, mrb_bool isstr)
|
||||
{
|
||||
mrb_value mesg;
|
||||
int n;
|
||||
|
||||
@@ -834,13 +834,13 @@ incremental_sweep_phase(mrb_state *mrb, size_t limit)
|
||||
RVALUE *p = page->objects;
|
||||
RVALUE *e = p + MRB_HEAP_PAGE_SIZE;
|
||||
size_t freed = 0;
|
||||
int dead_slot = 1;
|
||||
mrb_bool dead_slot = TRUE;
|
||||
int full = (page->freelist == NULL);
|
||||
|
||||
if (is_minor_gc(mrb) && page->old) {
|
||||
/* skip a slot which doesn't contain any young object */
|
||||
p = e;
|
||||
dead_slot = 0;
|
||||
dead_slot = FALSE;
|
||||
}
|
||||
while (p<e) {
|
||||
if (is_dead(mrb, &p->as.basic)) {
|
||||
|
||||
+1
-1
@@ -998,7 +998,7 @@ mrb_hash_has_value(mrb_state *mrb, mrb_value hash)
|
||||
}
|
||||
|
||||
static mrb_value
|
||||
hash_equal(mrb_state *mrb, mrb_value hash1, mrb_value hash2, int eql)
|
||||
hash_equal(mrb_state *mrb, mrb_value hash1, mrb_value hash2, mrb_bool eql)
|
||||
{
|
||||
khash_t(ht) *h1, *h2;
|
||||
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ static mrb_value
|
||||
num_pow(mrb_state *mrb, mrb_value x)
|
||||
{
|
||||
mrb_value y;
|
||||
int both_int = FALSE;
|
||||
mrb_bool both_int = FALSE;
|
||||
mrb_float d;
|
||||
|
||||
mrb_get_args(mrb, "o", &y);
|
||||
|
||||
+1
-1
@@ -302,7 +302,7 @@ inspect_type(mrb_state *mrb, mrb_value val)
|
||||
}
|
||||
|
||||
static mrb_value
|
||||
convert_type(mrb_state *mrb, mrb_value val, const char *tname, const char *method, int raise)
|
||||
convert_type(mrb_state *mrb, mrb_value val, const char *tname, const char *method, mrb_bool raise)
|
||||
{
|
||||
mrb_sym m = 0;
|
||||
|
||||
|
||||
+10
-11
@@ -3319,8 +3319,8 @@ backref_error(parser_state *p, node *n)
|
||||
}
|
||||
}
|
||||
|
||||
static int peeks(parser_state *p, const char *s);
|
||||
static int skips(parser_state *p, const char *s);
|
||||
static mrb_bool peeks(parser_state *p, const char *s);
|
||||
static mrb_bool skips(parser_state *p, const char *s);
|
||||
|
||||
static inline int
|
||||
nextc(parser_state *p)
|
||||
@@ -3383,7 +3383,7 @@ skip(parser_state *p, char term)
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
static mrb_bool
|
||||
peek_n(parser_state *p, int c, int n)
|
||||
{
|
||||
node *list = 0;
|
||||
@@ -3405,7 +3405,7 @@ peek_n(parser_state *p, int c, int n)
|
||||
}
|
||||
#define peek(p,c) peek_n((p), (c), 0)
|
||||
|
||||
static int
|
||||
static mrb_bool
|
||||
peeks(parser_state *p, const char *s)
|
||||
{
|
||||
int len = strlen(s);
|
||||
@@ -3426,7 +3426,7 @@ peeks(parser_state *p, const char *s)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static int
|
||||
static mrb_bool
|
||||
skips(parser_state *p, const char *s)
|
||||
{
|
||||
int c;
|
||||
@@ -3855,8 +3855,8 @@ heredoc_identifier(parser_state *p)
|
||||
{
|
||||
int c;
|
||||
int type = str_heredoc;
|
||||
int indent = FALSE;
|
||||
int quote = FALSE;
|
||||
mrb_bool indent = FALSE;
|
||||
mrb_bool quote = FALSE;
|
||||
node *newnode;
|
||||
parser_heredoc_info *info;
|
||||
|
||||
@@ -5197,7 +5197,7 @@ mrb_parser_parse(parser_state *p, mrbc_context *c)
|
||||
}
|
||||
|
||||
p->cmd_start = TRUE;
|
||||
p->in_def = p->in_single = FALSE;
|
||||
p->in_def = p->in_single = 0;
|
||||
p->nerr = p->nwarn = 0;
|
||||
p->lex_strterm = NULL;
|
||||
|
||||
@@ -5227,7 +5227,6 @@ mrb_parser_new(mrb_state *mrb)
|
||||
*p = parser_state_zero;
|
||||
p->mrb = mrb;
|
||||
p->pool = pool;
|
||||
p->in_def = p->in_single = 0;
|
||||
|
||||
p->s = p->send = NULL;
|
||||
#ifdef ENABLE_STDIO
|
||||
@@ -5235,9 +5234,9 @@ mrb_parser_new(mrb_state *mrb)
|
||||
#endif
|
||||
|
||||
p->cmd_start = TRUE;
|
||||
p->in_def = p->in_single = FALSE;
|
||||
p->in_def = p->in_single = 0;
|
||||
|
||||
p->capture_errors = 0;
|
||||
p->capture_errors = FALSE;
|
||||
p->lineno = 1;
|
||||
p->column = 0;
|
||||
#if defined(PARSER_TEST) || defined(PARSER_DEBUG)
|
||||
|
||||
+1
-1
@@ -257,7 +257,7 @@ mrb_range_each(mrb_state *mrb, mrb_value range)
|
||||
return range;
|
||||
}
|
||||
|
||||
mrb_int
|
||||
mrb_bool
|
||||
mrb_range_beg_len(mrb_state *mrb, mrb_value range, mrb_int *begp, mrb_int *lenp, mrb_int len)
|
||||
{
|
||||
mrb_int beg, end, b, e;
|
||||
|
||||
+3
-3
@@ -2005,7 +2005,7 @@ mrb_string_value_cstr(mrb_state *mrb, mrb_value *ptr)
|
||||
}
|
||||
|
||||
mrb_value
|
||||
mrb_str_to_inum(mrb_state *mrb, mrb_value str, int base, int badcheck)
|
||||
mrb_str_to_inum(mrb_state *mrb, mrb_value str, int base, mrb_bool badcheck)
|
||||
{
|
||||
char *s;
|
||||
int len;
|
||||
@@ -2068,7 +2068,7 @@ mrb_str_to_i(mrb_state *mrb, mrb_value self)
|
||||
}
|
||||
|
||||
double
|
||||
mrb_cstr_to_dbl(mrb_state *mrb, const char * p, int badcheck)
|
||||
mrb_cstr_to_dbl(mrb_state *mrb, const char * p, mrb_bool badcheck)
|
||||
{
|
||||
char *end;
|
||||
double d;
|
||||
@@ -2137,7 +2137,7 @@ bad:
|
||||
}
|
||||
|
||||
double
|
||||
mrb_str_to_dbl(mrb_state *mrb, mrb_value str, int badcheck)
|
||||
mrb_str_to_dbl(mrb_state *mrb, mrb_value str, mrb_bool badcheck)
|
||||
{
|
||||
char *s;
|
||||
int len;
|
||||
|
||||
+1
-1
@@ -308,7 +308,7 @@ static mrb_bool
|
||||
symname_p(const char *name)
|
||||
{
|
||||
const char *m = name;
|
||||
int localid = FALSE;
|
||||
mrb_bool localid = FALSE;
|
||||
|
||||
if (!m) return FALSE;
|
||||
switch (*m) {
|
||||
|
||||
Reference in New Issue
Block a user