tupalo-kdtree 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/ext/kdtree.c +7 -7
- data/test/test.rb +1 -1
- metadata +26 -38
data/ext/kdtree.c
CHANGED
@@ -78,7 +78,7 @@ static void kdtree_free(struct kdtree_data *kdtreep)
|
|
78
78
|
}
|
79
79
|
}
|
80
80
|
|
81
|
-
static void read_all(
|
81
|
+
static void read_all(rb_io_t *fptr, char *buf, int len)
|
82
82
|
{
|
83
83
|
while (len > 0) {
|
84
84
|
int n = rb_io_fread(buf, len, rb_io_stdio_file (fptr));
|
@@ -125,15 +125,14 @@ static VALUE kdtree_initialize(VALUE kdtree, VALUE arg)
|
|
125
125
|
for (i = 0; i < RARRAY_LEN(points); ++i) {
|
126
126
|
struct kdtree_node *n = kdtreep->nodes + i;
|
127
127
|
|
128
|
-
VALUE ptr =
|
128
|
+
VALUE ptr = rb_ary_entry(points, i);
|
129
129
|
VALUE v = rb_check_array_type(ptr);
|
130
130
|
if (NIL_P(v) || RARRAY_LEN(v) != 3) {
|
131
131
|
continue;
|
132
132
|
}
|
133
|
-
|
134
|
-
n->
|
135
|
-
n->
|
136
|
-
n->id = NUM2INT(a[2]);
|
133
|
+
n->x = NUM2DBL(rb_ary_entry(v, 0));
|
134
|
+
n->y = NUM2DBL(rb_ary_entry(v, 1));
|
135
|
+
n->id = NUM2INT(rb_ary_entry(v, 2));
|
137
136
|
}
|
138
137
|
|
139
138
|
// now build the tree
|
@@ -144,7 +143,8 @@ static VALUE kdtree_initialize(VALUE kdtree, VALUE arg)
|
|
144
143
|
rb_funcall2(io, rb_intern("binmode"), 0, 0);
|
145
144
|
}
|
146
145
|
|
147
|
-
|
146
|
+
rb_io_t *fptr;
|
147
|
+
GetOpenFile(rb_io_taint_check(io), fptr);
|
148
148
|
rb_io_check_readable(fptr);
|
149
149
|
|
150
150
|
// check magic
|
data/test/test.rb
CHANGED
metadata
CHANGED
@@ -1,66 +1,54 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: tupalo-kdtree
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 2
|
8
|
-
- 2
|
9
|
-
version: 0.2.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.3
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- Adam Doppelt
|
13
9
|
- Andreas Fuchs
|
10
|
+
- evanphx
|
14
11
|
autorequire:
|
15
12
|
bindir: bin
|
16
13
|
cert_chain: []
|
17
|
-
|
18
|
-
date: 2010-11-23 00:00:00 +01:00
|
19
|
-
default_executable:
|
14
|
+
date: 2010-11-23 00:00:00.000000000Z
|
20
15
|
dependencies: []
|
21
|
-
|
22
16
|
description: Tupalo-kdtree is a thread-safe fork of the kdtree Gem by Adam Doppelt.
|
23
17
|
email: developers@tupalo.com
|
24
18
|
executables: []
|
25
|
-
|
26
|
-
extensions:
|
19
|
+
extensions:
|
27
20
|
- ext/extconf.rb
|
28
|
-
extra_rdoc_files:
|
21
|
+
extra_rdoc_files:
|
29
22
|
- LICENSE
|
30
|
-
files:
|
23
|
+
files:
|
31
24
|
- LICENSE
|
32
25
|
- ext/extconf.rb
|
33
26
|
- ext/kdtree.c
|
34
27
|
- test/test.rb
|
35
|
-
has_rdoc: true
|
36
28
|
homepage: http://github.com/consti/tupalo-kdtree
|
37
29
|
licenses: []
|
38
|
-
|
39
30
|
post_install_message:
|
40
|
-
rdoc_options:
|
31
|
+
rdoc_options:
|
41
32
|
- --charset=UTF-8
|
42
|
-
require_paths:
|
33
|
+
require_paths:
|
43
34
|
- lib
|
44
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
requirements:
|
53
|
-
- -
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
|
56
|
-
- 0
|
57
|
-
version: "0"
|
35
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
36
|
+
none: false
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ! '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
58
47
|
requirements: []
|
59
|
-
|
60
48
|
rubyforge_project:
|
61
|
-
rubygems_version: 1.
|
49
|
+
rubygems_version: 1.8.6
|
62
50
|
signing_key:
|
63
51
|
specification_version: 2
|
64
52
|
summary: Tupalo-kdtree is a thread-safe fork of the kdtree Gem by Adam Doppelt.
|
65
|
-
test_files:
|
53
|
+
test_files:
|
66
54
|
- test/test.rb
|