mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-15 05:46:42 +02:00
* fix for 11263, changed fileread and fd_zero to out using $modeswitch.
git-svn-id: trunk@14965 -
This commit is contained in:
parent
ccce77f28b
commit
be98b13554
@ -21,6 +21,7 @@ unit sysutils;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
{$MODE objfpc}
|
{$MODE objfpc}
|
||||||
|
{$MODESWITCH OUT}
|
||||||
{ force ansistrings }
|
{ force ansistrings }
|
||||||
{$H+}
|
{$H+}
|
||||||
|
|
||||||
@ -156,7 +157,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function FileRead(Handle: LongInt; var Buffer; Count: LongInt): LongInt;
|
function FileRead(Handle: LongInt; Out Buffer; Count: LongInt): LongInt;
|
||||||
begin
|
begin
|
||||||
FileRead:=-1;
|
FileRead:=-1;
|
||||||
if (Count<=0) or (Handle<=0) then exit;
|
if (Count<=0) or (Handle<=0) then exit;
|
||||||
|
@ -18,6 +18,7 @@ unit sysutils;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
{$MODE objfpc}
|
{$MODE objfpc}
|
||||||
|
{$MODESWITCH OUT}
|
||||||
{ force ansistrings }
|
{ force ansistrings }
|
||||||
{$H+}
|
{$H+}
|
||||||
|
|
||||||
@ -435,7 +436,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function FileRead (Handle: longint; var Buffer; Count: longint): longint;
|
function FileRead (Handle: longint; Out Buffer; Count: longint): longint;
|
||||||
assembler;
|
assembler;
|
||||||
asm
|
asm
|
||||||
push ebx
|
push ebx
|
||||||
|
@ -25,6 +25,7 @@ unit sysutils;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
{$MODE objfpc}
|
{$MODE objfpc}
|
||||||
|
{$MODESWITCH OUT}
|
||||||
{ force ansistrings }
|
{ force ansistrings }
|
||||||
{$H+}
|
{$H+}
|
||||||
|
|
||||||
@ -74,7 +75,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function FileRead(Handle: LongInt; var Buffer; Count: LongInt): LongInt;
|
function FileRead(Handle: LongInt; Out Buffer; Count: LongInt): LongInt;
|
||||||
begin
|
begin
|
||||||
result := -1;
|
result := -1;
|
||||||
end;
|
end;
|
||||||
|
@ -20,6 +20,7 @@ unit sysutils;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
{$MODE objfpc}
|
{$MODE objfpc}
|
||||||
|
{$MODESWITCH out}
|
||||||
{ force ansistrings }
|
{ force ansistrings }
|
||||||
{$H+}
|
{$H+}
|
||||||
|
|
||||||
@ -135,7 +136,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Function FileRead (Handle : Longint; Var Buffer; Count : longint) : Longint;
|
Function FileRead (Handle : Longint; Out Buffer; Count : longint) : Longint;
|
||||||
var
|
var
|
||||||
regs : registers;
|
regs : registers;
|
||||||
size,
|
size,
|
||||||
|
@ -21,6 +21,7 @@ unit sysutils;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
{$MODE objfpc}
|
{$MODE objfpc}
|
||||||
|
{$modeswitch out}
|
||||||
{ force ansistrings }
|
{ force ansistrings }
|
||||||
{$H+}
|
{$H+}
|
||||||
|
|
||||||
@ -109,7 +110,7 @@ BEGIN
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Function FileRead (Handle : Longint; Var Buffer; Count : longint) : Longint;
|
Function FileRead (Handle : Longint; out Buffer; Count : longint) : Longint;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
(* TODO fix
|
(* TODO fix
|
||||||
|
@ -21,6 +21,7 @@ unit sysutils;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
{$MODE objfpc}
|
{$MODE objfpc}
|
||||||
|
{$MODESWITCH OUT}
|
||||||
{ force ansistrings }
|
{ force ansistrings }
|
||||||
{$H+}
|
{$H+}
|
||||||
|
|
||||||
@ -157,7 +158,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function FileRead(Handle: LongInt; var Buffer; Count: LongInt): LongInt;
|
function FileRead(Handle: LongInt; out Buffer; Count: LongInt): LongInt;
|
||||||
begin
|
begin
|
||||||
FileRead:=-1;
|
FileRead:=-1;
|
||||||
if (Count<=0) or (Handle<=0) then exit;
|
if (Count<=0) or (Handle<=0) then exit;
|
||||||
|
@ -25,6 +25,7 @@ unit sysutils;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
{$MODE objfpc}
|
{$MODE objfpc}
|
||||||
|
{$MODESWITCH OUT}
|
||||||
{ force ansistrings }
|
{ force ansistrings }
|
||||||
{$H+}
|
{$H+}
|
||||||
|
|
||||||
@ -74,7 +75,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function FileRead(Handle: LongInt; var Buffer; Count: LongInt): LongInt;
|
function FileRead(Handle: LongInt; Out Buffer; Count: LongInt): LongInt;
|
||||||
begin
|
begin
|
||||||
result := -1;
|
result := -1;
|
||||||
end;
|
end;
|
||||||
|
@ -18,6 +18,7 @@ unit sysutils;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
{$MODE objfpc}
|
{$MODE objfpc}
|
||||||
|
{$MODESWITCH OUT}
|
||||||
{ force ansistrings }
|
{ force ansistrings }
|
||||||
{$H+}
|
{$H+}
|
||||||
|
|
||||||
@ -112,7 +113,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Function FileRead (Handle : THandle; Var Buffer; Count : longint) : longint;
|
Function FileRead (Handle : THandle; Out Buffer; Count : longint) : longint;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
FileRead:=_read (Handle,@Buffer,Count);
|
FileRead:=_read (Handle,@Buffer,Count);
|
||||||
|
@ -17,6 +17,7 @@ unit sysutils;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
{$MODE objfpc}
|
{$MODE objfpc}
|
||||||
|
{$MODESWITCH OUT}
|
||||||
{ force ansistrings }
|
{ force ansistrings }
|
||||||
{$H+}
|
{$H+}
|
||||||
|
|
||||||
@ -114,7 +115,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Function FileRead (Handle : THandle; Var Buffer; Count : longint) : Longint;
|
Function FileRead (Handle : THandle; Out Buffer; Count : longint) : Longint;
|
||||||
begin
|
begin
|
||||||
FileRead:=libc.fpread (Handle,@Buffer,Count);
|
FileRead:=libc.fpread (Handle,@Buffer,Count);
|
||||||
end;
|
end;
|
||||||
|
@ -74,7 +74,7 @@ Const
|
|||||||
Function FileOpen (Const FileName : string; Mode : Integer) : THandle;
|
Function FileOpen (Const FileName : string; Mode : Integer) : THandle;
|
||||||
Function FileCreate (Const FileName : String) : THandle;
|
Function FileCreate (Const FileName : String) : THandle;
|
||||||
Function FileCreate (Const FileName : String; Mode : Integer) : THandle;
|
Function FileCreate (Const FileName : String; Mode : Integer) : THandle;
|
||||||
Function FileRead (Handle : THandle; Var Buffer; Count : longint) : Longint;
|
Function FileRead (Handle : THandle; out Buffer; Count : longint) : Longint;
|
||||||
Function FileWrite (Handle : THandle; const Buffer; Count : Longint) : Longint;
|
Function FileWrite (Handle : THandle; const Buffer; Count : Longint) : Longint;
|
||||||
Function FileSeek (Handle : THandle; FOffset, Origin: Longint) : Longint;
|
Function FileSeek (Handle : THandle; FOffset, Origin: Longint) : Longint;
|
||||||
Function FileSeek (Handle : THandle; FOffset: Int64; Origin: Longint) : Int64;
|
Function FileSeek (Handle : THandle; FOffset: Int64; Origin: Longint) : Int64;
|
||||||
|
@ -18,6 +18,7 @@ unit sysutils;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
{$MODE objfpc}
|
{$MODE objfpc}
|
||||||
|
{$MODESWITCH OUT}
|
||||||
{ force ansistrings }
|
{ force ansistrings }
|
||||||
{$H+}
|
{$H+}
|
||||||
|
|
||||||
@ -515,7 +516,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function FileRead (Handle: THandle; var Buffer; Count: longint): longint;
|
function FileRead (Handle: THandle; Out Buffer; Count: longint): longint;
|
||||||
Var
|
Var
|
||||||
T: cardinal;
|
T: cardinal;
|
||||||
begin
|
begin
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
Unit BaseUnix;
|
Unit BaseUnix;
|
||||||
|
|
||||||
Interface
|
Interface
|
||||||
|
{$modeswitch out}
|
||||||
{$inline on}
|
{$inline on}
|
||||||
Uses UnixType;
|
Uses UnixType;
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ Function FpGetEnv (name : String): pChar;
|
|||||||
|
|
||||||
Function fpFD_SET (fdno:cint;var nset : TFDSet): cint;
|
Function fpFD_SET (fdno:cint;var nset : TFDSet): cint;
|
||||||
Function fpFD_CLR (fdno:cint;var nset : TFDSet): cint;
|
Function fpFD_CLR (fdno:cint;var nset : TFDSet): cint;
|
||||||
Function fpFD_ZERO (var nset : TFDSet):cint;
|
Function fpFD_ZERO (out nset : TFDSet):cint;
|
||||||
Function fpFD_ISSET (fdno:cint;const nset : TFDSet): cint;
|
Function fpFD_ISSET (fdno:cint;const nset : TFDSet): cint;
|
||||||
Function fpfdfillset(var nset : TFDSet):cint;
|
Function fpfdfillset(var nset : TFDSet):cint;
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ Begin
|
|||||||
fpFD_CLR:=0;
|
fpFD_CLR:=0;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
function fpFD_ZERO(var nset : TFDSet):cint;
|
function fpFD_ZERO(out nset : TFDSet):cint;
|
||||||
|
|
||||||
var i :longint;
|
var i :longint;
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@ unit sysutils;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
{$MODE objfpc}
|
{$MODE objfpc}
|
||||||
|
{$MODESWITCH OUT}
|
||||||
{ force ansistrings }
|
{ force ansistrings }
|
||||||
{$H+}
|
{$H+}
|
||||||
|
|
||||||
@ -450,7 +451,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Function FileRead (Handle : Longint; Var Buffer; Count : longint) : Longint;
|
Function FileRead (Handle : Longint; out Buffer; Count : longint) : Longint;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
repeat
|
repeat
|
||||||
|
@ -20,6 +20,7 @@ unit sysutils;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
{$MODE objfpc}
|
{$MODE objfpc}
|
||||||
|
{$modeswitch out}
|
||||||
{ force ansistrings }
|
{ force ansistrings }
|
||||||
{$H+}
|
{$H+}
|
||||||
|
|
||||||
@ -140,7 +141,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Function FileRead (Handle : Longint; Var Buffer; Count : longint) : Longint;
|
Function FileRead (Handle : Longint; Out Buffer; Count : longint) : Longint;
|
||||||
var
|
var
|
||||||
regs : registers;
|
regs : registers;
|
||||||
size,
|
size,
|
||||||
|
@ -18,6 +18,7 @@ unit sysutils;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
{$MODE objfpc}
|
{$MODE objfpc}
|
||||||
|
{$MODESWITCH OUT}
|
||||||
{ force ansistrings }
|
{ force ansistrings }
|
||||||
{$H+}
|
{$H+}
|
||||||
|
|
||||||
@ -249,7 +250,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Function FileRead (Handle : THandle; Var Buffer; Count : longint) : Longint;
|
Function FileRead (Handle : THandle; out Buffer; Count : longint) : Longint;
|
||||||
Var
|
Var
|
||||||
res : dword;
|
res : dword;
|
||||||
begin
|
begin
|
||||||
|
@ -18,6 +18,7 @@ unit sysutils;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
{$MODE objfpc}
|
{$MODE objfpc}
|
||||||
|
{$MODESWITCH OUT}
|
||||||
{ force ansistrings }
|
{ force ansistrings }
|
||||||
{$H+}
|
{$H+}
|
||||||
|
|
||||||
@ -170,7 +171,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Function FileRead (Handle : THandle; Var Buffer; Count : longint) : Longint;
|
Function FileRead (Handle : THandle; Out Buffer; Count : longint) : Longint;
|
||||||
Var
|
Var
|
||||||
res : dword;
|
res : dword;
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user