Przeglądaj źródła

* far pointer helper types made global in the implementation of the system unit

git-svn-id: trunk@24578 -
nickysn 12 lat temu
rodzic
commit
035cb74855
1 zmienionych plików z 9 dodań i 6 usunięć
  1. 9 6
      rtl/msdos/system.pp

+ 9 - 6
rtl/msdos/system.pp

@@ -81,6 +81,11 @@ implementation
 const
   fCarry = 1;
 
+type
+  PFarByte = ^Byte;far;
+  PFarChar = ^Char;far;
+  PFarWord = ^Word;far;
+
 var
   dos_version:Word;public name 'dos_version';
 
@@ -126,9 +131,6 @@ end;
 *****************************************************************************}
 
 function GetProgramName: string;
-type
-  PFarByte = ^Byte;far;
-  PFarWord = ^Word;far;
 var
   dos_env_seg: Word;
   ofs: Word;
@@ -142,14 +144,14 @@ begin
   dos_env_seg := PFarWord(Ptr(dos_psp, $2C))^;
   ofs := 1;
   repeat
-    Ch := Chr(PFarByte(Ptr(dos_env_seg,ofs - 1))^);
-    Ch2 := Chr(PFarByte(Ptr(dos_env_seg,ofs))^);
+    Ch := PFarChar(Ptr(dos_env_seg,ofs - 1))^;
+    Ch2 := PFarChar(Ptr(dos_env_seg,ofs))^;
     if (Ch = #0) and (Ch2 = #0) then
       begin
         Inc(ofs, 3);
         GetProgramName := '';
         repeat
-          Ch := Chr(PFarByte(Ptr(dos_env_seg,ofs))^);
+          Ch := PFarChar(Ptr(dos_env_seg,ofs))^;
           if Ch <> #0 then
             GetProgramName := GetProgramName + Ch;
           Inc(ofs);
@@ -170,6 +172,7 @@ begin
   until false;
 end;
 
+
 function paramcount : longint;
 begin
   paramcount := 0;