* replace constants to formal const with variables

git-svn-id: trunk@10425 -
This commit is contained in:
peter 2008-03-02 14:01:22 +00:00
parent 85e904cb36
commit f915cbc4ca
2 changed files with 17 additions and 10 deletions

View File

@ -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);

View File

@ -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;