* some problems with ansi string support fixed

This commit is contained in:
florian 1998-07-13 21:19:07 +00:00
parent 0912889c24
commit ba57d2813b
8 changed files with 54 additions and 38 deletions

View File

@ -48,8 +48,6 @@ const
var
errno : integer;
type
plongint = ^longint;
{$S-}
procedure Stack_Check; assembler;
@ -635,7 +633,10 @@ end.
{
$Log$
Revision 1.5 1998-07-13 12:34:13 carl
Revision 1.6 1998-07-13 21:19:07 florian
* some problems with ansi string support fixed
Revision 1.5 1998/07/13 12:34:13 carl
+ Error2InoutRes implemented
* do_read was doing a wrong os call!
* do_open was not pushing the right values

View File

@ -127,8 +127,7 @@ implementation
const
carryflag = 1;
type
plongint = ^longint;
var
doscmd : string[128]; { Dos commandline copied from PSP, max is 128 chars }
@ -1058,7 +1057,10 @@ Begin
End.
{
$Log$
Revision 1.11 1998-07-07 12:33:08 carl
Revision 1.12 1998-07-13 21:19:08 florian
* some problems with ansi string support fixed
Revision 1.11 1998/07/07 12:33:08 carl
* added 2k buffer for stack checking for correct io on error
Revision 1.10 1998/07/02 12:29:20 carl

View File

@ -41,7 +41,7 @@ Function NewAnsiString (Len : Longint) : AnsiString; forward;
Procedure DisposeAnsiString (Var S : AnsiString); forward;
Procedure Decr_Ansi_Ref (Var S : AnsiString); forward;
Procedure Incr_Ansi_Ref (Var S : AnsiString); forward;
Procedure AssignAnsiString (Var S1 : AnsiString; S2 : AnsiString);
Procedure AssignAnsiString (Var S1 : AnsiString; S2 : AnsiString); forward;
Procedure Ansi_String_Concat (Var S1 : AnsiString; Const S2 : AnsiString); forward;
Procedure Ansi_ShortString_Concat (Var S1: AnsiString; Const S2 : ShortString); forward;
Procedure Ansi_To_ShortString (Var S1 : ShortString; Const S2 : AnsiString; maxlen : longint); forward;
@ -58,10 +58,7 @@ Type TAnsiRec = Record
First : Char;
end;
PAnsiRec = ^TAnsiRec;
PLongint = ^Longint;
PByte = ^Byte;
Const AnsiRecLen = SizeOf(TAnsiRec);
FirstOff = SizeOf(TAnsiRec)-1;
@ -325,7 +322,7 @@ end;
Procedure Write_Text_AnsiString (Len : Longint; T : TextRec; Var S : AnsiString);[Public, alias 'WRITE_TEXT_ANSISTRING'];
Procedure Write_Text_AnsiString (Len : Longint; T : TextRec; Var S : AnsiString);[Public, alias: 'WRITE_TEXT_ANSISTRING'];
{
Writes a AnsiString to the Text file T
}
@ -368,7 +365,7 @@ Procedure SetLength (Var S : AnsiString; l : Longint);
Var Temp : Pointer;
begin
If (S=Nil) and (l>0) then
If (Pointer(S)=Nil) and (l>0) then
begin
{ Need a complete new string...}
S:=NewAnsiString(l);
@ -384,9 +381,9 @@ begin
{ Reallocation is needed... }
Temp:=Pointer(NewAnsiString(L));
if Length(S)>0 then
Move (S^,Temp^,Length(S)+1);
Move (Pointer(S)^,Temp^,Length(S)+1);
Decr_Ansi_ref (S);
S:=Temp;
S:=AnsiString(Temp);
end;
PAnsiRec(Pointer(S)-FirstOff)^.Len:=l
end
@ -418,7 +415,7 @@ begin
PByte(ResultAddress+Size)^:=0;
end;
end;
Copy:=ResultAddress;
Copy:=AnsiString(ResultAddress);
end;
@ -438,7 +435,7 @@ begin
begin
inc (i);
S:=Pointer(copy(Source,i,length(Substr)));
if AnsiCompare(substr,s)=0 then
if AnsiCompare(substr,AnsiString(s))=0 then
begin
j := i;
e := false;
@ -547,7 +544,7 @@ begin
System.Val(SS,SI,Code);
end;
{
Procedure Str (Const R : Real;Len,fr : Longint; Var S : AnsiString);
Var SS : ShortString;
@ -624,7 +621,7 @@ Procedure Str (Const SI : ShortInt; Len : Longint; Var S : AnsiString);
begin
end;
}
Procedure Delete (Var S : AnsiString; Index,Size: Longint);
@ -672,7 +669,10 @@ end;
{
$Log$
Revision 1.7 1998-07-06 14:29:08 michael
Revision 1.8 1998-07-13 21:19:09 florian
* some problems with ansi string support fixed
Revision 1.7 1998/07/06 14:29:08 michael
+ Added Public,Alias directives for some calls
Revision 1.6 1998/06/25 08:41:44 florian

View File

@ -158,7 +158,11 @@ begin
insert ('.',temp,3);
str(abs(correct),power);
if length(power)<explen-2 then
{$ifndef USEANSISTRINGS} {!!!!!!!!! this doesn't work with ansi strings }
power:=copy(zero,1,explen-2-length(power))+power;
{$else USEANSISTRINGS}
;
{$endif USEANSISTRINGS}
if correct<0 then power:='-'+power else power:='+'+power;
temp:=temp+'E'+power;
end
@ -198,7 +202,10 @@ end;
{
$Log$
Revision 1.4 1998-06-18 08:15:33 michael
Revision 1.5 1998-07-13 21:19:10 florian
* some problems with ansi string support fixed
Revision 1.4 1998/06/18 08:15:33 michael
+ Fixed error when printing zero. len was calculated wron.
Revision 1.3 1998/05/12 10:42:45 peter

View File

@ -24,12 +24,6 @@ Const
tkArray = 13;
tkRecord = 14;
{ Some useful types }
Type
PByte = ^Byte;
{ A record is designed as follows :
1 : tkrecord
2 : Length of name string (n);
@ -38,7 +32,9 @@ Type
7+n : number of elements (N)
11+n : N times : Pointer to type info
Offset in record
}
}
Type
TRecElem = Record
Info : Pointer;
@ -75,7 +71,10 @@ TArrayRec = record
{
$Log$
Revision 1.2 1998-06-08 15:32:15 michael
Revision 1.3 1998-07-13 21:19:11 florian
* some problems with ansi string support fixed
Revision 1.2 1998/06/08 15:32:15 michael
+ Split rtti according to processor. Implemented optimized i386 code.
}

View File

@ -112,6 +112,10 @@ Procedure Rewrite(var f : TypedFile); [INTERNPROC: In_Rewrite_TypedFile];
{$ifdef UseAnsiStrings}
Type
PLongint = ^Longint;
PByte = ^Byte;
{$i astrings.pp}
{$else}
@ -493,7 +497,10 @@ End;
{
$Log$
Revision 1.19 1998-07-08 11:56:55 carl
Revision 1.20 1998-07-13 21:19:12 florian
* some problems with ansi string support fixed
Revision 1.19 1998/07/08 11:56:55 carl
* randon and Random(l) now work correctly - don't touch it works!
Revision 1.18 1998/07/02 13:01:55 carl

View File

@ -47,9 +47,6 @@ Implementation
{$I system.inc}
Type
PLongint = ^Longint;
{$ifdef crtlib}
Procedure _rtl_exit(l: longint); cdecl;
Function _rtl_paramcount: longint; cdecl;
@ -678,7 +675,10 @@ End.
{
$Log$
Revision 1.7 1998-07-02 12:36:21 carl
Revision 1.8 1998-07-13 21:19:14 florian
* some problems with ansi string support fixed
Revision 1.7 1998/07/02 12:36:21 carl
* IOCheck/InOutRes check for mkdir, chdir and rmdir as in TP
Revision 1.6 1998/07/01 15:30:01 peter

View File

@ -127,9 +127,6 @@ CONST
var
errno : longint;
type
plongint = ^longint;
{ misc. functions }
function GetLastError : DWORD;
external 'kernel32' name 'GetLastError';
@ -762,7 +759,10 @@ end.
{
$Log$
Revision 1.12 1998-07-07 12:37:28 carl
Revision 1.13 1998-07-13 21:19:15 florian
* some problems with ansi string support fixed
Revision 1.12 1998/07/07 12:37:28 carl
* correct mapping of error codes for TP compatibility
+ implemented stack checking in ifdef dummy