gnucash master: Multiple changes pushed
John Ralls
jralls at code.gnucash.org
Thu Apr 7 18:43:15 EDT 2016
Updated via https://github.com/Gnucash/gnucash/commit/2379b971 (commit)
via https://github.com/Gnucash/gnucash/commit/4fa68502 (commit)
from https://github.com/Gnucash/gnucash/commit/dbf4eada (commit)
commit 2379b9715db5835da85062f5d20b5b44537abed0
Author: John Ralls <jralls at ceridwen.us>
Date: Thu Apr 7 15:42:47 2016 -0700
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.
diff --git a/src/backend/dbi/gnc-backend-dbi.cpp b/src/backend/dbi/gnc-backend-dbi.cpp
index 7bb4571..601c1b1 100644
--- a/src/backend/dbi/gnc-backend-dbi.cpp
+++ b/src/backend/dbi/gnc-backend-dbi.cpp
@@ -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
commit 4fa68502ec3862ba838bba77ba7568cefeeeaa06
Author: John Ralls <jralls at ceridwen.us>
Date: Thu Apr 7 15:41:15 2016 -0700
Fix some new errors raised by clang 703.0.29.
diff --git a/src/libqof/qof/gnc-datetime.cpp b/src/libqof/qof/gnc-datetime.cpp
index 8bc696a..ebc1bf2 100644
--- a/src/libqof/qof/gnc-datetime.cpp
+++ b/src/libqof/qof/gnc-datetime.cpp
@@ -307,7 +307,7 @@ GncDateTime::utc_tm() const
GncDate
GncDateTime::date() const
{
- return std::move(GncDate(m_impl->date()));
+ return GncDate(m_impl->date());
}
std::string
diff --git a/src/libqof/qof/qofinstance.cpp b/src/libqof/qof/qofinstance.cpp
index 4d988fb..1bd5da6 100644
--- a/src/libqof/qof/qofinstance.cpp
+++ b/src/libqof/qof/qofinstance.cpp
@@ -1062,7 +1062,7 @@ qof_instance_has_kvp (QofInstance *inst)
void
qof_instance_set_kvp (QofInstance *inst, const gchar *key, const GValue *value)
{
- delete inst->kvp_data->set_path({key}, kvp_value_from_gvalue(value));
+ delete inst->kvp_data->set_path(key, kvp_value_from_gvalue(value));
}
void
@@ -1115,7 +1115,7 @@ qof_instance_kvp_add_guid (const QofInstance *inst, const char* path,
auto container = new KvpFrame;
container->set(key, new KvpValue(const_cast<GncGUID*>(guid)));
container->set("date", new KvpValue(time));
- delete inst->kvp_data->set_path({path}, new KvpValue(container));
+ delete inst->kvp_data->set_path(path, new KvpValue(container));
}
inline static gboolean
@@ -1182,7 +1182,7 @@ qof_instance_kvp_remove_guid (const QofInstance *inst, const char *path,
case KvpValue::Type::FRAME:
if (kvp_match_guid (v, key, guid))
{
- delete inst->kvp_data->set_path({path}, nullptr);
+ delete inst->kvp_data->set_path(path, nullptr);
delete v;
}
break;
@@ -1227,7 +1227,7 @@ qof_instance_kvp_merge_guids (const QofInstance *target,
if (target_val)
target_val->add(v);
else
- target->kvp_data->set_path({path}, v);
+ target->kvp_data->set_path(path, v);
donor->kvp_data->set(path, nullptr); //Contents moved, Don't delete!
break;
case KvpValue::Type::GLIST:
Summary of changes:
src/backend/dbi/gnc-backend-dbi.cpp | 10 +++++++---
src/libqof/qof/gnc-datetime.cpp | 2 +-
src/libqof/qof/qofinstance.cpp | 8 ++++----
3 files changed, 12 insertions(+), 8 deletions(-)
More information about the gnucash-changes
mailing list