From 816022d5f8712c68b7842994dcbba2bb7d7a752a Mon Sep 17 00:00:00 2001 From: Anton Bachin Date: Sat, 2 Jul 2016 09:11:52 -0500 Subject: [PATCH] libev: fix compare and hash functions Fixes #146. --- src/unix/lwt_libev_stubs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/unix/lwt_libev_stubs.c b/src/unix/lwt_libev_stubs.c index 66ccb4a957..cde1ce2ffb 100644 --- a/src/unix/lwt_libev_stubs.c +++ b/src/unix/lwt_libev_stubs.c @@ -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 = { @@ -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 = {