summaryrefslogtreecommitdiff
path: root/editcap.c
diff options
context:
space:
mode:
Diffstat (limited to 'editcap.c')
-rw-r--r--editcap.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/editcap.c b/editcap.c
index 7e3d3e3137..f94357b9a9 100644
--- a/editcap.c
+++ b/editcap.c
@@ -841,14 +841,17 @@ list_encap_types(void) {
g_free(encaps);
}
-/* TODO: is there the equivalent of g_direct_equal? */
static int
-framenum_equal(gconstpointer a, gconstpointer b, gpointer user_data _U_)
+framenum_compare(gconstpointer a, gconstpointer b, gpointer user_data _U_)
{
- return (a != b);
-}
+ if (GPOINTER_TO_UINT(a) < GPOINTER_TO_UINT(b))
+ return -1;
+ if (GPOINTER_TO_UINT(a) > GPOINTER_TO_UINT(b))
+ return 1;
+ return 0;
+}
#ifdef HAVE_PLUGINS
/*
@@ -1019,7 +1022,7 @@ main(int argc, char *argv[])
/* Lazily create the table */
if (!frames_user_comments) {
- frames_user_comments = g_tree_new_full(framenum_equal, NULL, NULL, g_free);
+ frames_user_comments = g_tree_new_full(framenum_compare, NULL, NULL, g_free);
}
/* Insert this entry (framenum -> comment) */