From 82d546ace50fea1b9d80311db04e5302573d3ee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 23 Sep 2025 22:48:29 +0200 Subject: [PATCH] dba: Use `true` / `false` instead of `1` / `0` when assigning to `bool` Changes done with Coccinelle: @@ bool b; @@ - b = 0 + b = false @@ bool b; @@ - b = 1 + b = true --- ext/dba/dba.c | 8 ++++---- ext/dba/dba_inifile.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/dba/dba.c b/ext/dba/dba.c index 60685474212..41a0f8cd5ee 100644 --- a/ext/dba/dba.c +++ b/ext/dba/dba.c @@ -539,8 +539,8 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, bool persistent) int persistent_flag = persistent ? STREAM_OPEN_PERSISTENT : 0; char *lock_name; #ifdef PHP_WIN32 - bool restarted = 0; - bool need_creation = 0; + bool restarted = false; + bool need_creation = false; #endif zend_string *path; @@ -923,7 +923,7 @@ restart: lock_file_mode = "r+b"; - restarted = 1; + restarted = true; goto restart; #endif } @@ -1277,7 +1277,7 @@ PHP_FUNCTION(dba_sync) /* {{{ List configured database handlers */ PHP_FUNCTION(dba_handlers) { - bool full_info = 0; + bool full_info = false; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &full_info) == FAILURE) { RETURN_THROWS(); diff --git a/ext/dba/dba_inifile.c b/ext/dba/dba_inifile.c index 00b99d55b00..75a267055d9 100644 --- a/ext/dba/dba_inifile.c +++ b/ext/dba/dba_inifile.c @@ -127,7 +127,7 @@ DBA_DELETE_FUNC(inifile) { inifile *dba = info->dbf; int res; - bool found = 0; + bool found = false; key_type ini_key; if (!key) {