jtsiomb / kdtree

A simple C library for working with KD-Trees
http://nuclear.mutantstargoat.com/sw/kdtree/
Other
391 stars 115 forks source link

kd_res_item3(f) functions don't return node data #10

Closed GoogleCodeExporter closed 6 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. call kd_res_item or kd_res_item3 on valid result set
2. check return value

What is the expected output? What do you see instead?
Should return the data value of the node, returns 0

What version of the product are you using? On what operating system?
r32 from svn

Please provide any additional information below.
I attached a patch that fixes the issue.
Also, directly above there are checks like "if(*x)" -- if they are meant to
check for valid x, y, z pointers they should be "if(x)", otherwise the code
segfaults (if you pass in 0). Feel free to change that too. I didn't include it
in the patch since it's not relevant to the problem at hand, and I'm not sure 
whether
the current behaviour is intended.

Original issue reported on code.google.com by gattscha...@googlemail.com on 5 Apr 2014 at 9:42

Attachments: