Qbasicnews.com
Bug Reports - Printable Version

+- Qbasicnews.com (http://qbasicnews.com/newforum)
+-- Forum: General (http://qbasicnews.com/newforum/forum-6.html)
+--- Forum: General/Misc (http://qbasicnews.com/newforum/forum-18.html)
+--- Thread: Bug Reports (/thread-5202.html)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30


Bug Reports - VonGodric - 12-12-2004

sdl sdlvideo.bi file has a bug in sdl_Rect structure:
change it to:

Code:
type SDL_Rect
    x as short      'integer
    y as short      'integer
    w as ushort   'uinteger
    h as ushort    'uinteger
end type



Bug Reports - na_th_an - 12-29-2004

Found another one. fbc doesn't complain on this snippet but the assembler does:

Code:
Declare Sub DoFoo()

dim Shared WhichOne as short

WhichOne = 0

Sub DoFoo()
   WhichOne = 1 - WhichOne
End Sub

Error messages returned:

Code:
test.asm: Assembler messages:
test.asm:48: Warning: using `%ax' instead of `%eax' due to `w' suffix
test.asm:49: Error: suffix or operands invalid for `mov'



Bug Reports - v3cz0r - 12-30-2004

Fixed, will be on next rls, thanks.

Code:
[fixed] "imm op short var" was allocating the wrong register type, due an integer imm optimization at AST (v1c)



Bug Reports - na_th_an - 12-31-2004

Thanks Smile

I found another one. The compiler (or the assembler) seems to have trouble with long strings in long lines:

Code:
Declare Sub Pres (t$)

' Isolate error

CLS
PRINT "Test 1 :: Long string"

st$ = "FATHER: 'I won't listen to you if you don't convince me that I can be proud of you! Just like before you told me you didn't want to be a lumberjack!'@'Besides that... I can't find a decent log today!'"
PRINT "OUTSIDE THE SUB, THIS IS THE STRING :: "; st$
Pres st$

PRINT
PRINT "Test 2 :: Split String (this works)"

st$ = "FATHER: 'I won't listen to you if you don't convince me that "
st$ = st$ + "I can be proud of you! Just like before you told me you "
st$ = st$ + "didn't want to be a lumberjack!'@'Besides that... I can't "
st$ = st$ + "find a decent log today!'"
PRINT "OUTSIDE THE SUB, THIS IS THE STRING :: "; st$
Pres st$


SUB Pres (t$)
   PRINT "INSIDE THE SUB, I GOT THIS STRING :: ";t$
END SUB

The string "st$" resulting is trimmed in the first test whether by the compiler or the assembler.

I had to manually split like 200 lines with text in my text adventure Big Grin


Bug Reports - Ryan - 12-31-2004

heh That's tedious. It does work fine when the string is grabbed with line input, though, as I'm just storing all the text in external files.


Bug Reports - v3cz0r - 12-31-2004

Literal strings max length is now 1024 chars, enough? ;)

Download the new version, btw.. it's out.


Bug Reports - Sterling Christensen - 12-31-2004

Minor difference in INT function behavior. It seems like QB's INT returns a LONG, while FB's INT returns floating point:
Code:
PRINT INT(1000000000)
QB shows 1000000000, FB 1e+009

I think this would cause expressions involving INT to use more floating point math than necessary. Example:
Code:
PRINT int% + INT(float!)
But I guess that's not much of an issue on modern processors. I'm still freaked out that floating point division is faster than integer division - maybe FB's INT is better the way it is.


This bug took me quite some time to figure out... - subxero - 12-31-2004

Alright, I was writing a program to automatically generate DECLARE statements for any SUBs/FUNCTIONs in a file/in a group of files and I needed to use three Windows API functions: FindFirstFile, FindNextFile and FindClose, as follows:

Code:
Declare Function FindFirstFile Lib "kernel32" Alias "FindFirstFileA" (ByVal lpFileName As String, lpFindFileData As WIN32_FIND_DATA) As Integer
Declare Function FindNextFile Lib "kernel32" Alias "FindNextFileA" (ByVal hFindFile As Integer, lpFindFileData As WIN32_FIND_DATA) As Integer
Declare Function FindClose Lib "kernel32" (ByVal hFindFile As Integer) As Integer

These functions take a parameter of type WIN32_FIND_DATA (who requires FILETIME as well):

Code:
Type FILETIME
    dwLowDateTime   As uinteger  
    dwHighDateTime  As uinteger  
End Type

Type WIN32_FIND_DATA
    dwFileAttributes    As uinteger  
    ftCreationTime      As FILETIME  
    ftLastAccessTime    As FILETIME  
    ftLastWriteTime     As FILETIME  
    nFileSizeHigh       As uinteger  
    nFileSizeLow        As uinteger  
    dwReserved0         As uinteger  
    dwReserved1         As uinteger  
    cFileName           As String * 260 - 1
    cAlternate          As String * 14 - 1
End Type

Now, I've got my functions and their UDTs. So let's give them a call:

Code:
Dim FindHandle As Integer
Dim FindData As WIN32_FIND_DATA

FindHandle = FindFirstFile("*.*", FindData)
If FindHandle <> -1 Then
   Do
      ' I need to print the file name:
      Print FindData.cFileName
   Loop While FindNextFile(FileHandle, FindData)
End If

However, that code does not work... the filenames printed are not the whole filenames - they are missing their first four characters. I suspect this is because the strings in FB are stored as (size, data), where size is a four-byte long integer. Since Windows copies strings directly to their address, it copies the first four characters into this unaccessible area of the string. So I had to work around this by doing the following:

Code:
' MAX_PATH is usually 260
Dim A As String * MAX_PATH Pointer

' Point to the actual string Windows stored, not the cut version:
A = VarPtr(FindData.cFileName) - Len(Long)
Print *A

This worked just fine. This took me quite some time to figure out, though, and could be a serious pain in Windows programming with FB. It's just a suggestion, but might it be possible to have a CSTRING data type, that stores its strings as NULL-terminated values? It'd be a little weird, but it would work.


Bug Reports - VonGodric - 12-31-2004

okay, I found new bug:
Code:
sub test(text as string * 1)
   print text
end sub

dim a as string
DO
   a=INKEY$
   IF a>"" AND a<>chr$(13) THEN test(a)
LOOP UNTIL a=CHR$(13)
Gives some wierd result


Bug Reports - adosorken - 12-31-2004

How can a string exceed the value of another string? I think your code is what's broken. Big Grin