1. Difference between Eu4.0 and Eu3.1.1
- Posted by RStowasser Nov 29, 2008
- 1117 views
Hello Matt,
trying to explore the GTK library with Windows I found that I have to use the cdecl convention with call_back functions. But there is still a difference between Eu3.1.1 and Eu4.0 (rev 1234 which I expect to be the same as the alpha release). To show the problem I added a bug in window.exw of the demo folder and changed this in about line 148:
...
...
constant pointer=C_INT
global function WndProc(atom hwnd, atom iMsg, atom wParam, pointer lParam)
callback routine to handle Window class
...
...
if I run window.exw with exw.exe there is a flashing console and ex.err shows:
Fatal run-time error:
BAD IL OPCODE: i is 10, word is 3273 (max=131), len is 541344066
Running window.exw with exwc.exe shows:
C:\EUPHORIA\SOURCE40>exwc c:\EUPHORIA\demo40\win32\window.exw
Fatal run-time error:
BAD IL OPCODE: i is 10, word is 3273 (max=131), len is 541344066
The instruction at 0x0048f733 referenced memory at 0x00000004.
The memory could not be written.
Exception fielded by 0x0049ca60
EAX=0x00000008 EBX=0x00000001 ECX=0x770e5b87 EDX=0x00095440
ESI=0xffffffff EDI=0x00000000 EBP=0x0006f548 ESP=0x0006f548
EIP=0x0048f733 EFL=0x00010296 CS =0x0000001b SS =0x00000023
DS =0x00000023 ES =0x00000023 FS =0x0000003b GS =0x00000000
Stack dump (SS:ESP)
...
Running window.exw with eu.ex shows this result:
C:\EUPHORIA\SOURCE40>exwc eu.ex c:\EUPHORIA\demo40\win32\window.exw
.\execute.e:1132 in procedure opPROC()
subscript value 20 is out of bounds, reading from a sequence of length 15
... called from .\execute.e:3780 in procedure do_exec()
... called from .\execute.e:3184 in function general_callback()
... called from .\execute.e:3206 in function machine_callback()
^ call-back from Windows
... called from .\execute.e:3113 in procedure opC_FUNC()
... called from .\execute.e:3454 in procedure do_exec()
... called from .\execute.e:4046 in procedure Execute()
... called from .\execute.e:4054 in procedure BackEnd()
... called from .\mode.e:41 in procedure BackEnd()
... called from .\main.e:260 in procedure main()
... called from .\main.e:267
> See ex.err
Press Enter...
Running window.exw with Eu3.1.1 would show the expected result:
C:\EUPHORIA\DEMO\WIN32\window.exw:149
a type is expected here
global function WndProc(atom hwnd, atom iMsg, atom wParam, pointer lParam)
---------------------------------------------------------------------------------^
It is easier to catch bugs like this with Eu3.1.1 than with Eu 4.0
Roland
2. Re: Difference between Eu4.0 and Eu3.1.1
- Posted by mattlewis (admin) Nov 29, 2008
- 1120 views
Hello Matt,
trying to explore the GTK library with Windows I found that I have to use the cdecl convention with call_back functions. But there is still a difference between Eu3.1.1 and Eu4.0 (rev 1234 which I expect to be the same as the alpha release). To show the problem I added a bug in window.exw of the demo folder and changed this in about line 148:
...
...
constant pointer=C_INT global function WndProc(atom hwnd, atom iMsg, atom wParam, pointer lParam)\\ -- callback routine to handle Window class
...
...
That's really odd. I wouldn't expect that to work at all, since pointer isn't a type. Can you shorten it so that it just uses a callback?
Matt
3. Re: Difference between Eu4.0 and Eu3.1.1
- Posted by mattlewis (admin) Nov 29, 2008
- 1129 views
constant pointer=C_INT global function WndProc(atom hwnd, atom iMsg, atom wParam, pointer lParam)\\ -- callback routine to handle Window class
That's really odd. I wouldn't expect that to work at all, since pointer isn't a type. Can you shorten it so that it just uses a callback?
Ok, the problem was that it wasn't properly detecting the fact that the parameter wasn't a type. The callback was incidental. This is fixed in r1235.
Matt