Skip to content

Commit 262744f

Browse files
committed
Boolify pdo_stmt_describe_columns()
1 parent 63c4e8b commit 262744f

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

ext/pdo/pdo_dbh.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ PHP_METHOD(PDO, query)
10841084
/* now execute the statement */
10851085
PDO_STMT_CLEAR_ERR();
10861086
if (stmt->methods->executer(stmt)) {
1087-
int ret = 1;
1087+
bool ret = true;
10881088
if (!stmt->executed) {
10891089
if (stmt->dbh->alloc_own_columns) {
10901090
ret = pdo_stmt_describe_columns(stmt);

ext/pdo/pdo_stmt.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,15 @@ static bool dispatch_param_event(pdo_stmt_t *stmt, enum pdo_param_event event_ty
125125
}
126126
/* }}} */
127127

128-
int pdo_stmt_describe_columns(pdo_stmt_t *stmt) /* {{{ */
128+
bool pdo_stmt_describe_columns(pdo_stmt_t *stmt) /* {{{ */
129129
{
130130
int col;
131131

132132
stmt->columns = ecalloc(stmt->column_count, sizeof(struct pdo_column_data));
133133

134134
for (col = 0; col < stmt->column_count; col++) {
135135
if (!stmt->methods->describer(stmt, col)) {
136-
return 0;
136+
return false;
137137
}
138138

139139
/* if we are applying case conversions on column names, do so now */
@@ -168,7 +168,7 @@ int pdo_stmt_describe_columns(pdo_stmt_t *stmt) /* {{{ */
168168
}
169169

170170
}
171-
return 1;
171+
return true;
172172
}
173173
/* }}} */
174174

ext/pdo/php_pdo_int.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ extern zend_class_entry *pdo_dbstmt_ce;
3939
void pdo_dbstmt_free_storage(zend_object *std);
4040
zend_object_iterator *pdo_stmt_iter_get(zend_class_entry *ce, zval *object, int by_ref);
4141
extern zend_object_handlers pdo_dbstmt_object_handlers;
42-
int pdo_stmt_describe_columns(pdo_stmt_t *stmt);
42+
bool pdo_stmt_describe_columns(pdo_stmt_t *stmt);
4343
bool pdo_stmt_setup_fetch_mode(pdo_stmt_t *stmt, zend_long mode, uint32_t mode_arg_num,
4444
zval *args, uint32_t variadic_num_args);
4545

0 commit comments

Comments
 (0)