Skip to content

Fix unused variable in pdo_sqlite_stmt_set_attribute() #18851

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 14, 2025

Conversation

iluuu1994
Copy link
Member

The indentation is also wrong (using spaces instead of tabs), but this should be fixed in a separate commit.

See https://github.com/php/php-src/actions/runs/15647022368/job/44086182043

The indentation is also wrong (using spaces instead of tabs), but this should be
fixed in a separate commit.
@@ -434,6 +432,8 @@ static int pdo_sqlite_stmt_set_attribute(pdo_stmt_t *stmt, zend_long attr, zval
zend_value_error("explain mode must be one of the Pdo\\Sqlite::EXPLAIN_MODE_* constants");
return 0;
}

pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cast is also not necessary here.

Suggested change
pdo_sqlite_stmt *S = (pdo_sqlite_stmt*)stmt->driver_data;
pdo_sqlite_stmt *S = stmt->driver_data;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically not, but casting void* is somewhat of a personal preference. It's there for all other usages of driver_data in this file, so we should probably stay consistent.

@iluuu1994 iluuu1994 merged commit 0a9697f into php:master Jun 14, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants