Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ulong to long for object ids

  • Loading branch information...
commit ed81d65b8134f435179949099b859b1496e9850c 1 parent 9c1156e
shawn anderson authored
View
16 Rakefile
@@ -20,11 +20,15 @@ rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
end
-require 'spec/rake/spectask'
-desc "Run all rspecs"
-Spec::Rake::SpecTask.new(:spec) do |t|
- t.spec_files = FileList['spec/*_spec.rb']
-end
-task :default => :spec
+begin
+ require 'spec/rake/spectask'
+ desc "Run all rspecs"
+ Spec::Rake::SpecTask.new(:spec) do |t|
+ t.spec_files = FileList['spec/*_spec.rb']
+ end
+ task :default => :spec
+rescue LoadError
+ puts "Rspec (or a dependency) not available. Install it with: sudo gem install rspec"
+end
# vim: syntax=Ruby
View
15 chipmunk-ffi.gemspec
@@ -1,6 +1,6 @@
# Generated by jeweler
-# DO NOT EDIT THIS FILE
-# Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
+# DO NOT EDIT THIS FILE DIRECTLY
+# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Shawn Anderson"]
- s.date = %q{2009-12-17}
+ s.date = %q{2009-12-18}
s.description = %q{FFI bindings for chipmunk physics lib.}
s.email = %q{shawn42@gmail.com}
s.extra_rdoc_files = [
@@ -53,14 +53,14 @@ Gem::Specification.new do |s|
s.rubygems_version = %q{1.3.5}
s.summary = %q{FFI bindings for chipmunk physics lib.}
s.test_files = [
- "spec/bb_spec.rb",
+ "spec/shape_spec.rb",
"spec/body_spec.rb",
+ "spec/bb_spec.rb",
"spec/constraint_spec.rb",
"spec/core_spec.rb",
- "spec/shape_spec.rb",
"spec/space_spec.rb",
- "spec/spec_helper.rb",
- "spec/vec2_spec.rb"
+ "spec/vec2_spec.rb",
+ "spec/spec_helper.rb"
]
if s.respond_to? :specification_version then
@@ -85,3 +85,4 @@ Gem::Specification.new do |s|
s.add_dependency(%q<jeweler>, [">= 0"])
end
end
+
View
4 lib/chipmunk-ffi/shape.rb
@@ -125,8 +125,8 @@ def surface_v=(new_sv)
end
def set_data_pointer
- mem = FFI::MemoryPointer.new(:ulong)
- mem.put_ulong 0, object_id
+ mem = FFI::MemoryPointer.new(:long)
+ mem.put_long 0, object_id
# this is needed to prevent data corruption by GC
@shape_pointer = mem
@struct.data = mem
View
8 lib/chipmunk-ffi/space.rb
@@ -133,11 +133,11 @@ def add_collision_func(a,b,&block)
arbb = swapped ? arb.a : arb.b
as = ShapeStruct.new(arba)
- a_obj_id = as.data.get_ulong 0
+ a_obj_id = as.data.get_long 0
rb_a = ObjectSpace._id2ref a_obj_id
bs = ShapeStruct.new(arbb)
- b_obj_id = bs.data.get_ulong 0
+ b_obj_id = bs.data.get_long 0
rb_b = ObjectSpace._id2ref b_obj_id
block.call rb_a, rb_b
@@ -187,11 +187,11 @@ def wrap_collision_callback(a,b,type,handler)
arbb = swapped ? arb.a : arb.b
as = ShapeStruct.new(arba)
- a_obj_id = as.data.get_ulong 0
+ a_obj_id = as.data.get_long 0
rb_a = ObjectSpace._id2ref a_obj_id
bs = ShapeStruct.new(arbb)
- b_obj_id = bs.data.get_ulong 0
+ b_obj_id = bs.data.get_long 0
rb_b = ObjectSpace._id2ref b_obj_id
ret = handler.send type, rb_a, rb_b
Please sign in to comment.
Something went wrong with that request. Please try again.