Browse Source

* tai_const.create_32bit changed to cardinal

peter 21 years ago
parent
commit
84b1451a34
6 changed files with 60 additions and 40 deletions
  1. 7 4
      compiler/aasmtai.pas
  2. 10 6
      compiler/cresstr.pas
  3. 6 3
      compiler/ncgcon.pas
  4. 6 3
      compiler/nobj.pas
  5. 15 11
      compiler/ptconst.pas
  6. 16 13
      compiler/symdef.pas

+ 7 - 4
compiler/aasmtai.pas

@@ -333,8 +333,8 @@ interface
 
        { Generates a long integer (32 bit) }
        tai_const = class(tai)
-          value : longint;
-          constructor Create_32bit(_value : longint);
+          value : cardinal;
+          constructor Create_32bit(_value : cardinal);
           constructor Create_16bit(_value : word);
           constructor Create_8bit(_value : byte);
           constructor ppuload(t:taitype;ppufile:tcompilerppufile);override;
@@ -881,7 +881,7 @@ implementation
                                TAI_CONST
  ****************************************************************************}
 
-    constructor tai_const.Create_32bit(_value : longint);
+    constructor tai_const.Create_32bit(_value : cardinal);
 
       begin
          inherited Create;
@@ -2188,7 +2188,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.58  2003-12-06 22:16:12  jonas
+  Revision 1.59  2003-12-08 22:34:24  peter
+    * tai_const.create_32bit changed to cardinal
+
+  Revision 1.58  2003/12/06 22:16:12  jonas
     * completely overhauled and fixed generic spilling code. New method:
       spilling_get_operation_type(operand_number): returns the operation
       performed by the instruction on the operand: read/write/read+write.

+ 10 - 6
compiler/cresstr.pas

@@ -34,8 +34,8 @@ Type
   TResourceStringItem = class(TLinkedListItem)
     Name  : String;
     Value : Pchar;
-    Len,
-    hash  : longint;
+    Len   : Longint;
+    hash  : Cardinal;
     constructor Create(const AName:string;AValue:pchar;ALen:longint);
     destructor  Destroy;override;
     procedure CalcHash;
@@ -98,7 +98,8 @@ end;
 
 procedure TResourceStringItem.CalcHash;
 Var
-  g,I : longint;
+  g : Cardinal;
+  I : longint;
 begin
   hash:=0;
   For I:=0 to Len-1 do { 0 terminated }
@@ -161,7 +162,7 @@ procedure TResourceStrings.CreateResourceStringList;
             consts.concat(tai_align.Create(const_align(pointer_size)));
             consts.concat(tai_const.create_32bit(len));
             consts.concat(tai_const.create_32bit(len));
-            consts.concat(tai_const.create_32bit(-1));
+            consts.concat(tai_const.create_32bit(cardinal(-1)));
             consts.concat(tai_label.create(l1));
             getmem(s,len+1);
             move(Value^,s^,len);
@@ -179,7 +180,7 @@ procedure TResourceStrings.CreateResourceStringList;
        consts.concat(tai_align.Create(const_align(pointer_size)));
        consts.concat(tai_const.create_32bit(l));
        consts.concat(tai_const.create_32bit(l));
-       consts.concat(tai_const.create_32bit(-1));
+       consts.concat(tai_const.create_32bit(cardinal(-1)));
        consts.concat(tai_label.create(l1));
        getmem(s,l+1);
        move(Name[1],s^,l);
@@ -299,7 +300,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.18  2003-10-29 19:48:50  peter
+  Revision 1.19  2003-12-08 22:34:24  peter
+    * tai_const.create_32bit changed to cardinal
+
+  Revision 1.18  2003/10/29 19:48:50  peter
     * renamed mangeldname_prefix to make_mangledname and made it more
       generic
     * make_mangledname is now also used for internal threadvar/resstring

+ 6 - 3
compiler/ncgcon.pas

@@ -343,7 +343,7 @@ implementation
                                 Consts.concat(Tai_const_symbol.Create(l1));
                                 Consts.concat(Tai_const.Create_32bit(len));
                                 Consts.concat(Tai_const.Create_32bit(len));
-                                Consts.concat(Tai_const.Create_32bit(-1));
+                                Consts.concat(Tai_const.Create_32bit(Cardinal(-1)));
                                 Consts.concat(Tai_label.Create(l1));
                                 getmem(pc,len+2);
                                 move(value_str^,pc^,len);
@@ -372,7 +372,7 @@ implementation
                                 { Consts.concat(Tai_const.Create_8bit(2)); }
                                 Consts.concat(Tai_const.Create_32bit(len));
                                 Consts.concat(Tai_const.Create_32bit(len));
-                                Consts.concat(Tai_const.Create_32bit(-1));
+                                Consts.concat(Tai_const.Create_32bit(Cardinal(-1)));
                                 Consts.concat(Tai_label.Create(l1));
                                 for i:=0 to len-1 do
                                   Consts.concat(Tai_const.Create_16bit(pcompilerwidestring(value_str)^.data[i]));
