mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-08 18:02:22 +02:00
* Correct comments about sizes/offsets in invisible string header record
git-svn-id: trunk@33247 -
This commit is contained in:
parent
416151a335
commit
1bdae1edc8
@ -24,12 +24,12 @@
|
||||
This file contains the implementation of the AnsiString type,
|
||||
and all things that are needed for it.
|
||||
AnsiString is defined as a 'silent' pchar :
|
||||
a pchar that points to :
|
||||
a pchar that points to (S= SizeOf(SizeInt)):
|
||||
|
||||
@-16 : Code page indicator.
|
||||
@-12 : Character size (2 bytes)
|
||||
@-8 : SizeInt for reference count;
|
||||
@-4 : SizeInt for size;
|
||||
@-3*S : Code page indicator.
|
||||
@-3*S+2 : Character size (2 bytes)
|
||||
@-2*S : SizeInt for reference count;
|
||||
@-S : SizeInt for size;
|
||||
@ : String + Terminating #0;
|
||||
Pchar(Ansistring) is a valid typecast.
|
||||
So AS[i] is converted to the address @AS+i-1.
|
||||
|
@ -21,12 +21,12 @@
|
||||
This file contains the implementation of the UnicodeString type,
|
||||
and all things that are needed for it.
|
||||
UnicodeString is defined as a 'silent' punicodechar :
|
||||
a punicodechar that points to :
|
||||
a punicodechar that points to (S = SizeOf(SizeInt)) :
|
||||
|
||||
@-8 : SizeInt for reference count;
|
||||
@-4 : SizeInt for size; size=number of chars. Multiply with
|
||||
sizeof(UnicodeChar) to get the number of bytes. This is compatible with Delphi.
|
||||
@ : String + Terminating #0;
|
||||
@-2*S : SizeInt for reference count;
|
||||
@-S : SizeInt for size; size=number of chars. Multiply with
|
||||
sizeof(UnicodeChar) to get the number of bytes. This is compatible with Delphi.
|
||||
@ : String + Terminating #0;
|
||||
Punicodechar(Unicodestring) is a valid typecast.
|
||||
So WS[i] is converted to the address @WS+i-1.
|
||||
|
||||
|
@ -18,10 +18,9 @@
|
||||
This file contains the implementation of the WideString type,
|
||||
and all things that are needed for it.
|
||||
WideString is defined as a 'silent' pwidechar :
|
||||
a pwidechar that points to :
|
||||
a pwidechar that points to:
|
||||
|
||||
@-8 : SizeInt for reference count;
|
||||
@-4 : SizeInt for size; size=number of bytes, not the number of chars. Divide or multiply
|
||||
@-4 : DWord for size; size=number of bytes, not the number of chars. Divide or multiply
|
||||
with sizeof(WideChar) to convert. This is needed to be compatible with Delphi and
|
||||
Windows COM BSTR.
|
||||
@ : String + Terminating #0;
|
||||
|
Loading…
Reference in New Issue
Block a user