summaryrefslogtreecommitdiff
path: root/src/common/db.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2014-11-16 06:35:51 +0100
committerHaru <haru@dotalux.com>2014-11-16 07:16:23 +0100
commit02fcaed6bd32b0ffbc4f03b8f9de6f0720e6253f (patch)
tree3161fd5786bb563c32059068eb3b4876d2ae11ca /src/common/db.c
parent31bff051ee3c353fb7ee5e544d68feeaefd4941f (diff)
downloadhercules-02fcaed6bd32b0ffbc4f03b8f9de6f0720e6253f.tar.gz
hercules-02fcaed6bd32b0ffbc4f03b8f9de6f0720e6253f.tar.bz2
hercules-02fcaed6bd32b0ffbc4f03b8f9de6f0720e6253f.tar.xz
hercules-02fcaed6bd32b0ffbc4f03b8f9de6f0720e6253f.zip
Whitespace cleanup (no code changes)
This includes, and is not limited to: mixed or wrong indentation, excess whitespace (horizontal and vertical), misalignment, trailing spaces. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/common/db.c')
-rw-r--r--src/common/db.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/common/db.c b/src/common/db.c
index b227d66bc..044df19aa 100644
--- a/src/common/db.c
+++ b/src/common/db.c
@@ -579,7 +579,7 @@ static void db_rebalance_erase(DBNode *node, DBNode **root)
x = x_parent;
x_parent = x_parent->parent;
} else {
- if (w->right == NULL || w->right->color == BLACK) {
+ if (w->right == NULL || w->right->color == BLACK) {
if (w->left) w->left->color = BLACK;
w->color = RED;
db_rotate_right(w, root);
@@ -1231,7 +1231,7 @@ static void db_release_both(DBKey key, DBData data, DBRelease which)
DBData* dbit_obj_first(DBIterator* self, DBKey* out_key)
{
DBIterator_impl* it = (DBIterator_impl*)self;
-
+
DB_COUNTSTAT(dbit_first);
// position before the first entry
it->ht_index = -1;
@@ -1253,7 +1253,7 @@ DBData* dbit_obj_first(DBIterator* self, DBKey* out_key)
DBData* dbit_obj_last(DBIterator* self, DBKey* out_key)
{
DBIterator_impl* it = (DBIterator_impl*)self;
-
+
DB_COUNTSTAT(dbit_last);
// position after the last entry
it->ht_index = HASH_SIZE;
@@ -1375,7 +1375,6 @@ DBData* dbit_obj_prev(DBIterator* self, DBKey* out_key)
node = &fake;
}
-
while( node )
{// next node
if( node->left )
@@ -1662,17 +1661,17 @@ static unsigned int db_obj_vgetall(DBMap* self, DBData **buf, unsigned int max,
}
va_end(argscopy);
}
-
+
if (node->left) {
node = node->left;
continue;
}
-
+
if (node->right) {
node = node->right;
continue;
}
-
+
while (node) {
parent = node->parent;
if (parent && parent->right && parent->left == node) {
@@ -1859,7 +1858,7 @@ static DBData* db_obj_ensure(DBMap* self, DBKey key, DBCreateData create, ...)
* @see #db_malloc_dbn(void)
* @see DBMap#put
* FIXME: If this method fails shouldn't it return another value?
- * Other functions rely on this to know if they were able to put something [Panikon]
+ * Other functions rely on this to know if they were able to put something [Panikon]
*/
static int db_obj_put(DBMap* self, DBKey key, DBData data, DBData *out_data)
{
@@ -1981,7 +1980,7 @@ static int db_obj_remove(DBMap* self, DBKey key, DBData *out_data)
db->alloc_file, db->alloc_line);
return 0; // nullpo candidate
}
- if (!(db->options&DB_OPT_ALLOW_NULL_KEY) && db_is_key_null(db->type, key)) {
+ if (!(db->options&DB_OPT_ALLOW_NULL_KEY) && db_is_key_null(db->type, key)) {
ShowError("db_remove: Attempted to use non-allowed NULL key for db allocated at %s:%d\n",db->alloc_file, db->alloc_line);
return 0; // nullpo candidate
}
@@ -2645,7 +2644,7 @@ DBKey db_str2key(const char *key)
DBKey db_i642key(int64 key)
{
DBKey ret;
-
+
DB_COUNTSTAT(db_i642key);
ret.i64 = key;
return ret;
@@ -2660,7 +2659,7 @@ DBKey db_i642key(int64 key)
DBKey db_ui642key(uint64 key)
{
DBKey ret;
-
+
DB_COUNTSTAT(db_ui642key);
ret.ui64 = key;
return ret;