@@ -559,7 +559,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.33  2003-10-26 13:37:22  florian
+  Revision 1.34  2003-12-08 22:34:24  peter
+    * tai_const.create_32bit changed to cardinal
+
+  Revision 1.33  2003/10/26 13:37:22  florian
     * fixed web bug 2128
 
   Revision 1.32  2003/10/10 17:48:13  peter

+ 6 - 3
compiler/nobj.pas

@@ -1147,7 +1147,7 @@ implementation
           if (cs_create_smart in aktmoduleswitches) then
             dataSegment.concat(Tai_cut.Create);
           dataSegment.concat(Tai_symbol.Createname_global(make_mangledname('IID',_class.owner,_class.objname^),0));
-          dataSegment.concat(Tai_const.Create_32bit(longint(_class.iidguid^.D1)));
+          dataSegment.concat(Tai_const.Create_32bit(_class.iidguid^.D1));
           dataSegment.concat(Tai_const.Create_16bit(_class.iidguid^.D2));
           dataSegment.concat(Tai_const.Create_16bit(_class.iidguid^.D3));
           for i:=Low(_class.iidguid^.D4) to High(_class.iidguid^.D4) do
@@ -1265,7 +1265,7 @@ implementation
          { determine the size with symtable.datasize, because }
          { size gives back 4 for classes                    }
          dataSegment.concat(Tai_const.Create_32bit(tobjectsymtable(_class.symtable).datasize));
-         dataSegment.concat(Tai_const.Create_32bit(-tobjectsymtable(_class.symtable).datasize));
+         dataSegment.concat(Tai_const.Create_32bit(Cardinal(-tobjectsymtable(_class.symtable).datasize)));
 {$ifdef WITHDMT}
          if _class.classtype=ct_object then
            begin
@@ -1370,7 +1370,10 @@ initialization
 end.
 {
   $Log$
-  Revision 1.56  2003-11-28 17:24:22  peter
+  Revision 1.57  2003-12-08 22:34:24  peter
+    * tai_const.create_32bit changed to cardinal
+
+  Revision 1.56  2003/11/28 17:24:22  peter
     * reversed offset calculation for caller side so it works
       correctly for interfaces
 

+ 15 - 11
compiler/ptconst.pas

@@ -187,13 +187,13 @@ implementation
                            begin
                               if target_info.endian = endian_little then
                                 begin
-                                  curconstSegment.concat(Tai_const.Create_32bit(tordconstnode(p).value and $ffffffff));
-                                  curconstSegment.concat(Tai_const.Create_32bit(tordconstnode(p).value shr 32));
+                                  curconstSegment.concat(Tai_const.Create_32bit(Cardinal(tordconstnode(p).value and $ffffffff)));
+                                  curconstSegment.concat(Tai_const.Create_32bit(Cardinal(tordconstnode(p).value shr 32)));
                                 end
                               else
                                 begin
-                                  curconstSegment.concat(Tai_const.Create_32bit(tordconstnode(p).value shr 32));
-                                  curconstSegment.concat(Tai_const.Create_32bit(tordconstnode(p).value  and $ffffffff));
+                                  curconstSegment.concat(Tai_const.Create_32bit(Cardinal(tordconstnode(p).value shr 32)));
+                                  curconstSegment.concat(Tai_const.Create_32bit(Cardinal(tordconstnode(p).value and $ffffffff)));
                                 end;
                            end
                          else
@@ -281,9 +281,10 @@ implementation
                    p:=hp;
                 end;
               { const pointer ? }
+{$warning 32bit pointer assumption}
               if (p.nodetype = pointerconstn) then
                 curconstsegment.concat(Tai_const.Create_32bit(
-                  tpointerconstnode(p).value))
+                  Cardinal(tpointerconstnode(p).value)))
               { nil pointer ? }
               else if p.nodetype=niln then
                 curconstSegment.concat(Tai_const.Create_32bit(0))
@@ -489,9 +490,9 @@ implementation
                      is_subequal(p.resulttype.def,t.def) then
                    begin
                      case p.resulttype.def.size of
-                       1 : curconstSegment.concat(Tai_const.Create_8bit(tordconstnode(p).value));
-                       2 : curconstSegment.concat(Tai_const.Create_16bit(tordconstnode(p).value));
-                       4 : curconstSegment.concat(Tai_const.Create_32bit(tordconstnode(p).value));
+                       1 : curconstSegment.concat(Tai_const.Create_8bit(Byte(tordconstnode(p).value)));
+                       2 : curconstSegment.concat(Tai_const.Create_16bit(Word(tordconstnode(p).value)));
+                       4 : curconstSegment.concat(Tai_const.Create_32bit(Cardinal(tordconstnode(p).value)));
                      end;
                    end
                   else
