Răsfoiți Sursa

* replace constants to formal const with variables

git-svn-id: trunk@10425 -
peter 17 ani în urmă
părinte
comite
f915cbc4ca
2 a modificat fișierele cu 17 adăugiri și 10 ștergeri
  1. 3 2
      compiler/ogcoff.pas
  2. 14 8
      compiler/scanner.pas

+ 3 - 2
compiler/ogcoff.pas

@@ -771,7 +771,7 @@ const pemagic : array[0..3] of byte = (
 
     procedure TCoffObjSection.fixuprelocs;
       var
-        i        : longint;
+        i,zero   : longint;
         objreloc : TObjRelocation;
         address,
         relocval : aint;
@@ -788,7 +788,8 @@ const pemagic : array[0..3] of byte = (
             if objreloc.typ=RELOC_ZERO then
               begin
                 data.Seek(objreloc.dataoffset);
-                data.Write(0,4);
+                zero:=0;
+                data.Write(zero,4);
                 continue;
               end;
             data.Seek(objreloc.dataoffset);

+ 14 - 8
compiler/scanner.pas

@@ -1930,6 +1930,8 @@ In case not, the value returned can be arbitrary.
 
 
     procedure tscannerfile.recordtoken;
+      var
+        a : array[0..1] of byte;
       begin
         if not assigned(recordtokenbuf) then
           internalerror(200511176);
@@ -1937,8 +1939,9 @@ In case not, the value returned can be arbitrary.
         if CompareByte(current_settings,last_settings,sizeof(current_settings))<>0 then
           begin
             { use a special token to record it }
-            recordtokenbuf.write(_GENERICSPECIALTOKEN,1);
-            recordtokenbuf.write(ST_LOADSETTINGS,1);
+            a[0]:=byte(_GENERICSPECIALTOKEN);
+            a[1]:=byte(ST_LOADSETTINGS);
+            recordtokenbuf.write(a,2);
             recordtokenbuf.write(current_settings,sizeof(current_settings));
             last_settings:=current_settings;
           end;
@@ -1946,22 +1949,25 @@ In case not, the value returned can be arbitrary.
         { file pos changes? }
         if current_tokenpos.line<>last_filepos.line then
           begin
-            recordtokenbuf.write(_GENERICSPECIALTOKEN,1);
-            recordtokenbuf.write(ST_LINE,1);
+            a[0]:=byte(_GENERICSPECIALTOKEN);
+            a[1]:=byte(ST_LINE);
+            recordtokenbuf.write(a,2);
             recordtokenbuf.write(current_tokenpos.line,sizeof(current_tokenpos.line));
             last_filepos.line:=current_tokenpos.line;
           end;
         if current_tokenpos.column<>last_filepos.column then
           begin
-            recordtokenbuf.write(_GENERICSPECIALTOKEN,1);
-            recordtokenbuf.write(ST_COLUMN,1);
+            a[0]:=byte(_GENERICSPECIALTOKEN);
+            a[1]:=byte(ST_COLUMN);
+            recordtokenbuf.write(a,2);
             recordtokenbuf.write(current_tokenpos.column,sizeof(current_tokenpos.column));
             last_filepos.column:=current_tokenpos.column;
           end;
         if current_tokenpos.fileindex<>last_filepos.fileindex then
           begin
-            recordtokenbuf.write(_GENERICSPECIALTOKEN,1);
-            recordtokenbuf.write(ST_FILEINDEX,1);
+            a[0]:=byte(_GENERICSPECIALTOKEN);
+            a[1]:=byte(ST_FILEINDEX);
+            recordtokenbuf.write(a,2);
             recordtokenbuf.write(current_tokenpos.fileindex,sizeof(current_tokenpos.fileindex));
             last_filepos.fileindex:=current_tokenpos.fileindex;
           end;