mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Correct the interpretation of the void* passed to sqlite3_error_fn.
We can't cast a dbi_conn to a GncDbiSqlConnection, even without slicing the pointers won't have the same value.
This commit is contained in:
@@ -260,10 +260,14 @@ static void
|
||||
sqlite3_error_fn(dbi_conn conn, void* user_data)
|
||||
{
|
||||
const gchar* msg;
|
||||
GncDbiSqlConnection *db_conn = static_cast<decltype(db_conn)>(conn);
|
||||
(void)dbi_conn_error(db_conn, &msg);
|
||||
GncDbiBackend *be = static_cast<decltype(be)>(user_data);
|
||||
/* FIXME: Cast won't be necessary once GncDbiSqlConnection is a derived class of
|
||||
* GncSqlConnection. */
|
||||
GncDbiSqlConnection *dbi_conn =
|
||||
reinterpret_cast<decltype(dbi_conn)>(be->sql_be.conn);
|
||||
(void)dbi_conn_error(conn, &msg);
|
||||
PERR( "DBI error: %s\n", msg );
|
||||
gnc_dbi_set_error(db_conn, ERR_BACKEND_MISC, 0, FALSE);
|
||||
gnc_dbi_set_error(dbi_conn, ERR_BACKEND_MISC, 0, FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user