Skip to content

Commit

Permalink
libev: fix compare and hash functions
Browse files Browse the repository at this point in the history
Fixes #146.
  • Loading branch information
aantron committed Jul 2, 2016
1 parent b6aa378 commit 816022d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/unix/lwt_libev_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@

static int compare_loops(value a, value b)
{
return (int)(Data_custom_val(a) - Data_custom_val(b));
return (int)((char*)Ev_loop_val(a) - (char*)Ev_loop_val(b));
}

static long hash_loop(value loop)
{
return (long)Data_custom_val(loop);
return (long)Ev_loop_val(loop);
}

static struct custom_operations loop_ops = {
Expand Down Expand Up @@ -114,12 +114,12 @@ CAMLprim value lwt_libev_unloop(value loop)

static int compare_watchers(value a, value b)
{
return (int)(Data_custom_val(a) - Data_custom_val(b));
return (int)((char*)Ev_io_val(a) - (char*)Ev_io_val(b));
}

static long hash_watcher(value watcher)
{
return (long)Data_custom_val(watcher);
return (long)Ev_io_val(watcher);
}

static struct custom_operations watcher_ops = {
Expand Down

0 comments on commit 816022d

Please sign in to comment.