Jelajahi Sumber

* fixed some typecasts of pointers to Longint for 64 bit architectures (Linux and generic parts of the RTL only)
* 64 bit sockets unit fixes

git-svn-id: trunk@1625 -

tom_at_work 20 tahun lalu
induk
melakukan
653f4b465d

+ 1 - 1
rtl/inc/cgeneric.inc

@@ -73,7 +73,7 @@ begin
   { unsigned)                                                       }
   res := memchr(buf,longint(b),cardinal(len));
   if (res <> nil) then
-    IndexChar := longint(res-@buf)
+    IndexChar := SizeInt(res-@buf)
   else
     IndexChar := -1;
 end;

+ 5 - 5
rtl/inc/getopts.pp

@@ -97,16 +97,16 @@ begin
   repeat
   { skip leading spaces }
     while cmdline^ in [' ',#9,#13] do
-     inc(longint(cmdline));
+     inc(PtrInt(cmdline));
     case cmdline^ of
       #0 : break;
      '"' : begin
              quote:=['"'];
-             inc(longint(cmdline));
+             inc(PtrInt(cmdline));
            end;
     '''' : begin
              quote:=[''''];
-             inc(longint(cmdline));
+             inc(PtrInt(cmdline));
            end;
     else
      quote:=[' ',#9,#13];
@@ -114,7 +114,7 @@ begin
   { scan until the end of the argument }
     argstart:=cmdline;
     while (cmdline^<>#0) and not(cmdline^ in quote) do
-     inc(longint(cmdline));
+     inc(PtrInt(cmdline));
   { reserve some memory }
     arglen:=cmdline-argstart;
     getmem(argsbuf[count],arglen+1);
@@ -122,7 +122,7 @@ begin
     argsbuf[count][arglen]:=#0;
   { skip quote }
     if cmdline^ in quote then
-     inc(longint(cmdline));
+     inc(PtrInt(cmdline));
     inc(count);
   until false;
 { create argc }

+ 1 - 1
rtl/linux/tthread.inc

@@ -197,7 +197,7 @@ begin
   FSuspendedExternal := false;
   FInitialSuspended := CreateSuspended;
   FFatalException := nil;
-  WRITE_DEBUG('creating thread, self = ',longint(self));
+  WRITE_DEBUG('creating thread, self = ', PtrInt(self));
   FHandle:= BeginThread(@ThreadFunc, Pointer(Self), FThreadID, StackSize);
   WRITE_DEBUG('TThread.Create done');
 end;

+ 4 - 4
rtl/linux/unixsock.inc

@@ -48,9 +48,9 @@ Const
   Socket_Sys_RECVMSG     = 17;
 
 
-Function SocketCall(SockCallNr,a1,a2,a3,a4,a5,a6:longint):longint;
+Function SocketCall(SockCallNr,a1,a2,a3,a4,a5,a6:TSysParam):longint;
 var
-  Args:array[1..6] of longint;
+  Args:array[1..6] of TSysParam;
 begin
   args[1]:=a1;
   args[2]:=a2;
@@ -58,7 +58,7 @@ begin
   args[4]:=a4;
   args[5]:=a5;
   args[6]:=a6;
-  SocketCall:=do_Syscall(syscall_nr_socketcall,sockcallnr,longint(@args));
+  SocketCall:=do_Syscall(syscall_nr_socketcall,sockcallnr,TSysParam(@args));
   If SocketCall<0 then
    SocketError:=fpgetErrno
   else
@@ -66,7 +66,7 @@ begin
 end;
 
 
-function SocketCall(SockCallNr,a1,a2,a3:longint):longint;
+function SocketCall(SockCallNr,a1,a2,a3:TSysParam):longint;
 begin
   SocketCall:=SocketCall(SockCallNr,a1,a2,a3,0,0,0);
 end;

+ 1 - 1
rtl/objpas/sysutils/sysstr.inc

@@ -2217,7 +2217,7 @@ function sscanf(const s: string; const fmt : string;const Pointers : array of Po
             begin
               if GetInt>0 then
                 begin
-                  plongint(Pointers[i])^:=StrToInt(s1);
+                  pPtrInt(Pointers[i])^:=StrToInt(s1);
                   inc(Result);
                 end
               else