summaryrefslogtreecommitdiff
path: root/src/analysis/db
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-09-29 22:09:15 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-09-29 22:09:15 (GMT)
commit46435809beb6b79a9a213c352014323f14a881a7 (patch)
treed1eee0b738aaeeaa869bfaa1e03504bccdfdb961 /src/analysis/db
parentc434b8ccaae01810903e098ad8e66f8ead3141eb (diff)
Cleaned code.
Diffstat (limited to 'src/analysis/db')
-rw-r--r--src/analysis/db/collection.c9
-rw-r--r--src/analysis/db/collection.h9
2 files changed, 4 insertions, 14 deletions
diff --git a/src/analysis/db/collection.c b/src/analysis/db/collection.c
index ce2d580..da48d3a 100644
--- a/src/analysis/db/collection.c
+++ b/src/analysis/db/collection.c
@@ -673,7 +673,6 @@ static void g_db_collection_set_last_item(GDbCollection *collec, GDbItem *item,
* *
* Paramètres : collec = ensemble d'éléments à considérer. *
* item = élément de collection à manipuler. *
-* lock = indique si le verrou d'écriture doit être posé. *
* *
* Description : Procède à l'ajout d'un nouvel élément dans la collection. *
* *
@@ -683,14 +682,13 @@ static void g_db_collection_set_last_item(GDbCollection *collec, GDbItem *item,
* *
******************************************************************************/
-bool _g_db_collection_add_item(GDbCollection *collec, GDbItem *item, bool lock)
+bool g_db_collection_add_item(GDbCollection *collec, GDbItem *item)
{
bool result; /* Bilan à faire remonter */
result = true;
- if (lock)
- g_db_collection_wlock(collec);
+ g_db_collection_wlock(collec);
collec->items = realloc(collec->items, ++collec->count * sizeof(GDbItem *));
collec->items[collec->count - 1] = item;
@@ -699,8 +697,7 @@ bool _g_db_collection_add_item(GDbCollection *collec, GDbItem *item, bool lock)
g_signal_emit_by_name(collec, "content-extended", item);
- if (lock)
- g_db_collection_wunlock(collec);
+ g_db_collection_wunlock(collec);
return result;
diff --git a/src/analysis/db/collection.h b/src/analysis/db/collection.h
index 1822a36..5c62aef 100644
--- a/src/analysis/db/collection.h
+++ b/src/analysis/db/collection.h
@@ -96,7 +96,7 @@ void g_db_collection_lock_unlock(GDbCollection *, bool, bool);
GDbItem **g_db_collection_get_items(const GDbCollection *, size_t *);
/* Procède à l'ajout d'un nouvel élément dans la collection. */
-bool _g_db_collection_add_item(GDbCollection *, GDbItem *, bool);
+bool g_db_collection_add_item(GDbCollection *, GDbItem *);
/* Procède au retrait des éléments désactivés de la collection. */
bool g_db_collection_drop_disabled_items(GDbCollection *, packed_buffer *);
@@ -112,13 +112,6 @@ bool g_db_collection_update_item_state(GDbCollection *, const GDbItem *);
-
-
-#define g_db_collection_add_item(c, i) _g_db_collection_add_item(c, i, true)
-//#define g_db_collection_remove_item(c, i) _g_db_collection_remove_item(c, i, true, true)
-
-
-
/* --------------------- MANIPULATIONS AVEC UNE BASE DE DONNEES --------------------- */