Re: Problems with C floats
- Posted by jimcbrown (admin) Jan 31, 2010
- 2343 views
irv said...
Your tests work. This is a different problem - many GTK routines return 2 or more values, as follows:
void gtk_window_get_default_size (GtkWindow *window, gint *width, gint *height);By allocating variables and passing them to the routine, they get filled in with the current values. This works fine as long as the vars are integers, pointers, or doubles, but when they are floats, I get an machine exception. I tried using safe.e, but can't see anything there to help. Perhaps this is related to the previous problem when passing floats to a c routine?
You know, it'd help a lot if you posted example code demonstrating the bug...
Anyways, I updated the tests here:
http://malcom.unkmar.com/lostsouls/irv3.c http://malcom.unkmar.com/lostsouls/irv3.ex http://malcom.unkmar.com/lostsouls/irv3.so
And I get the expected results. So this looks like it works fine, or at least I can't reproduce the issue...