From b52127bcbf817ff8285b36d22198b275327e16bb Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Sun, 16 Dec 2012 17:47:51 -0800 Subject: Cleanup headers and remove all uses of va_list except logging --- src/common/db.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/common/db.hpp') diff --git a/src/common/db.hpp b/src/common/db.hpp index 313ba3a..63ce7fa 100644 --- a/src/common/db.hpp +++ b/src/common/db.hpp @@ -3,7 +3,7 @@ #define DB_HPP # include "sanity.hpp" -# include +# include /// Number of tree roots // Somewhat arbitrary - larger wastes more space but is faster for large trees @@ -13,7 +13,7 @@ typedef enum dbn_color { RED, - BLACK + BLACK, } dbn_color; typedef intptr_t numdb_key_t; @@ -28,7 +28,7 @@ typedef union db_key_t } db_key_t; typedef void* db_val_t; typedef uint32_t hash_t; -typedef void(*db_func_t)(db_key_t, db_val_t, va_list); +typedef std::function db_func_t; /// DataBase Node struct dbn @@ -82,9 +82,9 @@ struct dbn *db_insert(struct dbt *table, db_key_t key, db_val_t data); db_val_t db_erase(struct dbt *table, db_key_t key); /// Execute a function for every element, in unspecified order -void db_foreach(struct dbt *, db_func_t, ...); +void db_foreach(struct dbt *, db_func_t); // opposite of init? Calls release for every element and frees memory // This probably isn't really needed: we don't have to free memory while exiting -void db_final(struct dbt *, db_func_t, ...) __attribute__((deprecated)); +void db_final(struct dbt *, db_func_t) __attribute__((deprecated)); -#endif +#endif // DB_HPP -- cgit v1.2.3-60-g2f50