Bladeren bron

* fixed more warnings and notes while compiling RTL.

git-svn-id: trunk@4259 -
yury 19 jaren geleden
bovenliggende
commit
5a49addb35
8 gewijzigde bestanden met toevoegingen van 16 en 10 verwijderingen
  1. 2 0
      rtl/inc/dos.inc
  2. 2 0
      rtl/inc/fexpand.inc
  3. 3 0
      rtl/inc/wstrings.inc
  4. 1 3
      rtl/win/sysutils.pp
  5. 2 2
      rtl/win/wininc/base.inc
  6. 1 1
      rtl/win/winsock2.pp
  7. 4 2
      rtl/win32/system.pp
  8. 1 2
      rtl/wince/sysutils.pp

+ 2 - 0
rtl/inc/dos.inc

@@ -214,6 +214,7 @@ end;
 ****************************************************************************}
 
 {$IFNDEF HAS_FSPLIT}
+{$warnings off}
 Procedure FSplit (Path: PathStr; var Dir: DirStr; var Name: NameStr; var Ext: ExtStr);
 var
   DirEnd, ExtStart: Longint;
@@ -266,6 +267,7 @@ begin
   Name := Copy (Path, DirEnd + 1, ExtStart - DirEnd - 1);
   Ext := Copy (Path, ExtStart, Length (Path) - ExtStart + 1);
 end;
+{$warnings on}
 {$ENDIF HAS_FSPLIT}
 
 

+ 2 - 0
rtl/inc/fexpand.inc

@@ -126,6 +126,7 @@ begin
 
 (* Allow both '/' and '\' as directory separators *)
 (* by converting all to the native one.           *)
+{$warnings off}
     if DirectorySeparator = '\' then
     {Allow slash as backslash}
       begin
@@ -141,6 +142,7 @@ begin
             if Pa [I] = '\' then
               Pa [I] := '/';
         end;
+{$warnings on}
 
 (* PathStart is amount of characters to strip to get beginning *)
 (* of path without volume/drive specification.                 *)

+ 3 - 0
rtl/inc/wstrings.inc

@@ -199,8 +199,10 @@ Procedure fpc_WideStr_Decr_Ref (Var S : Pointer);[Public,Alias:'FPC_WIDESTR_DECR
 }
 Type
   pSizeInt = ^SizeInt;
+{$ifndef FPC_WINLIKEWIDESTRING}
 Var
   l : pSizeInt;
+{$endif FPC_WINLIKEWIDESTRING}
 Begin
   { Zero string }
   if S=Nil then
@@ -765,6 +767,7 @@ procedure WideCharToStrVar(S : PWideChar;out Dest : AnsiString);
 Function fpc_widestr_Unique(Var S : Pointer): Pointer; [Public,Alias : 'FPC_WIDESTR_UNIQUE']; compilerproc;
 {$ifdef FPC_WINLIKEWIDESTRING}
   begin
+    pointer(result) := pointer(s);
   end;
 {$else FPC_WINLIKEWIDESTRING}
 {

+ 1 - 3
rtl/win/sysutils.pp

@@ -101,7 +101,7 @@ var
   s    : ansistring;
   size : dword;
   rc   : dword;
-  p,buf : pchar;
+  buf : pchar;
 begin
   s := ExpandFileName (filename);
 
@@ -852,8 +852,6 @@ Procedure LoadVersionInfo;
 // and getfreespaceex
 Var
    versioninfo : TOSVERSIONINFO;
-   i          : Integer;
-
 begin
    kernel32dll:=0;
   GetDiskFreeSpaceEx:=nil;

+ 2 - 2
rtl/win/wininc/base.inc

@@ -297,8 +297,8 @@
 
      _RASCONNSTATE = RASCONNSTATE;
 
-     RASPROJECTION = (RASP_Amb := $10000,RASP_PppNbf := $803F,RASP_PppIpx := $802B,
-       RASP_PppIp := $8021);
+     RASPROJECTION = (RASP_PppIp := $8021, RASP_PppIpx := $802B, RASP_PppNbf := $803F,
+       RASP_Amb := $10000);
 
      _RASPROJECTION = RASPROJECTION;
 

+ 1 - 1
rtl/win/winsock2.pp

@@ -1290,7 +1290,7 @@ end;
 
 procedure FD_CLR(Socket: TSocket; var FDSet: TFDSet);
 var
-  I: Longint;
+  I: cardinal;
 begin
   I := 0;
   while I < FDSet.fd_count do

+ 4 - 2
rtl/win32/system.pp

@@ -24,6 +24,8 @@ interface
   {$define Set_i386_Exception_handler}
 {$endif cpui386}
 
+{$define DISABLE_NO_THREAD_MANAGER}
+
 { include system-independent routine headers }
 {$I systemh.inc}
 
@@ -741,7 +743,7 @@ type
 type
   PExceptionRecord = ^TExceptionRecord;
   TExceptionRecord = packed record
-          ExceptionCode   : Longint;
+          ExceptionCode   : cardinal;
           ExceptionFlags  : Longint;
           ExceptionRecord : PExceptionRecord;
           ExceptionAddress : Pointer;
@@ -851,7 +853,7 @@ begin
     if IsConsole then Writeln(stderr,'Exception  ',
             hexstr(excep^.ExceptionRecord^.ExceptionCode, 8));
   {$endif SYSTEMEXCEPTIONDEBUG}
-    case cardinal(excep^.ExceptionRecord^.ExceptionCode) of
+    case excep^.ExceptionRecord^.ExceptionCode of
       STATUS_INTEGER_DIVIDE_BY_ZERO,
       STATUS_FLOAT_DIVIDE_BY_ZERO :
         err := 200;

+ 1 - 2
rtl/wince/sysutils.pp

@@ -199,8 +199,7 @@ end;
 
 Function FileSeek (Handle : THandle; FOffset,Origin : Int64) : Int64;
 begin
-  {$warning need to add 64bit call }
-  Result := longint(SetFilePointer(Handle, longint(FOffset), nil, longint(Origin)));
+  Result := SetFilePointer(Handle, longint(FOffset), nil, longint(Origin));
 end;