FreeBasic IDE-poseidonFB(Update 2022.07.03)

User projects written in or related to FreeBASIC.
Post Reply
UEZ
Posts: 846
Joined: May 05, 2017 19:59
Location: Germany

Re: FreeBasic IDE-poseidonFB(Update 2022.07.03)

Post by UEZ »

Hi Kuan Hsu,

folding (contracting) for this function doesn't work properly.

Code: Select all

Private Function lzfx_decompress(Byval ibuf As Ubyte Ptr , Byval ilen As UInteger , Byval obuf As Ubyte Ptr , Byref olen As UInteger) As Long
    Dim As Ubyte Ptr ip = ibuf
    Dim As Ubyte Ptr in_end = ip + ilen
    Dim As Ubyte Ptr op = obuf
    Dim As Ubyte Ptr out_end = op + olen
    Dim As UInteger remain_len = 0
    Dim As Long rc

    If(olen = 0) Then Return LZFX_EARGS
    If(ibuf = NULL) Then
        If(ilen <> 0) Then Return LZFX_EARGS
        olen = 0
        Return 0
    End If
    If(obuf = NULL)Then
        If(olen <> 0) Then Return LZFX_EARGS
        Return lzfx_getsize(ibuf, ilen, olen)
    End If
    #Macro my_guess()   'used by lzfx_decompress (better than Gosub)
		rc = lzfx_getsize(ip, ilen - (ip-ibuf), remain_len)
		If rc>=0 Then olen = remain_len + (op - obuf)
		Return rc
	#Endmacro
    Do
        Dim As UInteger ctrl = *ip
        ip+=1
        /' Format 000LLLLL: a literal Byte String follows, of length L+1 '/
        If(ctrl < (1 Shl 5)) Then
            ctrl+=1
            If(op + ctrl > out_end) Then
               ip -=1      /' Rewind To control Byte '/
               my_guess()
            End If
            If(ip + ctrl > in_end) Then Return LZFX_ECORRUPT
            Do
               *op= *ip : op+=1 : ip+=1
               ctrl -= 1
            Loop While(ctrl <> 0)
            /'  Format 	#1 [LLLooooo oooooooo]: backref of length L+1+2
                            ^^^^^ ^^^^^^^^
                            A      B
                        #2 [111ooooo LLLLLLLL oooooooo] backref of length L+7+2
                            ^^^^^          ^^^^^^^^
                            A               B
               In both cases the location of the backref Is computed from the
               remaining part of the Data As follows:
                  location = op - A*256 - B - 1
            '/
        Else
            Dim As UInteger len1 = (ctrl Shr 5)
            Dim As Ubyte Ptr ref = op - ((ctrl And &h1f) Shl 8) -1
            If(len1=7) Then
               len1 += *ip
               ip+=1    /' i.e. Format #2 '/
            End If
            len1 += 2    /' Len Is Now #octets '/
            If(op + len1 > out_end)Then
               ip -= Iif(len1 >= 9, 2 , 1)   /' Rewind To control Byte '/
               my_guess()
            End If
            If(ip >= in_end) Then Return LZFX_ECORRUPT
            ref -=  *ip  : ip += 1
            If(ref < obuf) Then Return LZFX_ECORRUPT
            Do
               *op = *ref : op+= 1 : ref+=1
               len1 -=1
            Loop While (len1 <> 0 )
        End If
    Loop While (ip < in_end)
    olen = op - obuf
    Return 0
End Function
Any change to fix it?
Kuan Hsu
Posts: 565
Joined: Sep 16, 2007 15:12
Location: Taiwan

Re: FreeBasic IDE-poseidonFB(Update 2022.07.03)

Post by Kuan Hsu »

UEZ wrote: Jul 26, 2022 13:46 Hi Kuan Hsu,

folding (contracting) for this function doesn't work properly.
Any change to fix it?
Line #15 and #57, after right-paren, add a Space before Then
It needs modify LexBasic.cxx in scintilla sources, I'll check it :D
Kuan Hsu
Posts: 565
Joined: Sep 16, 2007 15:12
Location: Taiwan

Re: FreeBasic IDE-poseidonFB(Update 2022.07.03)

Post by Kuan Hsu »

UEZ wrote: Jul 26, 2022 13:46 Hi Kuan Hsu,

folding (contracting) for this function doesn't work properly.
Any change to fix it?
Please test this one: https://www.mediafire.com/file/mdvn76s6 ... la.7z/file
UEZ
Posts: 846
Joined: May 05, 2017 19:59
Location: Germany

Re: FreeBasic IDE-poseidonFB(Update 2022.07.03)

Post by UEZ »

Kuan Hsu wrote: Jul 28, 2022 12:45
UEZ wrote: Jul 26, 2022 13:46 Hi Kuan Hsu,

folding (contracting) for this function doesn't work properly.
Any change to fix it?
Please test this one: https://www.mediafire.com/file/mdvn76s6 ... la.7z/file
Looks good for this function. :)

Thx.
demosthenesk
Posts: 110
Joined: Jul 15, 2021 7:23
Location: Greece
Contact:

Re: FreeBasic IDE-poseidonFB(Update 2022.07.03)

Post by demosthenesk »

Debug is not working in Ubuntu Mate 20.04 AppImage and in Windows 11.

1) viewtopic.php?t=31851
I use Ubuntu Mate 20.04 and poseidonFB AppImage V0.499

*) i choose Debug->Build with debug
*) Debug->Run debug

The IDE freezes.

2) i use Windows 11 and poseidonFB V0.499

*) i choose Debug->Build with debug
*) Debug->Run debug

i get the gdb console but i cant input commands like break, list, print or i canot quit gdb with q
demosthenesk
Posts: 110
Joined: Jul 15, 2021 7:23
Location: Greece
Contact:

Re: FreeBasic IDE-poseidonFB(Update 2022.07.03)

Post by demosthenesk »

i have opened some issues on poseidon project but no response...
Is KuanHsu well ?
I wish all be well... :roll:
Post Reply