From 0768a16a23894e2af8356714b3958e284dabf3f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 23:26:53 +0200 Subject: [PATCH] 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) --- ext/hash/hash.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/hash/hash.c b/ext/hash/hash.c index ca8efc3ca48..98a52536a68 100644 --- a/ext/hash/hash.c +++ b/ext/hash/hash.c @@ -583,7 +583,7 @@ PHP_FUNCTION(hash_hmac) RETURN_THROWS(); } - php_hash_do_hash_hmac(return_value, algo, data, data_len, key, key_len, raw_output, 0); + php_hash_do_hash_hmac(return_value, algo, data, data_len, key, key_len, raw_output, false); } /* }}} */ @@ -600,7 +600,7 @@ PHP_FUNCTION(hash_hmac_file) RETURN_THROWS(); } - php_hash_do_hash_hmac(return_value, algo, data, data_len, key, key_len, raw_output, 1); + php_hash_do_hash_hmac(return_value, algo, data, data_len, key, key_len, raw_output, true); } /* }}} */ @@ -1227,9 +1227,9 @@ PHP_FUNCTION(mhash) } if (key) { - php_hash_do_hash_hmac(return_value, algo, data, data_len, key, key_len, 1, 0); + php_hash_do_hash_hmac(return_value, algo, data, data_len, key, key_len, true, false); } else { - php_hash_do_hash(return_value, algo, data, data_len, 1, 0, NULL); + php_hash_do_hash(return_value, algo, data, data_len, true, false, NULL); } if (algo) {