aboutsummaryrefslogtreecommitdiff
path: root/src/datastore
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-10-31 13:03:48 +0100
committerChristian Grothoff <christian@grothoff.org>2019-10-31 13:03:48 +0100
commit7e3cf5f461eb4fbb7581672bf0835da07c378136 (patch)
treebdc3874b7894242b095b892f1ed3e81a4d4f06c0 /src/datastore
parent01b480d6d026e0c537dc284a7e7df2c0320a3528 (diff)
downloadgnunet-7e3cf5f461eb4fbb7581672bf0835da07c378136.tar.gz
gnunet-7e3cf5f461eb4fbb7581672bf0835da07c378136.zip
tighten formatting rules
Diffstat (limited to 'src/datastore')
-rw-r--r--src/datastore/datastore.h1
-rw-r--r--src/datastore/datastore_api.c1
-rw-r--r--src/datastore/gnunet-datastore.c3
-rw-r--r--src/datastore/gnunet-service-datastore.c3
-rw-r--r--src/datastore/perf_datastore_api.c1
-rw-r--r--src/datastore/perf_plugin_datastore.c2
-rw-r--r--src/datastore/plugin_datastore_heap.c2
-rw-r--r--src/datastore/plugin_datastore_mysql.c2
-rw-r--r--src/datastore/plugin_datastore_postgres.c4
-rw-r--r--src/datastore/plugin_datastore_sqlite.c4
-rw-r--r--src/datastore/plugin_datastore_template.c2
-rw-r--r--src/datastore/test_datastore_api.c1
-rw-r--r--src/datastore/test_datastore_api_management.c1
-rw-r--r--src/datastore/test_plugin_datastore.c6
14 files changed, 18 insertions, 15 deletions
diff --git a/src/datastore/datastore.h b/src/datastore/datastore.h
index ee963b5ef..7af926617 100644
--- a/src/datastore/datastore.h
+++ b/src/datastore/datastore.h
@@ -254,5 +254,4 @@ struct DataMessage
254GNUNET_NETWORK_STRUCT_END 254GNUNET_NETWORK_STRUCT_END
255 255
256 256
257
258#endif 257#endif
diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c
index b10c43944..4537f6efe 100644
--- a/src/datastore/datastore_api.c
+++ b/src/datastore/datastore_api.c
@@ -1241,7 +1241,6 @@ GNUNET_DATASTORE_remove (struct GNUNET_DATASTORE_Handle *h,
1241} 1241}
1242 1242
1243 1243
1244
1245/** 1244/**
1246 * Get a random value from the datastore for content replication. 1245 * Get a random value from the datastore for content replication.
1247 * Returns a single, random value among those with the highest 1246 * Returns a single, random value among those with the highest
diff --git a/src/datastore/gnunet-datastore.c b/src/datastore/gnunet-datastore.c
index 259fa518b..54d087bc4 100644
--- a/src/datastore/gnunet-datastore.c
+++ b/src/datastore/gnunet-datastore.c
@@ -412,7 +412,7 @@ start_insert ()
412 ssize_t len; 412 ssize_t len;
413 413
414 len = GNUNET_DISK_file_read (file_handle, buf, MAGIC_LEN); 414 len = GNUNET_DISK_file_read (file_handle, buf, MAGIC_LEN);
415 if ((len != MAGIC_LEN)||(0 != memcmp (buf, MAGIC_BYTES, MAGIC_LEN))) 415 if ((len != MAGIC_LEN) || (0 != memcmp (buf, MAGIC_BYTES, MAGIC_LEN)))
416 { 416 {
417 fprintf (stderr, _ ("Input file is not of a supported format\n")); 417 fprintf (stderr, _ ("Input file is not of a supported format\n"));
418 return; 418 return;
@@ -504,4 +504,5 @@ main (int argc, char *const *argv)
504 return ret; 504 return ret;
505} 505}
506 506
507
507/* end of gnunet-datastore.c */ 508/* end of gnunet-datastore.c */
diff --git a/src/datastore/gnunet-service-datastore.c b/src/datastore/gnunet-service-datastore.c
index bd86fdad1..3fc46e19c 100644
--- a/src/datastore/gnunet-service-datastore.c
+++ b/src/datastore/gnunet-service-datastore.c
@@ -599,8 +599,7 @@ handle_reserve (void *cls, const struct ReserveMessage *msg)
599 * message happens, the insertion request could be blocked 599 * message happens, the insertion request could be blocked
600 * by less-important content from migration because it is 600 * by less-important content from migration because it is
601 * larger than 1/8th of the overall available space, and 601 * larger than 1/8th of the overall available space, and
602 * we only reserve 1/8th for "fresh" insertions */ 602 * we only reserve 1/8th for "fresh" insertions */GNUNET_log (
603 GNUNET_log (
604 GNUNET_ERROR_TYPE_WARNING, 603 GNUNET_ERROR_TYPE_WARNING,
605 _ ( 604 _ (
606 "The requested amount (%llu bytes) is larger than the cache size (%llu bytes)\n"), 605 "The requested amount (%llu bytes) is larger than the cache size (%llu bytes)\n"),
diff --git a/src/datastore/perf_datastore_api.c b/src/datastore/perf_datastore_api.c
index f353d0452..fef38891e 100644
--- a/src/datastore/perf_datastore_api.c
+++ b/src/datastore/perf_datastore_api.c
@@ -625,4 +625,5 @@ main (int argc,
625 return ok; 625 return ok;
626} 626}
627 627
628
628/* end of perf_datastore_api.c */ 629/* end of perf_datastore_api.c */
diff --git a/src/datastore/perf_plugin_datastore.c b/src/datastore/perf_plugin_datastore.c
index a1604d441..d7488d4e7 100644
--- a/src/datastore/perf_plugin_datastore.c
+++ b/src/datastore/perf_plugin_datastore.c
@@ -408,7 +408,6 @@ unload_plugin (struct GNUNET_DATASTORE_PluginFunctions *api,
408} 408}
409 409
410 410
411
412/** 411/**
413 * Last task run during shutdown. Disconnects us from 412 * Last task run during shutdown. Disconnects us from
414 * the transport and core. 413 * the transport and core.
@@ -570,4 +569,5 @@ main (int argc, char *argv[])
570 return ok; 569 return ok;
571} 570}
572 571
572
573/* end of perf_plugin_datastore.c */ 573/* end of perf_plugin_datastore.c */
diff --git a/src/datastore/plugin_datastore_heap.c b/src/datastore/plugin_datastore_heap.c
index 4e48bfd4c..a827a2763 100644
--- a/src/datastore/plugin_datastore_heap.c
+++ b/src/datastore/plugin_datastore_heap.c
@@ -268,6 +268,7 @@ update_iterator (void *cls,
268 return GNUNET_NO; 268 return GNUNET_NO;
269} 269}
270 270
271
271/** 272/**
272 * Store an item in the datastore. 273 * Store an item in the datastore.
273 * 274 *
@@ -939,4 +940,5 @@ libgnunet_plugin_datastore_heap_done (void *cls)
939 return NULL; 940 return NULL;
940} 941}
941 942
943
942/* end of plugin_datastore_heap.c */ 944/* end of plugin_datastore_heap.c */
diff --git a/src/datastore/plugin_datastore_mysql.c b/src/datastore/plugin_datastore_mysql.c
index 6aec09c54..15c2fe386 100644
--- a/src/datastore/plugin_datastore_mysql.c
+++ b/src/datastore/plugin_datastore_mysql.c
@@ -920,7 +920,6 @@ struct ExpiCtx
920}; 920};
921 921
922 922
923
924/** 923/**
925 * Wrapper for the processor for #mysql_plugin_get_expiration(). 924 * Wrapper for the processor for #mysql_plugin_get_expiration().
926 * If no expired value was found, we do a second query for 925 * If no expired value was found, we do a second query for
@@ -1200,4 +1199,5 @@ libgnunet_plugin_datastore_mysql_done (void *cls)
1200 return NULL; 1199 return NULL;
1201} 1200}
1202 1201
1202
1203/* end of plugin_datastore_mysql.c */ 1203/* end of plugin_datastore_mysql.c */
diff --git a/src/datastore/plugin_datastore_postgres.c b/src/datastore/plugin_datastore_postgres.c
index 0811edfd7..eba717226 100644
--- a/src/datastore/plugin_datastore_postgres.c
+++ b/src/datastore/plugin_datastore_postgres.c
@@ -73,8 +73,7 @@ init_connection (struct Plugin *plugin)
73 * we do math or inequality tests, so we can't handle the entire range of uint32_t. 73 * we do math or inequality tests, so we can't handle the entire range of uint32_t.
74 * This will also cause problems for expiration times after 294247-01-10-04:00:54 UTC. 74 * This will also cause problems for expiration times after 294247-01-10-04:00:54 UTC.
75 * PostgreSQL also recommends against using WITH OIDS. 75 * PostgreSQL also recommends against using WITH OIDS.
76 */ 76 */GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS gn090 ("
77 GNUNET_PQ_make_execute ("CREATE TABLE IF NOT EXISTS gn090 ("
78 " repl INTEGER NOT NULL DEFAULT 0," 77 " repl INTEGER NOT NULL DEFAULT 0,"
79 " type INTEGER NOT NULL DEFAULT 0," 78 " type INTEGER NOT NULL DEFAULT 0,"
80 " prio INTEGER NOT NULL DEFAULT 0," 79 " prio INTEGER NOT NULL DEFAULT 0,"
@@ -970,4 +969,5 @@ libgnunet_plugin_datastore_postgres_done (void *cls)
970 return NULL; 969 return NULL;
971} 970}
972 971
972
973/* end of plugin_datastore_postgres.c */ 973/* end of plugin_datastore_postgres.c */
diff --git a/src/datastore/plugin_datastore_sqlite.c b/src/datastore/plugin_datastore_sqlite.c
index b1bb7df7e..b3b30f256 100644
--- a/src/datastore/plugin_datastore_sqlite.c
+++ b/src/datastore/plugin_datastore_sqlite.c
@@ -349,8 +349,7 @@ database_setup (const struct GNUNET_CONFIGURATION_Handle *cfg,
349 * we only test equality on it and can cast it to/from uint32_t. For repl, prio, and anonLevel 349 * we only test equality on it and can cast it to/from uint32_t. For repl, prio, and anonLevel
350 * we do math or inequality tests, so we can't handle the entire range of uint32_t. 350 * we do math or inequality tests, so we can't handle the entire range of uint32_t.
351 * This will also cause problems for expiration times after 294247-01-10-04:00:54 UTC. 351 * This will also cause problems for expiration times after 294247-01-10-04:00:54 UTC.
352 */ 352 */if ((SQLITE_DONE == sqlite3_step (stmt)) &&
353 if ((SQLITE_DONE == sqlite3_step (stmt)) &&
354 (SQLITE_OK != sqlite3_exec (plugin->dbh, 353 (SQLITE_OK != sqlite3_exec (plugin->dbh,
355 "CREATE TABLE gn091 (" 354 "CREATE TABLE gn091 ("
356 " repl INT4 NOT NULL DEFAULT 0," 355 " repl INT4 NOT NULL DEFAULT 0,"
@@ -1350,4 +1349,5 @@ libgnunet_plugin_datastore_sqlite_done (void *cls)
1350 return NULL; 1349 return NULL;
1351} 1350}
1352 1351
1352
1353/* end of plugin_datastore_sqlite.c */ 1353/* end of plugin_datastore_sqlite.c */
diff --git a/src/datastore/plugin_datastore_template.c b/src/datastore/plugin_datastore_template.c
index 1f9a0f416..2b455f8cb 100644
--- a/src/datastore/plugin_datastore_template.c
+++ b/src/datastore/plugin_datastore_template.c
@@ -118,7 +118,6 @@ template_plugin_get_key (void *cls,
118} 118}
119 119
120 120
121
122/** 121/**
123 * Get a random item for replication. Returns a single, not expired, 122 * Get a random item for replication. Returns a single, not expired,
124 * random item from those with the highest replication counters. The 123 * random item from those with the highest replication counters. The
@@ -271,4 +270,5 @@ libgnunet_plugin_datastore_template_done (void *cls)
271 return NULL; 270 return NULL;
272} 271}
273 272
273
274/* end of plugin_datastore_template.c */ 274/* end of plugin_datastore_template.c */
diff --git a/src/datastore/test_datastore_api.c b/src/datastore/test_datastore_api.c
index 93ba46ff8..dbe590bab 100644
--- a/src/datastore/test_datastore_api.c
+++ b/src/datastore/test_datastore_api.c
@@ -728,4 +728,5 @@ main (int argc,
728 return ok; 728 return ok;
729} 729}
730 730
731
731/* end of test_datastore_api.c */ 732/* end of test_datastore_api.c */
diff --git a/src/datastore/test_datastore_api_management.c b/src/datastore/test_datastore_api_management.c
index e6bacaf6e..7bec0d064 100644
--- a/src/datastore/test_datastore_api_management.c
+++ b/src/datastore/test_datastore_api_management.c
@@ -404,4 +404,5 @@ main (int argc, char *argv[])
404 return ok; 404 return ok;
405} 405}
406 406
407
407/* end of test_datastore_api_management.c */ 408/* end of test_datastore_api_management.c */
diff --git a/src/datastore/test_plugin_datastore.c b/src/datastore/test_plugin_datastore.c
index 15fead3b7..9fe2462e7 100644
--- a/src/datastore/test_plugin_datastore.c
+++ b/src/datastore/test_plugin_datastore.c
@@ -154,8 +154,8 @@ do_put (struct CpsRunContext *crc)
154 /* most content is 32k */ 154 /* most content is 32k */
155 size = 32 * 1024; 155 size = 32 * 1024;
156 156
157 if ((0 != i)&&(GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 16) == 157 if ((0 != i) && (GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 16) ==
158 0) ) /* but some of it is less! */ 158 0) ) /* but some of it is less! */
159 size = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 32 * 1024); 159 size = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 32 * 1024);
160 size = size - (size & 7); /* always multiple of 8 */ 160 size = size - (size & 7); /* always multiple of 8 */
161 161
@@ -274,7 +274,6 @@ unload_plugin (struct GNUNET_DATASTORE_PluginFunctions *api,
274} 274}
275 275
276 276
277
278/** 277/**
279 * Last task run during shutdown. Disconnects us from 278 * Last task run during shutdown. Disconnects us from
280 * the transport and core. 279 * the transport and core.
@@ -475,4 +474,5 @@ main (int argc, char *argv[])
475 return ok; 474 return ok;
476} 475}
477 476
477
478/* end of test_plugin_datastore.c */ 478/* end of test_plugin_datastore.c */