mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-24 17:41:41 +02:00
* small fixes
* made UniqueAnsistring public * ...
This commit is contained in:
parent
8c2b6eadec
commit
e0043e9a3e
@ -114,7 +114,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Procedure Decr_Ansi_Ref (Var P : Pointer);[Alias : 'FPC_DECR_ANSI_REF'];
|
Procedure Decr_Ansi_Ref (Var P : Pointer);
|
||||||
|
[Public,Alias : 'FPC_DECR_ANSI_REF'];
|
||||||
{
|
{
|
||||||
Decreases the ReferenceCount of a non constant ansistring;
|
Decreases the ReferenceCount of a non constant ansistring;
|
||||||
If the reference count is zero, deallocate the string;
|
If the reference count is zero, deallocate the string;
|
||||||
@ -140,7 +141,8 @@ Begin
|
|||||||
end
|
end
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure Incr_Ansi_Ref (Var S : Pointer);[Alias : 'FPC_INCR_ANSI_REF'];
|
Procedure Incr_Ansi_Ref (Var S : Pointer);
|
||||||
|
[Public,Alias : 'FPC_INCR_ANSI_REF'];
|
||||||
|
|
||||||
Begin
|
Begin
|
||||||
If S=Nil then
|
If S=Nil then
|
||||||
@ -150,7 +152,8 @@ Begin
|
|||||||
Inc(PAnsiRec(S-FirstOff)^.Ref);
|
Inc(PAnsiRec(S-FirstOff)^.Ref);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure UniqueAnsiString (Var S : Pointer);
|
Procedure UniqueAnsiString (Var S : AnsiString);
|
||||||
|
[Public,Alias : 'FPC_UNIQUE_ANSISTRING'];
|
||||||
{
|
{
|
||||||
Make sure reference count of S is 1,
|
Make sure reference count of S is 1,
|
||||||
using copy-on-write semantics.
|
using copy-on-write semantics.
|
||||||
@ -171,7 +174,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure AssignAnsiString (Var S1 : Pointer;S2 : Pointer); [Public, Alias : 'FPC_ASSIGN_ANSI_STRING'];
|
Procedure AssignAnsiString (Var S1 : Pointer;S2 : Pointer);
|
||||||
|
[Public, Alias : 'FPC_ASSIGN_ANSI_STRING'];
|
||||||
|
|
||||||
{
|
{
|
||||||
Assigns S2 to S1 (S1:=S2), taking in account reference counts.
|
Assigns S2 to S1 (S1:=S2), taking in account reference counts.
|
||||||
@ -278,13 +282,14 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Function PChar2Ansi(p : pchar) : pointer;[Public,Alias : 'FPC_ANSI2PCHAR'];
|
Procedure PChar2Ansi(var a : ansistring;p : pchar);[Public,Alias : 'FPC_PCHAR_TO_ANSISTRING'];
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
//!!!!!!!!! needs to be fixed (FK)
|
||||||
if p^=#0
|
if p^=#0
|
||||||
PChar2Ansi:=nil
|
a:=nil
|
||||||
else
|
else
|
||||||
|
a:=p;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ the compiler generates inline code for that
|
{ the compiler generates inline code for that
|
||||||
@ -360,7 +365,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{ not used
|
||||||
Procedure SetCharAtIndex (Var S : AnsiString; Index : Longint; C : CHar);
|
Procedure SetCharAtIndex (Var S : AnsiString; Index : Longint; C : CHar);
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -370,6 +375,7 @@ begin
|
|||||||
Pbyte(Pointer(S)+index-1)^:=Byte(C);
|
Pbyte(Pointer(S)+index-1)^:=Byte(C);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
}
|
||||||
|
|
||||||
{ ---------------------------------------------------------------------
|
{ ---------------------------------------------------------------------
|
||||||
Public functions, In interface.
|
Public functions, In interface.
|
||||||
@ -701,7 +707,12 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.16 1998-09-20 17:49:08 florian
|
Revision 1.17 1998-09-27 22:44:50 florian
|
||||||
|
* small fixes
|
||||||
|
* made UniqueAnsistring public
|
||||||
|
* ...
|
||||||
|
|
||||||
|
Revision 1.16 1998/09/20 17:49:08 florian
|
||||||
* some ansistring fixes
|
* some ansistring fixes
|
||||||
|
|
||||||
Revision 1.15 1998/09/19 08:33:17 florian
|
Revision 1.15 1998/09/19 08:33:17 florian
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user