Skip to content

Commit bdad5d8

Browse files
committed
Use true and false for bool return values
1 parent 20bba22 commit bdad5d8

6 files changed

Lines changed: 122 additions & 122 deletions

File tree

‎ext/opcache/jit/ir/ir_cfg.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,7 +1540,7 @@ static bool ir_is_merged_loop_back_edge(ir_ctx *ctx, uint32_t hdr, uint32_t b)
15401540
}
15411541
return b == hdr;
15421542
}
1543-
return false;
1543+
return 0;
15441544
}
15451545
#endif
15461546

@@ -1552,13 +1552,13 @@ static bool ir_should_align_loop(ir_ctx *ctx, ir_chain *chains, uint32_t b, ir_b
15521552
for (; n > 0; p++, n--) {
15531553
uint32_t pred = *p;
15541554
if (chains[pred].head) {
1555-
if (ir_chain_head(chains, pred) == b) return true;
1555+
if (ir_chain_head(chains, pred) == b) return 1;
15561556
} else {
1557-
if (ir_should_align_loop(ctx, chains, b, &ctx->cfg_blocks[pred])) return true;
1557+
if (ir_should_align_loop(ctx, chains, b, &ctx->cfg_blocks[pred])) return 1;
15581558
}
15591559
}
15601560

1561-
return false;
1561+
return 0;
15621562
}
15631563

15641564
static int ir_schedule_blocks_bottom_up(ir_ctx *ctx)

‎ext/opcache/jit/ir/ir_check.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ static bool ir_check_use_list(ir_check_ctx *check_ctx, const ir_ctx *ctx, ir_ref
7878
}
7979
for (p = &ctx->use_edges[use_list->refs]; n > 0; p++, n--) {
8080
if (*p == to) {
81-
return true;
81+
return 1;
8282
}
8383
}
84-
return false;
84+
return 0;
8585
}
8686

8787
static bool ir_check_input_list(ir_check_ctx *check_ctx, const ir_ctx *ctx, ir_ref from, ir_ref to)
@@ -115,10 +115,10 @@ static bool ir_check_input_list(ir_check_ctx *check_ctx, const ir_ctx *ctx, ir_r
115115
}
116116
for (j = 1, p = insn->ops + 1; j <= n; j++, p++) {
117117
if (*p == from) {
118-
return true;
118+
return 1;
119119
}
120120
}
121-
return false;
121+
return 0;
122122
}
123123

124124
static bool ir_check_domination(const ir_ctx *ctx, ir_ref def, ir_ref use)

‎ext/opcache/jit/ir/ir_emit.c‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ static bool ir_is_same_mem_var(const ir_ctx *ctx, ir_ref r1, int32_t offset)
247247
int32_t o1;
248248

249249
if (IR_IS_CONST_REF(r1)) {
250-
return false;
250+
return 0;
251251
}
252252

253253
IR_ASSERT(ctx->vregs[r1]);
@@ -1058,9 +1058,9 @@ static void ir_emit_dessa_moves(ir_ctx *ctx, int b, ir_block *bb)
10581058
/* TAILCALL optimization */
10591059
static bool ir_may_be_local_addr(ir_ctx *ctx, ir_insn *insn)
10601060
{
1061-
if (insn->op == IR_PARAM) return false;
1061+
if (insn->op == IR_PARAM) return 0;
10621062

1063-
return true;
1063+
return 1;
10641064
}
10651065

10661066
static bool ir_try_tailcall(ir_ctx *ctx, ir_ref ref, ir_insn *insn)
@@ -1078,7 +1078,7 @@ static bool ir_try_tailcall(ir_ctx *ctx, ir_ref ref, ir_insn *insn)
10781078

10791079
if (rule) {
10801080
ctx->rules[ref] = rule;
1081-
return false;
1081+
return 0;
10821082
}
10831083
proto_ref = func->proto;
10841084
} else if (func->op == IR_FUNC_ADDR) {
@@ -1088,10 +1088,10 @@ static bool ir_try_tailcall(ir_ctx *ctx, ir_ref ref, ir_insn *insn)
10881088
proto_ref = ctx->ir_base[insn->op2].op2;
10891089
}
10901090

1091-
if (!proto_ref) return false;
1091+
if (!proto_ref) return 0;
10921092
proto = (const ir_proto_t *)ir_get_str(ctx, proto_ref);
10931093

