Re: Problems with C floats

new topic     » goto parent     » topic index » view thread      » older message » newer message
irv said...

Are there known bugs when passing Eu values to C_FLOAT ? I have several routines in EuGTK which worked fine with Eu 3, but no longer work properly now with 4.0. Each of these routines has one thing in common, they pass floats to c_func or c_proc.

I don't think so. Can you post some more details? I did this test:

// irv.c 
// build with: $ gcc -shared -fPIC -ldl irv.c -o irv.so 
#include <stdio.h> 
 
void test_float( double foo, float bar ){ 
	printf( "double: %f\nfloat: %f\n", foo, bar ); 
} 
 

...and then called it using:

-- irv.ex 
include std/dll.e 
 
constant 
	irv = open_dll( "./irv.so" ), 
	test_float = define_c_proc( irv, "test_float", {C_DOUBLE, C_FLOAT}) 
 
c_proc( test_float, { 0.25, 0.75}) 

Then I get:

$ eui irv 
double: 0.250000 
float: 0.750000 

So it looks good to me.

Matt

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu