Is it possible to achieve this dynamically without resorting to type casting?
It feels like classes should have a builtin type for each class, like
TClassType, which similar to TObject.ClassType but is a compile time type.
=
{$mode objfpc}
program test;
type
TBase = class
// TCl
Hello.
With fpc 3.3.1 there is this warning:
"Warning: (4110) Range check error while evaluating constants (-193 must be
between 0 and 255)"
Here the code pointed by the warning:
const
foldhiddenbit = 7;
foldhiddenmask = 1 shl foldhiddenbit;
currentfoldhiddenbit = 6;
currentfoldhiddenmask =
Hello.
How to disable the Warning: (6060) Case statement does not handle all
possible cases ?
I did try with this without luck, the warning is still there:
interface
{$warn 6060 off}
Fre;D
-
Many thanks ;-)
--
Sent from: http://free-pascal-general.1045716.n5.nabble.com/
__
Super.
And I am so happy that the best representative of what fpc can do is still
in the game.
Thanks Sven.
Fre;D
-
Many thanks ;-)
--
Sent from: http://free-pascal-general.1045716.n5.nabble.com/
___
fpc-pascal maillist - fpc-pascal@lists.free
fredvs via fpc-pascal schrieb am Mo., 23.
März 2020, 22:27:
> By the way, may I use this tip for fpc < 3.3.1 or is it ok only with fpc
> trunk?
>
Yes, it will also work with older be versions - as you noticed already. ;)
Regards,
Sven
>
___
fpc-pasca
> Time to commit it (but I wait for your green light Sven).
I did commit the change because after many tests, I cannot find problems
(but if you see a warning or a tip, it is welcome).
Many thanks Sven.
Fre;D
-
Many thanks ;-)
--
Sent from: http://free-pascal-general.1045716.n5.nabble.c
> By the way, may I use this tip for fpc < 3.3.1 or is it ok only with fpc
trunk?
Ok, I did compile it with FPC 3.0.4, FPC 3.2.0 and FPC 3.3.1.
And...
...
Yes, all 3 works as expected.
;-) x 1000.
Time to commit it (but I wait for your green light Sven).
Fre;D
-
Many thanks ;-)
--
S
Hello Sven.
Always good news with you!
OK, I did replace all call to pdynarraytypeinfo with PTypeInfo and adapt all
code for this.
And you know what: IT WORKS!
I am totally surprised but now msestat files are ok with fpc 3.3.1.
Well, well, well done Sven (you could not imagine how happy I am).
Am 23.03.2020 um 17:49 schrieb fredvs via fpc-pascal:
Some more infos:
This gives the correct size with fpc <= 3.2.0:
function dynarrayelesize(const typinfo: pdynarraytypeinfo): sizeint;
var
ti: pdynarraytypeinfo;
begin
ti:= typinfo;
inc(pointer(ti),ord(pdynarraytypeinfo(ti)^.namelen)+2);
Some more infos:
This gives the correct size with fpc <= 3.2.0:
function dynarrayelesize(const typinfo: pdynarraytypeinfo): sizeint;
var
ti: pdynarraytypeinfo;
begin
ti:= typinfo;
inc(pointer(ti),ord(pdynarraytypeinfo(ti)^.namelen)+2);
result:= psizeint(ti)^;
end;
But with last trunk fpc 3.
Hello.
How to do to retrieve the size of the array of pdynarraytypeinfo?
Thanks
Fre;D
-
Many thanks ;-)
--
Sent from: http://free-pascal-general.1045716.n5.nabble.com/
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
https://lists.fre
11 matches
Mail list logo