summaryrefslogtreecommitdiff
path: root/src/analysis/db
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-10-15 12:12:15 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-10-15 12:12:15 (GMT)
commit4c5f0e1341b094fed40f9e6944134545f971b1eb (patch)
tree2a9e85f11c480410a336a2efc5c10cc3241c0434 /src/analysis/db
parent00aab2fbd9d7d3d36890fda60029cad54ea589a4 (diff)
Built proper comments for all the Dalvik switch cases.
Diffstat (limited to 'src/analysis/db')
-rw-r--r--src/analysis/db/item.c14
-rw-r--r--src/analysis/db/item.h2
2 files changed, 9 insertions, 7 deletions
diff --git a/src/analysis/db/item.c b/src/analysis/db/item.c
index 62e8ce9..243e97b 100644
--- a/src/analysis/db/item.c
+++ b/src/analysis/db/item.c
@@ -241,7 +241,7 @@ gint g_db_item_cmp(GDbItem *a, GDbItem *b, bool with)
result = cmp_timestamp(&a->created, &b->created);
if (result == 0)
- result = strcmp(a->label, b->label);
+ result = strcmp(g_db_item_get_label(a), g_db_item_get_label(b));
return result;
@@ -343,8 +343,6 @@ bool g_db_item_recv(GDbItem *item, int fd, int flags)
result = G_DB_ITEM_GET_CLASS(item)->recv(item, fd, flags);
- G_DB_ITEM_GET_CLASS(item)->build_label(item);
-
return result;
}
@@ -470,8 +468,14 @@ bool g_db_item_cancel(GDbItem *item, GLoadedBinary *binary)
* *
******************************************************************************/
-const char *g_db_item_get_label(const GDbItem *item)
+const char *g_db_item_get_label(GDbItem *item)
{
+ if (item->label == NULL)
+ {
+ G_DB_ITEM_GET_CLASS(item)->build_label(item);
+ assert(item->label != NULL);
+ }
+
return item->label;
}
@@ -721,8 +725,6 @@ bool g_db_item_load(GDbItem *item, const bound_value *values, size_t count)
result = G_DB_ITEM_GET_CLASS(item)->load(item, values, count);
- G_DB_ITEM_GET_CLASS(item)->build_label(item);
-
return result;
}
diff --git a/src/analysis/db/item.h b/src/analysis/db/item.h
index f8bb707..afeaed3 100644
--- a/src/analysis/db/item.h
+++ b/src/analysis/db/item.h
@@ -85,7 +85,7 @@ bool g_db_item_apply(GDbItem *, GLoadedBinary *);
bool g_db_item_cancel(GDbItem *, GLoadedBinary *);
/* Décrit l'élément de collection en place. */
-const char *g_db_item_get_label(const GDbItem *);
+const char *g_db_item_get_label(GDbItem *);
/* Fournit l'horodatage associé à l'élément de collection. */
timestamp_t g_db_item_get_timestamp(const GDbItem *);