From fac0211221d70b94c0301f977e8a6ba429d79ef8 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 11 Mar 2011 16:05:12 -0800 Subject: use unsigned values for all counters We can't have negative values --- ext/raindrops/linux_inet_diag.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ext/raindrops/linux_inet_diag.c') diff --git a/ext/raindrops/linux_inet_diag.c b/ext/raindrops/linux_inet_diag.c index b219b5a..18f5ce8 100644 --- a/ext/raindrops/linux_inet_diag.c +++ b/ext/raindrops/linux_inet_diag.c @@ -52,8 +52,8 @@ static unsigned g_seq; static VALUE cListenStats; struct listen_stats { - long active; - long queued; + unsigned long active; + unsigned long queued; }; #define OPLEN (sizeof(struct inet_diag_bc_op) + \ @@ -69,8 +69,8 @@ struct nogvl_args { static VALUE rb_listen_stats(struct listen_stats *stats) { VALUE rv = rb_struct_alloc_noinit(cListenStats); - VALUE active = LONG2NUM(stats->active); - VALUE queued = LONG2NUM(stats->queued); + VALUE active = ULONG2NUM(stats->active); + VALUE queued = ULONG2NUM(stats->queued); #ifdef RSTRUCT_PTR VALUE *ptr = RSTRUCT_PTR(rv); -- cgit v1.2.3-24-ge0c7