Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 May 2008 16:02:23 -0500 (CDT)
From:      David Duchscher <daved@tamu.edu>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/123313: Patch that fixes ruby-pcap module fixnums warnings
Message-ID:  <200805012102.m41L2N2x058495@evan-mosh-nat-1.net.tamu.edu>
Resent-Message-ID: <200805012130.m41LU1vi085308@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         123313
>Category:       ports
>Synopsis:       Patch that fixes ruby-pcap module fixnums warnings
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 01 21:30:00 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     David Duchscher
>Release:        FreeBSD 7.0-RELEASE-p1 i386
>Organization:
Texas A&M University
>Environment:
System: FreeBSD evan-mosh-nat-1.net.tamu.edu 7.0-RELEASE-p1 FreeBSD 7.0-RELEASE-p1 #1: Mon Apr 28 13:51:15 CDT 2008 root@evan-mosh-nat-1.net.tamu.edu:/usr/obj/usr/src/sys/GENERIC i386

>Description:

	Module issues the following warnings everytime it is loaded:

	  /usr/local/lib/ruby/site_ruby/1.8/i386-freebsd7/pcap.so: warning: do not use Fixnums as Symbols
	  /usr/local/lib/ruby/site_ruby/1.8/i386-freebsd7/pcap.so: warning: do not use Fixnums as Symbols
	  /usr/local/lib/ruby/site_ruby/1.8/i386-freebsd7/pcap.so: warning: do not use Fixnums as Symbols

>How-To-Repeat:

	Load module in ruby script.

	  require 'pcaplet'

>Fix:

--- patch-Pcap.c begins here ---
--- Pcap.c.orig	2008-05-01 15:26:25.000000000 -0500
+++ Pcap.c	2008-05-01 15:27:21.000000000 -0500
@@ -782,9 +782,9 @@
     /* define class PcapStat */
     cPcapStat = rb_funcall(rb_cStruct, rb_intern("new"), 4,
 			   Qnil,
-			   INT2NUM(rb_intern("recv")),
-			   INT2NUM(rb_intern("drop")),
-			   INT2NUM(rb_intern("ifdrop")));
+			   ID2SYM(rb_intern("recv")),
+			   ID2SYM(rb_intern("drop")),
+			   ID2SYM(rb_intern("ifdrop")));
     rb_define_const(mPcap, "Stat", cPcapStat);
 
     /* define exception classes */
--- patch-Pcap.c ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200805012102.m41L2N2x058495>