1. Eu 2.4, c funcs and ExoticaX

I've got a new version of the Perlin Noise Library coded
(v0.5.1) which has had major rewrites done. However, for the 
demo's that need to use ExoticaX, it works with Eu2.3 but not 
Eu2.4, below is the error.

My question is, how do I fix the c func calling routines to 
work with Eu2.4??

Cheers,
Dan

Z:\My Documents\PNL\PNL-v0.5.0\dll.e:48 in function 
define_c_proc()
Invalid argument type
... called from Z:\My Documents\PNL\PNL-v0.5.0
\DirectX\exotica_api.ew:713 in fun
ction link_c_proc2()
... called from Z:\My Documents\PNL\PNL-v0.5.0
\DirectX\exotica_api.ew:736 in pro
cedure link_exotica_dll_routines()
... called from Z:\My Documents\PNL\PNL-v0.5.0
\DirectX\exotica_api.ew:1105
--> see ex.err

new topic     » topic index » view message » categorize

2. Re: Eu 2.4, c funcs and ExoticaX

dm31 at uow.edu.au wrote:
> I've got a new version of the Perlin Noise Library coded
> (v0.5.1) which has had major rewrites done. However, for the 
> demo's that need to use ExoticaX, it works with Eu2.3 but not 
> Eu2.4, below is the error.
> 
> My question is, how do I fix the c func calling routines to 
> work with Eu2.4??
> 
> Cheers,
> Dan
> 
> Z:\My Documents\PNL\PNL-v0.5.0\dll.e:48 in function 
> define_c_proc()
> Invalid argument type
> ... called from Z:\My Documents\PNL\PNL-v0.5.0
> \DirectX\exotica_api.ew:713 in fun
> ction link_c_proc2()
> ... called from Z:\My Documents\PNL\PNL-v0.5.0
> \DirectX\exotica_api.ew:736 in pro
> cedure link_exotica_dll_routines()
> ... called from Z:\My Documents\PNL\PNL-v0.5.0
> \DirectX\exotica_api.ew:1105
> --> see ex.err

In 2.4, define_c_proc() and define_c_func() check
the argument types (and return type) that you specify
to ensure that they belong to the set of C_ or E_ constants
defined in dll.e. 2.3 quietly accepted any value as an
argument type, with possible incorrect results when
you actually called the C routine.

I don't have exotica_api.ew in front of me,
but if you have no idea about the correct argument types
for the C function, try replacing any bogus type values,
i.e. ones that are not in the range C_CHAR ... C_DOUBLE,
with (say) C_INT. Maybe someone with the code will have
a better idea.

Regards,
    Rob Craig
    Rapid Deployment Software
    http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

3. Re: Eu 2.4, c funcs and ExoticaX

dm31 at uow.edu.au wrote:
> These are the first the first two lines causing problems
> (note, if I comment a line out the very next one comes up, 
> for all the api it seems, even exotica works)
> 
> WINVER = link_c_func2(edx, "WINDOWS_VERSION",{NULL},C_UINT)
> REPORT_MODE = link_c_proc2(edx, "REPORT_MODE", {C_POINTER, 
> C_INT})

NULL is defined as 0 in dll.e, and it is *not*
a valid argument type. I suspect what the author
meant to say here was:

WINVER = link_c_func2(edx, "WINDOWS_VERSION", {}, C_UINT)

i.e. that the C function WINDOWS_VERSION takes no arguments
and returns a C_UINT as a result.

Later in the code, when he calls WINDOWS_VERSION,
he probably passes it a dummy argument. You'll have to
remove that dummy argument from each call to WINDOWS_VERSION.

I guess the author just didn't realize that he should
define a function of no arguments by using {} rather than {NULL}.
Apparently this worked without crashing, so he didn't
have to correct it in 2.3.

Regards,
    Rob Craig
    Rapid Deployment Software
    http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

4. Re: Eu 2.4, c funcs and ExoticaX

Thank you!
Hopefully I should be able to fix it now

>NULL is defined as 0 in dll.e, and it is *not*
>a valid argument type. I suspect what the author
>meant to say here was:
>
>WINVER = link_c_func2(edx, "WINDOWS_VERSION", {}, C_UINT)
>
>i.e. that the C function WINDOWS_VERSION takes no arguments
>and returns a C_UINT as a result.
>
>Later in the code, when he calls WINDOWS_VERSION,
>he probably passes it a dummy argument. You'll have to
>remove that dummy argument from each call to WINDOWS_VERSION.
>
>I guess the author just didn't realize that he should
>define a function of no arguments by using {} rather than 
{NULL}.
>Apparently this worked without crashing, so he didn't
>have to correct it in 2.3.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu