diff options
author | David Barksdale <amatus.amongus@gmail.com> | 2015-01-06 01:11:45 +0000 |
---|---|---|
committer | David Barksdale <amatus.amongus@gmail.com> | 2015-01-06 01:11:45 +0000 |
commit | 55182581d5e44ccc8d7495efd60a8f913d5b057d (patch) | |
tree | 219343d5a8d8c02bcb31dd10945dc98a491c340c /src/datastore/plugin_datastore_sqlite.c | |
parent | 56342b51c42bba7f627de23cde834994171fb267 (diff) | |
download | gnunet-55182581d5e44ccc8d7495efd60a8f913d5b057d.tar.gz gnunet-55182581d5e44ccc8d7495efd60a8f913d5b057d.zip |
Workaround emscripten bug in returning int64_t
Emscripten can't return a 64-bit integer from dynamically loaded code.
Diffstat (limited to 'src/datastore/plugin_datastore_sqlite.c')
-rw-r--r-- | src/datastore/plugin_datastore_sqlite.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/datastore/plugin_datastore_sqlite.c b/src/datastore/plugin_datastore_sqlite.c index ae57c6aa0..b962d22d7 100644 --- a/src/datastore/plugin_datastore_sqlite.c +++ b/src/datastore/plugin_datastore_sqlite.c | |||
@@ -1135,8 +1135,8 @@ sqlite_plugin_drop (void *cls) | |||
1135 | * @param cls the `struct Plugin` | 1135 | * @param cls the `struct Plugin` |
1136 | * @return the size of the database on disk (estimate) | 1136 | * @return the size of the database on disk (estimate) |
1137 | */ | 1137 | */ |
1138 | static unsigned long long | 1138 | static void |
1139 | sqlite_plugin_estimate_size (void *cls) | 1139 | sqlite_plugin_estimate_size (void *cls, unsigned long long *estimate) |
1140 | { | 1140 | { |
1141 | struct Plugin *plugin = cls; | 1141 | struct Plugin *plugin = cls; |
1142 | sqlite3_stmt *stmt; | 1142 | sqlite3_stmt *stmt; |
@@ -1147,12 +1147,15 @@ sqlite_plugin_estimate_size (void *cls) | |||
1147 | char *e; | 1147 | char *e; |
1148 | #endif | 1148 | #endif |
1149 | 1149 | ||
1150 | if (NULL == estimate) | ||
1151 | return; | ||
1150 | if (SQLITE_VERSION_NUMBER < 3006000) | 1152 | if (SQLITE_VERSION_NUMBER < 3006000) |
1151 | { | 1153 | { |
1152 | GNUNET_log_from (GNUNET_ERROR_TYPE_WARNING, "datastore-sqlite", | 1154 | GNUNET_log_from (GNUNET_ERROR_TYPE_WARNING, "datastore-sqlite", |
1153 | _ | 1155 | _ |
1154 | ("sqlite version to old to determine size, assuming zero\n")); | 1156 | ("sqlite version to old to determine size, assuming zero\n")); |
1155 | return 0; | 1157 | *estimate = 0; |
1158 | return; | ||
1156 | } | 1159 | } |
1157 | CHECK (SQLITE_OK == sqlite3_exec (plugin->dbh, "VACUUM", NULL, NULL, ENULL)); | 1160 | CHECK (SQLITE_OK == sqlite3_exec (plugin->dbh, "VACUUM", NULL, NULL, ENULL)); |
1158 | CHECK (SQLITE_OK == | 1161 | CHECK (SQLITE_OK == |
@@ -1172,7 +1175,7 @@ sqlite_plugin_estimate_size (void *cls) | |||
1172 | _ | 1175 | _ |
1173 | ("Using sqlite page utilization to estimate payload (%llu pages of size %llu bytes)\n"), | 1176 | ("Using sqlite page utilization to estimate payload (%llu pages of size %llu bytes)\n"), |
1174 | (unsigned long long) pages, (unsigned long long) page_size); | 1177 | (unsigned long long) pages, (unsigned long long) page_size); |
1175 | return pages * page_size; | 1178 | *estimate = pages * page_size; |
1176 | } | 1179 | } |
1177 | 1180 | ||
1178 | 1181 | ||