Search found 2838 matches

by dkl
Apr 24, 2017 17:53
Forum: Community Discussion
Topic: Problem making a Dialog Box
Replies: 22
Views: 1797

Re: Problem making a Dialog Box

Hmm, I looked at the DialogBoxIndirect() documentation and it says that it wants a header ... followed by one or more additional blocks of data. So apparently having just the DLGTEMPLATE is not enough and will lead to a buffer overflow.
by dkl
Apr 16, 2017 23:53
Forum: Projects
Topic: fbfrog header translator
Replies: 44
Views: 7668

Re: fbfrog header translator

It's possible to tell fbfrog to only emit parts of the input (filtered by input file name), or to drop symbol declarations by name pattern. That's how I used it - parse the whole API in one go, then emit the needed parts, check if anything is missing afterwards. For example: freeglut or libcairo A w...
by dkl
Apr 16, 2017 10:10
Forum: Projects
Topic: fbfrog header translator
Replies: 44
Views: 7668

Re: fbfrog header translator

The size_t handling is currently hard-coded , so the only way to disable it would be to remove it from that internal table. It might not be a 100% precise translation, but I assumed that size_t will always be the same as UInteger, so might aswell use that. Indeed, adding support for & => byref i...
by dkl
Apr 07, 2017 18:27
Forum: Community Discussion
Topic: Download Website Security Issue FIXED
Replies: 13
Views: 1490

Re: ATTENTION TO FB DEV - DOWNLOAD WEBSITE SECURITY ISSUE?

Yea, same here. Looks like https://sourceforge.net/projects/fbc/files/ works (instead of the shorthand sf.net).
by dkl
Mar 17, 2017 18:05
Forum: Windows
Topic: CPUDETECT.S, error building rtlib on windows
Replies: 22
Views: 3993

Re: CPUDETECT.S, error building rtlib on windows

Yea, the problem usually is that the uname command from MSYS returns 32bit even if you have a 64bit gcc, so the FB makefile thinks it's building for 32bit, and chooses sources files, pre-#defines and directory layout accordingly, but uses the 64bit gcc when compiling stuff. I think that problem is s...
by dkl
Mar 17, 2017 17:50
Forum: Beginners
Topic: Weird destructor problem
Replies: 10
Views: 847

Re: Weird destructor problem

I think a destroy() or close() method would be best. It should close/destroy the window, and clear the internal data structures (e.g. set handles to NULL, etc.), so it will do nothing if called again. Then the destructor would also call the destroy() method, to automatically destroy the window if it...
by dkl
Feb 28, 2017 17:29
Forum: General
Topic: warning: array subscript is below array bounds
Replies: 2
Views: 566

Re: warning: array subscript is below array bounds

Hmm, it looks like this part of FB's implementation of arrays is undefined behaviour in C (pointer arithmetic outside the array boundaries even though it's never dereferenced). I guess that's why there is a warning (I'm not getting it here by the way, with x86_64-linux-gnu gcc 5.4.0 or x86_64-w64-mi...
by dkl
Feb 21, 2017 18:04
Forum: General
Topic: Linking Problem
Replies: 4
Views: 567

Re: Linking Problem

Try removing the "lib" prefix from the #inclib; it will be added automatically, like the .a file extension.

Code: Select all

#Inclib "FSUIPC_FB"
by dkl
Feb 13, 2017 17:57
Forum: General
Topic: Byval as T, or Byref as Const T, pro and cons?
Replies: 4
Views: 611

Re: Byval as T, or Byref as Const T, pro and cons?

Byval (passing by copy) is good for small objects (4 or 8 bytes, a bit more will still be ok) that are easy to copy, like Integers. Passing Byval avoids the overhead of the pointer used by Byref. Byref is better for passing huge objects like strings or big UDTs that shouldn't be copied. Even though ...
by dkl
Feb 12, 2017 19:57
Forum: General
Topic: fbc complaining about unique names in udt...
Replies: 2
Views: 349

Re: fbc complaining about unique names in udt...

Looks like there's a compiler bug with #includes inside Type blocks. It's not working properly, and probably shouldn't be allowed at all anyways. Imagine if it really worked and expanded the #included files in that place: All the function declarations would end up declaring methods in that Type bloc...
by dkl
Feb 10, 2017 23:02
Forum: General
Topic: problem const address from string literal !
Replies: 1
Views: 291

Re: problem const address from string literal !

When declaring a constant (with Const at the beginning) it must be a compile-time constant. Only variables declared with Dim or Var at the beginning can allow "run-time constants" like the address of a string literal.
by dkl
Feb 10, 2017 20:38
Forum: General
Topic: Any reason for not allowing dim byref in UDT?
Replies: 20
Views: 1526

Re: Any reason for not allowing dim byref in UDT?

Unfortunately there is no way to ensure that besides being careful. Just like pointers, references can be dangling. The only way to prevent that would be to use a language where all objects are reference counted and garbage collected, or disallow references/pointers to things that can disappear.
by dkl
Feb 10, 2017 18:35
Forum: Beginners
Topic: Max Lines
Replies: 13
Views: 1269

Re: Max Lines

Hmm, it must be a performance bug in -gen gcc, since -gen gas has to emit essentially the same thing (more total bytes in fact), but does it much faster.
by dkl
Feb 10, 2017 17:48
Forum: General
Topic: Any reason for not allowing dim byref in UDT?
Replies: 20
Views: 1526

Re: Any reason for not allowing dim byref in UDT?

I wouldn't like using = Any for that, since it means "undefined/random". It seems enough to just have no initializer at all.
by dkl
Feb 09, 2017 17:53
Forum: General
Topic: Any reason for not allowing dim byref in UDT?
Replies: 20
Views: 1526

Re: Any reason for not allowing dim byref in UDT?

Yea, I suppose a rule like "all references must be assigned in the constructor" could work. It's probably better than adding a new syntax, and the compiler can do some basic checking to ensure all references are assigned at least once in the constructor. You'd just have to be careful not t...

Go to advanced search