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

View File

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