Skip to content

Commit 0768a16

Browse files
committed
hash: Use true / false instead of 1 / 0 for bool parameters
Changes done with Coccinelle: @r1@ identifier F; identifier p; typedef bool; parameter list [n1] PL1; parameter list [n2] PL2; @@ F(PL1, bool p, PL2) { ... } @r2@ identifier r1.F; expression list [r1.n1] EL1; expression list [r1.n2] EL2; @@ F(EL1, ( - 1 + true | - 0 + false ) , EL2)
1 parent 3e30ded commit 0768a16

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ext/hash/hash.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ PHP_FUNCTION(hash_hmac)
583583
RETURN_THROWS();
584584
}
585585

586-
php_hash_do_hash_hmac(return_value, algo, data, data_len, key, key_len, raw_output, 0);
586+
php_hash_do_hash_hmac(return_value, algo, data, data_len, key, key_len, raw_output, false);
587587
}
588588
/* }}} */
589589

@@ -600,7 +600,7 @@ PHP_FUNCTION(hash_hmac_file)
600600
RETURN_THROWS();
601601
}
602602

603-
php_hash_do_hash_hmac(return_value, algo, data, data_len, key, key_len, raw_output, 1);
603+
php_hash_do_hash_hmac(return_value, algo, data, data_len, key, key_len, raw_output, true);
604604
}
605605
/* }}} */
606606

@@ -1227,9 +1227,9 @@ PHP_FUNCTION(mhash)
12271227
}
12281228

12291229
if (key) {
1230-
php_hash_do_hash_hmac(return_value, algo, data, data_len, key, key_len, 1, 0);
1230+
php_hash_do_hash_hmac(return_value, algo, data, data_len, key, key_len, true, false);
12311231
} else {
1232-
php_hash_do_hash(return_value, algo, data, data_len, 1, 0, NULL);
1232+
php_hash_do_hash(return_value, algo, data, data_len, true, false, NULL);
12331233
}
12341234

12351235
if (algo) {

0 commit comments

Comments
 (0)