1094-
if ((proto->flags & IR_CALL_CONV_MASK) != (ctx->flags & IR_CALL_CONV_MASK)) return false;
1094+
if ((proto->flags & IR_CALL_CONV_MASK) != (ctx->flags & IR_CALL_CONV_MASK)) return 0;
10951095

10961096
cc = ir_get_call_conv_dsc(proto ? proto->flags : IR_CC_DEFAULT);
10971097
copy_stack = 0;
@@ -1101,7 +1101,7 @@ static bool ir_try_tailcall(ir_ctx *ctx, ir_ref ref, ir_insn *insn)
11011101
}
11021102

11031103
// TODO: "params_stack_size" must match the "args_stack_size"
1104-
if (params_stack_size) return false;
1104+
if (params_stack_size) return 0;
11051105

11061106
/* check for passing addresses of local variable */
11071107
uint32_t n = insn->inputs_count;
@@ -1110,7 +1110,7 @@ static bool ir_try_tailcall(ir_ctx *ctx, ir_ref ref, ir_insn *insn)
11101110
if (!IR_IS_CONST_REF(input) && ctx->ir_base[input].type == IR_ADDR) {
11111111
/* Passing addrss of local varible to TAILCALL is disallowd */
11121112
if (ir_may_be_local_addr(ctx, &ctx->ir_base[input])) {
1113-
return false;
1113+
return 0;
11141114
}
11151115
}
11161116
}
@@ -1134,7 +1134,7 @@ static bool ir_try_tailcall(ir_ctx *ctx, ir_ref ref, ir_insn *insn)
11341134

11351135
ctx->rules[ref] = IR_TAILCALL | IR_NO_REG;
11361136

1137-
return true;
1137+
return 1;
11381138
}
11391139

11401140
#if 0
@@ -1558,38 +1558,38 @@ static bool ir_load_may_reuse_var_slot(ir_ctx *ctx, ir_block *bb, ir_ref var, ir
15581558
if (n) {
15591559
for (p = ctx->use_edges + use_list->refs; n > 0; p++, n--) {
15601560
use = *p;
1561-
if (use < load || use > bb->end) return false;
1561+
if (use < load || use > bb->end) return 0;
15621562
if (use > last_use) last_use = use;
15631563
}
15641564
for (i = load + 1, insn = &ctx->ir_base[i]; i < last_use;) {
15651565
if ((insn->op == IR_VSTORE || insn->op == IR_VSTORE_v) && insn->op2 == var) {
1566-
return false;
1566+
return 0;
15671567
}
15681568
n = ir_insn_len(insn);
15691569
i += n;
15701570
insn += n;
15711571
}
15721572
}
1573-
return true;
1573+
return 1;
15741574
}
15751575

15761576
static bool ir_store_may_reuse_var_slot(ir_ctx *ctx, ir_block *bb, ir_ref var, ir_ref store, ir_ref val)
15771577
{
15781578
ir_ref i, n;
15791579
ir_insn *insn;
15801580

1581-
if (val < bb->start && val > store) return false;
1581+
if (val < bb->start && val > store) return 0;
15821582

15831583
for (i = val, insn = &ctx->ir_base[i]; i < store;) {
15841584
if ((insn->op == IR_VLOAD || insn->op == IR_VLOAD_v || insn->op == IR_VSTORE || insn->op == IR_VSTORE_v)
15851585
&& insn->op2 == var) {
1586-
return false;
1586+
return 0;
15871587
}
15881588
n = ir_insn_len(insn);
15891589
i += n;
15901590
insn += n;
15911591
}
1592-
return true;
1592+
return 1;
15931593
}
15941594

15951595
static void ir_add_fusion_data(ir_ctx *ctx, ir_ref ref, ir_ref input, ir_reg_alloc_simple_data *x)

‎ext/opcache/jit/ir/ir_gdb.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ static bool ir_gdb_register_code(const void *object, size_t size)
534534

535535
entry = malloc(sizeof(ir_gdbjit_code_entry) + size);
536536
if (entry == NULL) {
537-
return false;
537+
return 0;
538538
}
539539

540540
entry->symfile_addr = ((char*)entry) + sizeof(ir_gdbjit_code_entry);
@@ -566,7 +566,7 @@ static bool ir_gdb_register_code(const void *object, size_t size)
566566
__jit_debug_descriptor.action_flag = IR_GDBJIT_REGISTER;
567567
__jit_debug_register_code();
568568

569-
return true;
569+
return 1;
570570
}
571571

572572
void ir_gdb_unregister_all(void)

0 commit comments

Comments
 (0)