Browse Source

* removed warnings

peter 21 years ago
parent
commit
3094258825

+ 11 - 8
rtl/inc/dynarr.inc

@@ -30,12 +30,12 @@ type
       kind : byte;
       namelen : byte;
       { here the chars follow, we've to skip them }
-      elesize : t_size;
+      elesize : sizeint;
       eletype : pdynarraytypeinfo;
    end;
 
 
-function fpc_dynarray_rangecheck(p : pointer;i : tdynarrayindex) : tdynarrayindex;[Public,Alias:'FPC_DYNARRAY_RANGECHECK']; {$ifdef hascompilerproc} compilerproc; {$endif}
+procedure fpc_dynarray_rangecheck(p : pointer;i : tdynarrayindex);[Public,Alias:'FPC_DYNARRAY_RANGECHECK']; {$ifdef hascompilerproc} compilerproc; {$endif}
   begin
      if not(assigned(p)) or (i<0) or (i>pdynarray(p-sizeof(tdynarray))^.high) then
        HandleErrorFrame(201,get_frame);
@@ -63,7 +63,7 @@ function fpc_dynarray_high(p : pointer) : tdynarrayindex;[Public,Alias:'FPC_DYNA
 { releases and finalizes the data of a dyn. array and sets p to nil }
 procedure fpc_dynarray_clear_internal(p : pointer;ti : pointer);
   var
-    elesize : t_size;
+    elesize : sizeint;
     eletype : pdynarraytypeinfo;
   begin
      if p=nil then
@@ -153,15 +153,15 @@ procedure fpc_dynarray_setlength(var p : pointer;pti : pointer;
   dimcount : dword;dims : pdynarrayindex);[Public,Alias:'FPC_DYNARR_SETLENGTH']; {$ifdef hascompilerproc} compilerproc; {$endif}
 
   var
-     movelen: cardinal;
      i : tdynarrayindex;
-     size : t_size;
+     movelen,
+     size : sizeint;
      { contains the "fixed" pointers where the refcount }
      { and high are at positive offsets                 }
      realp,newp : pdynarray;
      ti : pdynarraytypeinfo;
      updatep: boolean;
-     elesize : t_size;
+     elesize : sizeint;
      eletype : pdynarraytypeinfo;
 
   begin
@@ -297,7 +297,7 @@ procedure fpc_dynarray_copy(var pdest : pointer;psrc : pointer;ti : pointer;
     cnt,
     i,size : longint;
     highidx : tdynarrayindex;
-    elesize : t_size;
+    elesize : sizeint;
     eletype : pdynarraytypeinfo;
   begin
      highidx:=lowidx+count-1;
@@ -344,7 +344,10 @@ procedure fpc_dynarray_copy(var pdest : pointer;psrc : pointer;ti : pointer;
 
 {
   $Log$
-  Revision 1.27  2004-05-31 14:31:57  peter
+  Revision 1.28  2004-05-31 20:25:04  peter
+    * removed warnings
+
+  Revision 1.27  2004/05/31 14:31:57  peter
     * remove comment warnings
 
   Revision 1.26  2004/05/24 07:18:17  michael

+ 5 - 3
rtl/inc/dynarrh.inc

@@ -17,13 +17,15 @@
 **********************************************************************}
 
 type
-   tdynarrayindex = longint;
+   tdynarrayindex = sizeint;
    pdynarrayindex = ^tdynarrayindex;
-   t_size = dword;
 
 {
   $Log$
-  Revision 1.2  2002-09-07 15:07:45  peter
+  Revision 1.3  2004-05-31 20:25:04  peter
+    * removed warnings
+
+  Revision 1.2  2002/09/07 15:07:45  peter
     * old logs removed and tabs fixed
 
 }

+ 15 - 12
rtl/inc/generic.inc

@@ -176,14 +176,15 @@ end;
 {$ifndef FPC_SYSTEM_HAS_INDEXDWORD}
 function IndexDWord(Const buf;len:longint;b:DWord):longint;
 type
-  longintarray = array [0..maxlongint div 4] of longint;
+  dwordarray = array [0..maxlongint div 4] of dword;
 var
   I : longint;
 begin
   I:=0;
   if (len < 0) then
     len := high(longint);
-  while (I<Len) and (longintarray(buf)[I]<>b) do inc(I);
+  while (I<Len) and (dwordarray(buf)[I]<>b) do
+    inc(I);
   if (i=Len) then
    i:=-1;           {Can't use 0, since it is a possible value for index}
   IndexDWord:=I;
@@ -202,7 +203,7 @@ end;
 {$ifndef FPC_SYSTEM_HAS_COMPAREBYTE}
 function CompareByte(Const buf1,buf2;len:longint):longint;
 type
-  bytearray    = array [0..maxlongint-1] of byte;
+  bytearray = array [0..maxlongint-1] of byte;
 var
   I : longint;
 begin
@@ -231,7 +232,7 @@ end;
 {$ifndef FPC_SYSTEM_HAS_COMPAREWORD}
 function CompareWord(Const buf1,buf2;len:longint):longint;
 type
-  wordarray    = array [0..maxlongint div 2] of word;
+  wordarray = array [0..maxlongint div 2] of word;
 var
   I : longint;
 begin
@@ -260,7 +261,7 @@ end;
 {$ifndef FPC_SYSTEM_HAS_COMPAREDWORD}
 function CompareDWord(Const buf1,buf2;len:longint):longint;
 type
-  longintarray    = array [0..maxlongint div 4] of longint;
+  longintarray = array [0..maxlongint div 4] of longint;
 var
   I : longint;
 begin
@@ -320,10 +321,9 @@ end;
 {$ifndef FPC_SYSTEM_HAS_COMPARECHAR0}
 function CompareChar0(Const buf1,buf2;len:longint):longint;
 type
-  bytearray    = array [0..maxlongint-1] of byte;
-
-Var i : longint;
-
+  bytearray = array [0..maxlongint-1] of byte;
+var
+  i : longint;
 begin
   I:=0;
   if (Len<>0) and (@Buf1<>@Buf2) then
@@ -1165,11 +1165,11 @@ var
      if (l shr 32=$80000000) and ((l and $ffffffff)=0) then
 {$else}
      if l=int64($8000000000000000) then
-{$endif}     
+{$endif}
        begin
          s:='-9223372036854775808';
          exit;
-       end; 
+       end;
      { handle case where l = 0 }
      if l = 0 then
        begin
@@ -1225,7 +1225,10 @@ end;
 
 {
   $Log$
-  Revision 1.78  2004-05-02 15:15:45  peter
+  Revision 1.79  2004-05-31 20:25:04  peter
+    * removed warnings
+
+  Revision 1.78  2004/05/02 15:15:45  peter
     * fix arguments for shortstr_compare
 
   Revision 1.77  2004/05/02 00:31:03  peter

+ 13 - 8
rtl/inc/genmath.inc

@@ -197,7 +197,7 @@ Function float32_to_int32_round_to_zero( a: Float32 ): longint;
     shiftCount := aExp - $9E;
     if ( 0 <= shiftCount ) then
       Begin
-        if ( a <> $CF000000 ) then
+        if ( a <> Float32($CF000000) ) then
           Begin
             if ( (aSign=0) or ( ( aExp = $FF ) and (aSig<>0) ) ) then
               Begin
@@ -223,7 +223,9 @@ Function float32_to_int32_round_to_zero( a: Float32 ): longint;
 
   function trunc(d : real) : int64;[internconst:in_const_trunc];
     var
+{$ifdef cpuarm}
      l: longint;
+{$endif cpuarm}
      f32 : float32;
      f64 : float64;
     Begin
@@ -629,25 +631,25 @@ Function float32_to_int32_round_to_zero( a: Float32 ): longint;
 {$endif hascompilerproc}
      var
       fr: Real;
-      tr: Real;
+      tr: Int64;
     Begin
        fr := abs(Frac(d));
        tr := Trunc(d);
        if fr > 0.5 then
          if d >= 0 then
-           result:=Trunc(d)+1
+           result:=tr+1
          else
-           result:=Trunc(d)-1
+           result:=tr-1
        else
        if fr < 0.5 then
-          result:=Trunc(d)
+          result:=tr
        else { fr = 0.5 }
           { check sign to decide ... }
           { as in Turbo Pascal...    }
           if d >= 0.0 then
-            result:=Trunc(d)+1
+            result:=tr+1
           else
-            result:=Trunc(d);
+            result:=tr;
     end;
 {$endif}
 
@@ -1186,7 +1188,10 @@ function fpc_int64_to_double(i : int64): double; compilerproc;
 
 {
   $Log$
-  Revision 1.23  2004-03-13 18:33:52  florian
+  Revision 1.24  2004-05-31 20:25:04  peter
+    * removed warnings
+
+  Revision 1.23  2004/03/13 18:33:52  florian
     * fixed some arm related real stuff
 
   Revision 1.22  2004/03/11 22:39:53  florian

+ 5 - 2
rtl/inc/real2str.inc

@@ -63,7 +63,7 @@ type
   TIntPartStack = array[1..maxDigits+1] of valReal;
 
 var
-  roundCorr, corrVal, factor, orgd: valReal;
+  roundCorr, corrVal, factor : valReal;
   spos, endpos, fracCount: longint;
   correct, currprec: longint;
   temp : string;
@@ -461,7 +461,10 @@ end;
 
 {
   $Log$
-  Revision 1.15  2004-03-13 18:47:57  florian
+  Revision 1.16  2004-05-31 20:25:04  peter
+    * removed warnings
+
+  Revision 1.15  2004/03/13 18:47:57  florian
     * "improved" behavior of real2str for arm, still needs fixing
 
   Revision 1.14  2004/03/13 18:33:52  florian

+ 25 - 18
rtl/inc/rtti.inc

@@ -87,13 +87,14 @@ Procedure fpc_Initialize (Data,TypeInfo : pointer);saveregisters;[Public,Alias :
 
 { this definition is sometimes (depending on switches)
   already defined or not so define it locally to avoid problems PM }
-Var Temp       : PByte;
-    I          : longint;
-    Size,Count : longint;
-    TInfo : Pointer;
+Var Temp    : PByte;
+    I,Count : longint;
 {$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}
     ArrayRec : TArrayRec;
-    RecElem : TRecElem;
+    RecElem  : TRecElem;
+{$else FPC_REQUIRES_PROPER_ALIGNMENT}
+    Size  : longint;
+    TInfo : Pointer;
 {$endif FPC_REQUIRES_PROPER_ALIGNMENT}
 begin
   Temp:=PByte(TypeInfo);
@@ -148,13 +149,14 @@ end;
 Procedure fpc_finalize (Data,TypeInfo: Pointer);saveregisters;[Public,Alias : 'FPC_FINALIZE'];  {$ifdef hascompilerproc} compilerproc; {$endif}
 { this definition is sometimes (depending on switches)
   already defined or not so define it locally to avoid problems PM }
-Var Temp       : PByte;
-    I          : longint;
-    Size,Count : longint;
-    TInfo : Pointer;
+Var Temp    : PByte;
+    I,Count : longint;
 {$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}
     ArrayRec : TArrayRec;
     RecElem : TRecElem;
+{$else FPC_REQUIRES_PROPER_ALIGNMENT}
+    Size  : longint;
+    TInfo : Pointer;
 {$endif FPC_REQUIRES_PROPER_ALIGNMENT}
 begin
   Temp:=PByte(TypeInfo);
@@ -220,13 +222,14 @@ Procedure fpc_Addref (Data,TypeInfo : Pointer);saveregisters; [Public,alias : 'F
 
 { this definition is sometimes (depending on switches)
   already defined or not so define it locally to avoid problems PM }
-Var Temp       : PByte;
-    I          : longint;
-    Size,Count : longint;
-    TInfo : Pointer;
+Var Temp    : PByte;
+    I,Count : longint;
 {$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}
     ArrayRec : TArrayRec;
     RecElem : TRecElem;
+{$else FPC_REQUIRES_PROPER_ALIGNMENT}
+    Size  : longint;
+    TInfo : Pointer;
 {$endif FPC_REQUIRES_PROPER_ALIGNMENT}
 begin
   Temp:=PByte(TypeInfo);
@@ -291,13 +294,14 @@ procedure fpc_systemDecRef (Data, TypeInfo : Pointer);saveregisters;[external na
 Procedure fpc_DecRef (Data, TypeInfo : Pointer);saveregisters;[Public,alias : 'FPC_DECREF'];  {$ifdef hascompilerproc} compilerproc; {$endif}
 { this definition is sometimes (depending on switches)
   already defined or not so define it locally to avoid problems PM }
-Var Temp       : PByte;
-    I          : longint;
-    Size,Count : longint;
-    TInfo : Pointer;
+Var Temp    : PByte;
+    I,Count : longint;
 {$ifdef FPC_REQUIRES_PROPER_ALIGNMENT}
     ArrayRec : TArrayRec;
     RecElem : TRecElem;
+{$else FPC_REQUIRES_PROPER_ALIGNMENT}
+    Size  : longint;
+    TInfo : Pointer;
 {$endif FPC_REQUIRES_PROPER_ALIGNMENT}
 begin
   Temp:=PByte(TypeInfo);
@@ -368,7 +372,10 @@ procedure fpc_finalize_array(data,typeinfo : pointer;count,size : longint); [Pub
 
 {
   $Log$
-  Revision 1.11  2004-03-27 23:22:38  florian
+  Revision 1.12  2004-05-31 20:25:04  peter
+    * removed warnings
+
+  Revision 1.11  2004/03/27 23:22:38  florian
     * fixed alignment issues
 
   Revision 1.10  2004/02/26 16:19:01  peter

+ 8 - 1
rtl/inc/variant.inc

@@ -72,10 +72,14 @@ End;
 
 function fpc_variant_to_dynarray(const v : variant;typeinfo : pointer) : pointer;compilerproc;
   begin
+{$warning TODO fpc_variant_to_dynarray}  
+    result:=nil;
   end;
 
 function fpc_dynarray_to_variant(const v : variant;typeinfo : pointer) : pointer;compilerproc;
   begin
+{$warning TODO fpc_dynarray_to_variant}  
+    result:=nil;
   end;
 
 { ---------------------------------------------------------------------
@@ -597,7 +601,10 @@ procedure initvariantmanager;
 
 {
   $Log$
-  Revision 1.16  2003-12-10 01:36:39  florian
+  Revision 1.17  2004-05-31 20:25:04  peter
+    * removed warnings
+
+  Revision 1.16  2003/12/10 01:36:39  florian
     * real functions ifdef'ed depending on the supported types
 
   Revision 1.15  2003/11/05 15:26:37  florian

+ 4 - 4
rtl/linux/osmain.inc

@@ -65,9 +65,6 @@ var
  execpathstr : shortstring;
 
 function paramstr(l: longint) : string;
- var
-  s: string;
-  s1: string;
  begin
    { stricly conforming POSIX applications  }
    { have the executing filename as argv[0] }
@@ -592,7 +589,10 @@ end;
 
 {
  $Log$
- Revision 1.18  2004-05-16 18:51:20  peter
+ Revision 1.19  2004-05-31 20:25:04  peter
+   * removed warnings
+
+ Revision 1.18  2004/05/16 18:51:20  peter
    * use thandle in do_*
 
  Revision 1.17  2004/05/01 15:59:17  florian

+ 8 - 4
rtl/linux/ossysc.inc

@@ -230,15 +230,16 @@ begin
 {$ifdef RTSIGACTION}
   {$ifdef cpusparc}
     { Sparc has an extra stub parameter }
-    do_syscall(syscall_nr_rt_sigaction,TSysParam(sig),TSysParam(act),TSysParam(oact),TSysParam(PtrInt(@Fprt_sigreturn_stub)-8),TSysParam(8));
+    Fpsigaction:=do_syscall(syscall_nr_rt_sigaction,TSysParam(sig),TSysParam(act),TSysParam(oact),TSysParam(PtrInt(@Fprt_sigreturn_stub)-8),TSysParam(8));
   {$else cpusparc}
-    do_syscall(syscall_nr_rt_sigaction,TSysParam(sig),TSysParam(act),TSysParam(oact),TSysParam(8));
+    Fpsigaction:=do_syscall(syscall_nr_rt_sigaction,TSysParam(sig),TSysParam(act),TSysParam(oact),TSysParam(8));
   {$endif cpusparc}
 {$else RTSIGACTION}
-  do_syscall(syscall_nr_sigaction,TSysParam(sig),TSysParam(act),TSysParam(oact));
+  Fpsigaction:=do_syscall(syscall_nr_sigaction,TSysParam(sig),TSysParam(act),TSysParam(oact));
 {$endif RTSIGACTION}
 end;
 
+
 function Fpftruncate(fd : cint; flength : off_t): cint; [public, alias : 'FPC_SYSC_FTRUNCATE'];
 { See notes lseek. This one is completely similar for the parameter (but
 doesn't have the returnvalue 64-bit problem)}
@@ -538,7 +539,10 @@ end;
 
 {
  $Log$
- Revision 1.27  2004-05-31 14:31:57  peter
+ Revision 1.28  2004-05-31 20:25:04  peter
+   * removed warnings
+
+ Revision 1.27  2004/05/31 14:31:57  peter
    * remove comment warnings
 
  Revision 1.26  2004/05/31 09:22:42  peter

+ 5 - 2
rtl/linux/sparc/sighnd.inc

@@ -20,7 +20,7 @@
 procedure SignalToRunerror(Sig: longint; SigContext: SigContextRec); cdecl;
 
 var
-  res,fpustate : word;
+  res : word;
 begin
   res:=0;
   case sig of
@@ -42,7 +42,10 @@ end;
 
 {
   $Log$
-  Revision 1.2  2003-11-06 16:28:52  peter
+  Revision 1.3  2004-05-31 20:25:04  peter
+    * removed warnings
+
+  Revision 1.2  2003/11/06 16:28:52  peter
     * compile fix
 
   Revision 1.1  2003/11/06 16:22:01  peter