Search found 3805 matches
- Jul 15, 2023 13:29
- Forum: General
- Topic: Pointer warning with "printf"
- Replies: 10
- Views: 838
Re: Pointer warning with "printf"
@Jeff: thanks for clarification. (I added the gcc-version 11.3.0 in my post above.) All my code generators (h_2_bi, girtobac, fbdoc) transform char <> ZSTRING . What about a further entry in the gcc backend generated C code typedef ZSTRING char; and passing the ZSTRING type unchanged (just adjusted ...
- Jul 15, 2023 8:33
- Forum: General
- Topic: Pointer warning with "printf"
- Replies: 10
- Views: 838
Re: Pointer warning with "printf"
..., it's just somebody finally noticed FB being a bit sloppy on Windows. Seems to be wrong. Testing on Linux 5.15.0-76-generic x86_64 GNU/Linux with FreeBASIC Compiler - Version 1.08.1 (2021-07-08) results in the same warning 230715_printf.c:13:7: warning: conflicting types for built-in function ‘...
- Jul 14, 2023 18:47
- Forum: General
- Topic: Pointer warning with "printf"
- Replies: 10
- Views: 838
Re: Pointer warning with "printf"
The key is:
Perhaps I was not precize; did you try CONST ZSTRING PTR as well?
Regards
The C compiler expects a const char *, which should get defined in the *.bi header.
Perhaps I was not precize; did you try CONST ZSTRING PTR as well?
Regards
- Jul 14, 2023 12:39
- Forum: General
- Topic: Pointer warning with "printf"
- Replies: 10
- Views: 838
Re: Pointer warning with "printf"
In order to avoid the warning, you can adapt the function prototype in file crt/stdio.bi: change the type of the first parameter of printf to ZSTRING PTR.
Regards
Regards
- Jul 14, 2023 12:30
- Forum: General
- Topic: How to select and copy the contents of the console
- Replies: 9
- Views: 657
Re: How to select and copy the contents of the console
You can redirect the console output in a shell. By default the output is send to STDOUT. Ie echo Hallo prints to the console (terminal), but executing echo Hallo > outfile.txt sends the output to a new file named outfile.txt in the current folder, and executing echo Hallo >> outfile.txt appends the ...
- Jul 14, 2023 12:15
- Forum: General
- Topic: How do I select an output DEVICE in FB?
- Replies: 1
- Views: 303
- Jul 02, 2023 6:11
- Forum: Beginners
- Topic: http get, post
- Replies: 3
- Views: 1407
Re: http get, post
Find an OOP solution in project nettobac. The file nettobac_http.bas contains functions for GET and PUT (and others). A demo is in file example_client.bas.
Regards
Regards
- Jun 29, 2023 2:56
- Forum: Libraries Questions
- Topic: Freebasic -GTK - Graphics
- Replies: 6
- Views: 1872
- Mar 31, 2023 19:28
- Forum: General
- Topic: Can I cast/coerce floating point to integer without rounding?
- Replies: 8
- Views: 1028
- Mar 31, 2023 19:11
- Forum: General
- Topic: Can I cast/coerce floating point to integer without rounding?
- Replies: 8
- Views: 1028
Re: Can I cast/coerce floating point to integer without rounding?
Yes, brackets seem to be a good idea
Here I get similar speed for both algos.
Code: Select all
#DEFINE myINT(V) ((V-.5) \ 1)
- Mar 24, 2023 4:00
- Forum: General
- Topic: Can I cast/coerce floating point to integer without rounding?
- Replies: 8
- Views: 1028
Re: Can I cast/coerce floating point to integer without rounding?
Using interger division is faster than FIX() function and serves the desired type:
[edit]
But mind overflow (a <= 2^53 or a >= 2^53).
[/edit]
Code: Select all
#DEFINE myINT(V) (V-.5) \ 1
VAR a = 3.7
VAR b = myINT(a)
?a ' 3.7
?b ' 3
#PRINT TYPEOF(b) ' INTEGER
VAR c = myINT(-a)
?c ' -4
But mind overflow (a <= 2^53 or a >= 2^53).
[/edit]
- Jan 05, 2023 7:36
- Forum: Libraries Questions
- Topic: Good Physics Library for Pinball?
- Replies: 2
- Views: 3043
Re: Good Physics Library for Pinball?
ODE 0.14 Windows and Linux 32/64-bit Jan 27, 2017
Find missing macros in ode-0.11.1 headers, if needed.
Regards
Find missing macros in ode-0.11.1 headers, if needed.
Regards
- Oct 02, 2022 16:22
- Forum: Community Discussion
- Topic: Compiler Option -nodeflib[s]
- Replies: 14
- Views: 3054
Re: Compiler Option -nodeflib[s]
Thanks for doing the coding, much appreciated!
I miss some docs on the syntax. Is it used by appending one lib name separated by a whitespace like
-nolib tinfo
Can a list of multiple lib names get append separated by comma like
-nolib tinfo,fbrt0
As always: examples would be nice.
I miss some docs on the syntax. Is it used by appending one lib name separated by a whitespace like
-nolib tinfo
Can a list of multiple lib names get append separated by comma like
-nolib tinfo,fbrt0
As always: examples would be nice.
- Aug 24, 2022 6:30
- Forum: Beginners
- Topic: How to print graphics with Free BASIC.....
- Replies: 3
- Views: 1390
Re: How to print graphics with Free BASIC.....
Use cairo library to create graphics on screen and in a PDF file, and print the file using OS features.
- Jul 03, 2022 8:43
- Forum: DOS
- Topic: DOS drivers in FreeBASIC
- Replies: 8
- Views: 4075
Re: DOS drivers in FreeBASIC
You will just have to avoid loading both libraries at the same time, of course. That's correct when compiling/linking against the library. But DYLIBLOAD provides different pointers to the binaries loaded, so multiple libs can be active at the same time. Example TYPE AddNumbers AS FUNCTION(BYVAL a A...