> > > Uncaught exception - load.c(426) : Invalid module : Nekoml/Main
> >
> > I just fixed most of the warnings (except the main.c one : any
suggestion
> > ?).
>
> p.args = (char const**)argv + 1;
>
> just a constness thing I guess: argv should really be
> 'const char **argv' but isn't for historical reasons.

Ok. I tried without const but still got a warning when I was compiling on
linux. Will do that way.

> > This error must be some problem with read_long function on 64bit.
> > Should be easy to fix. Can you do some print/debug in order to give me
more
> > informations ?
>
> (Aside: in:
>
> static value default_loadmodule( value mname, value this ) {
>
> please don't use 'this' as an identifier, its a C++ keyword)

Oops :) fixed.

> Anyhow do these numbers work?
>
> static void read_long( reader r, readp p, int_val *i ) {
> unsigned char c[4];
> int n;
>   printf("sizeof(value)=%d\n",sizeof(value));
>   printf("sizeof(int_val)=%d\n",sizeof(int_val));
>   printf("sizeof(int)=%d\n",sizeof(int));
>   printf("sizeof(val_type)=%d\n",sizeof(val_type));
>   printf("sizeof(struct _value)=%d\n",sizeof(struct _value));
>
> r(p,c,4);
> n = c[0] | (c[1] << 8) | (c[2] << 16) | (c[3] << 24);
> *i = LONG_TO_LE(n);
> }
>
> (cd src && LD_LIBRARY_PATH=../bin NEKOPATH=../boot ../bin/nekovm
> Nekoml/Main Neko/Main.nml Nekoml/Main.nml)
> sizeof(value)=8
> sizeof(int_val)=8
> sizeof(int)=4
> sizeof(val_type)=4
> sizeof(struct _value)=4
> Uncaught exception - load.c(431) : Invalid module : Nekoml/Main

Yes it should work.
But I changed int_val* parameter to unsigned int* since it was wrong.
The first LONG readed should be the magic number 0x4F4B454E ( NEKO )
Maybe some byte ordering problem ?

Nicolas

---
Neko : One VM to run them all

Reply via email to