@@ -576,7 +577,7 @@ implementation
                             Consts.concat(Tai_const.Create_32bit(strlength));
                             { redondent with maxlength but who knows ... (PM) }
                             { third write use count (set to -1 for safety ) }
-                            Consts.concat(Tai_const.Create_32bit(-1));
+                            Consts.concat(Tai_const.Create_32bit(Cardinal(-1)));
                             Consts.concat(Tai_label.Create(ll));
                             getmem(ca,strlength+2);
                             move(strval^,ca^,strlength);
@@ -601,7 +602,7 @@ implementation
                             Consts.concat(tai_align.create(const_align(pointer_size)));
                             Consts.concat(Tai_const.Create_32bit(strlength));
                             Consts.concat(Tai_const.Create_32bit(strlength));
-                            Consts.concat(Tai_const.Create_32bit(-1));
+                            Consts.concat(Tai_const.Create_32bit(Cardinal(-1)));
                             Consts.concat(Tai_label.Create(ll));
                             for i:=0 to strlength-1 do
                               Consts.concat(Tai_const.Create_16bit(pcompilerwidestring(strval)^.data[i]));
@@ -1001,7 +1002,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.75  2003-11-22 00:32:35  jonas
+  Revision 1.76  2003-12-08 22:34:24  peter
+    * tai_const.create_32bit changed to cardinal
+
+  Revision 1.75  2003/11/22 00:32:35  jonas
     * fixed reversed "got <type 1>, expected <type 1>" error message
 
   Revision 1.74  2003/11/12 16:05:39  florian

+ 16 - 13
compiler/symdef.pas

@@ -1713,8 +1713,8 @@ implementation
             4:
               rttiList.concat(Tai_const.Create_8bit(otULong));
          end;
-         rttiList.concat(Tai_const.Create_32bit(min));
-         rttiList.concat(Tai_const.Create_32bit(max));
+         rttiList.concat(Tai_const.Create_32bit(Cardinal(min)));
+         rttiList.concat(Tai_const.Create_32bit(Cardinal(max)));
          if assigned(basedef) then
            rttiList.concat(Tai_const_symbol.Create(basedef.get_rtti_label(rt)))
          else
@@ -1886,8 +1886,8 @@ implementation
         begin
           write_rtti_name;
           rttiList.concat(Tai_const.Create_8bit(byte(trans[typ])));
-          rttiList.concat(Tai_const.Create_32bit(longint(low)));
-          rttiList.concat(Tai_const.Create_32bit(longint(high)));
+          rttiList.concat(Tai_const.Create_32bit(Cardinal(low)));
+          rttiList.concat(Tai_const.Create_32bit(Cardinal(high)));
         end;
 
       begin
@@ -1900,19 +1900,19 @@ implementation
                 begin
                   { low }
                   rttiList.concat(Tai_const.Create_32bit($0));
-                  rttiList.concat(Tai_const.Create_32bit(longint($80000000)));
+                  rttiList.concat(Tai_const.Create_32bit(cardinal($80000000)));
                   { high }
-                  rttiList.concat(Tai_const.Create_32bit(longint($ffffffff)));
-                  rttiList.concat(Tai_const.Create_32bit($7fffffff));
+                  rttiList.concat(Tai_const.Create_32bit(cardinal($ffffffff)));
+                  rttiList.concat(Tai_const.Create_32bit(cardinal($7fffffff)));
                 end
               else
                 begin
                   { low }
-                  rttiList.concat(Tai_const.Create_32bit(longint($80000000)));
+                  rttiList.concat(Tai_const.Create_32bit(cardinal($80000000)));
                   rttiList.concat(Tai_const.Create_32bit($0));
                   { high }
-                  rttiList.concat(Tai_const.Create_32bit($7fffffff));
-                  rttiList.concat(Tai_const.Create_32bit(longint($ffffffff)));
+                  rttiList.concat(Tai_const.Create_32bit(cardinal($7fffffff)));
+                  rttiList.concat(Tai_const.Create_32bit(cardinal($ffffffff)));
                 end;
             end;
           u64bit :
@@ -1923,8 +1923,8 @@ implementation
               rttiList.concat(Tai_const.Create_32bit($0));
               rttiList.concat(Tai_const.Create_32bit($0));
               { high }
-              rttiList.concat(Tai_const.Create_32bit(longint($ffffffff)));
-              rttiList.concat(Tai_const.Create_32bit(longint($ffffffff)));
+              rttiList.concat(Tai_const.Create_32bit(cardinal($ffffffff)));
+              rttiList.concat(Tai_const.Create_32bit(cardinal($ffffffff)));
             end;
           bool8bit:
             begin
@@ -6117,7 +6117,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.190  2003-11-10 22:02:52  peter
+  Revision 1.191  2003-12-08 22:34:24  peter
+    * tai_const.create_32bit changed to cardinal
+
+  Revision 1.190  2003/11/10 22:02:52  peter
     * cross unit inlining fixed
 
   Revision 1.189  2003/11/08 23:31:27  florian