Re: Oddities in pipeio
- Posted by AlexXX Feb 15, 2021
- 914 views
In Phix, pipeio. e doesn't want to work relentlessly:
global integer address_length -- address length for pointers -- * 4 on 32-bit OSes -- * 8 on 64-bit OSes --</desc> --</variable> address_length = 4 global procedure poke_pointer(atom addr, object x) --<procedure> --<name>poke_pointer</name> --<digest>put a 4 byte pointer in memory</digest> --<desc> --</desc> --<param> --<type>atom</type> --<name>addr</name> --<desc></desc> --</param> --<param> --<type>object</type> --<name>x</name> --<desc></desc> --</param> --<return> --</return> --<example> -- poke_pointer(addr, allocate_string("where?")) --</example> --<see_also>peek_pointer()</see_also> --</procedure> if addr <= 0 then printf(1,"poke_pointer: bad pointer %d\n", addr) end if poke4(addr, x) end procedure -------------------------------------------------------------------------------- global function peek_pointer(object addr) --<function> --<name>peek_pointer</name> --<digest>read a 4 byte pointer in memory</digest> --<desc> --</desc> --<param> --<type>object</type> --<name>addr</name> --<desc></desc> --</param> --<return> --</return> --<example> -- addr2 = allocate_string("where?") -- ? addr2 -- poke_pointer(addr, addr2) -- ? peek_pointer(addr) --> same as addr2 --</example> --<see_also>poke_pointer()</see_also> --</function> if atom(addr) and (addr <= 0) then printf(1,"peek_pointer: bad pointer %d\n", addr) end if if sequence(addr) and (addr[1] <= 0) then printf(1,"peek_pointer: bad pointer %d\n", addr[1]) end if return peek4u(addr) end function global function size_of( atom ctype ) if ctype = #03000001 then return address_length elsif ctype = #03000002 then -- T_LONGLONG return 8 else return and_bits( ctype, #FF ) end if end function
And for some reason, after the shutdown, a Phix error comes out, which I do not understand
f:\phix\pmsgs.e:337 in procedure Warnings() attempt to divide by 0 fn = 1 wi = {``,0,{`procedure error is not used.`,`F:\phix\out\pipeio.e`,311}} buttons = {`Next`,`&Skip remainder`,0} witxt = "Warning: F:\\phix\\out\\pipeio.e:311 procedure error is not used.\n" fn1 = 1 r = <novalue> i = 0 ... called from f:\phix\p.exw:2528 in function main() savepath = `f:\phix\out` outfile = <novalue> CSvaddr4 = 2826282 ebp4 = 150825 esp4 = 114673 pst4 = 1058085 ntcb4 = <novalue> wasEBP = 0 pi = <novalue> dfn = <novalue> i = <novalue> i = <novalue> paramstr = <novalue> i = <novalue> ... called from f:\phix\p.exw:2853
The ex. err file is very large, I sent it to Pete