- removed some unused variables

* fixed some (harmless) ptrint warnings
  - removed some commented code in agppcmpw
  * added one missing field in a typed constant in cp1251

git-svn-id: trunk@8081 -
This commit is contained in:
Jonas Maebe 2007-07-17 13:57:15 +00:00
parent 920660c460
commit 28bab3fb4f
26 changed files with 27 additions and 109 deletions

View File

@ -443,13 +443,10 @@ implementation
do_line : boolean; do_line : boolean;
sepChar : char; sepChar : char;
nextdwarffileidx : longint;
begin begin
if not assigned(p) then if not assigned(p) then
exit; exit;
nextdwarffileidx:=1;
last_align := 2; last_align := 2;
InlineLevel:=0; InlineLevel:=0;
{ lineinfo is only needed for al_procedures (PFV) } { lineinfo is only needed for al_procedures (PFV) }
@ -995,9 +992,6 @@ implementation
if CurrSecType<>sec_none then if CurrSecType<>sec_none then
WriteSection(CurrSecType,'',secorder_default); WriteSection(CurrSecType,'',secorder_default);
AsmStartSize:=AsmSize; AsmStartSize:=AsmSize;
{ reset dwarf file index }
nextdwarffileidx:=1;
end; end;
end; end;

View File

@ -177,9 +177,9 @@ implementation
Result:=0; Result:=0;
end end
else else
Result:=PtrInt(DirectoryEntries.Find(Lower(AName))) Result:=PtrUInt(DirectoryEntries.Find(Lower(AName)))
else else
Result:=PtrInt(DirectoryEntries.Find(AName)); Result:=PtrUInt(DirectoryEntries.Find(AName));
end; end;
@ -367,7 +367,7 @@ implementation
else else
begin begin
Res.Name:=Res.CachedDir.DirectoryEntries.NameOfIndex(Res.EntryIndex); Res.Name:=Res.CachedDir.DirectoryEntries.NameOfIndex(Res.EntryIndex);
Res.Attr:=PtrInt(Res.CachedDir.DirectoryEntries[Res.EntryIndex]); Res.Attr:=PtrUInt(Res.CachedDir.DirectoryEntries[Res.EntryIndex]);
end; end;
inc(Res.EntryIndex); inc(Res.EntryIndex);
Result:=true; Result:=true;

View File

@ -199,7 +199,7 @@ function sub_from(const a:Tconstexprint;b:qword):Tconstexprint;
const abs_low_int64=qword(9223372036854775808); {abs(low(int64)) -> overflow error} const abs_low_int64=qword(9223372036854775808); {abs(low(int64)) -> overflow error}
var sspace,uspace:qword; var sspace:qword;
label try_qword,ov; label try_qword,ov;
@ -375,7 +375,6 @@ end;
operator mod (const a,b:Tconstexprint):Tconstexprint; operator mod (const a,b:Tconstexprint):Tconstexprint;
var aa,bb:qword; var aa,bb:qword;
sa,sb:boolean;
begin begin
if a.overflow or b.overflow then if a.overflow or b.overflow then
@ -385,25 +384,13 @@ begin
end; end;
result.overflow:=false; result.overflow:=false;
if a.signed then if a.signed then
begin aa:=qword(a.svalue)
aa:=qword(a.svalue);
sa:=a.svalue<0;
end
else else
begin aa:=a.uvalue;
aa:=a.uvalue;
sa:=false;
end;
if b.signed then if b.signed then
begin bb:=qword(b.svalue)
bb:=qword(b.svalue);
sb:=b.svalue<0;
end
else else
begin bb:=b.uvalue;
bb:=b.uvalue;
sb:=false;
end;
if bb=0 then if bb=0 then
result.overflow:=true result.overflow:=true
else else

View File

@ -162,7 +162,7 @@ unit cp1251;
(unicode : 8226; flag : umf_noinfo; reserved : 0), (unicode : 8226; flag : umf_noinfo; reserved : 0),
(unicode : 8211; flag : umf_noinfo; reserved : 0), (unicode : 8211; flag : umf_noinfo; reserved : 0),
(unicode : 8212; flag : umf_noinfo; reserved : 0), (unicode : 8212; flag : umf_noinfo; reserved : 0),
(unicode : 65535; flag : umf_unused), (unicode : 65535; flag : umf_unused; reserved : 0),
(unicode : 8482; flag : umf_noinfo; reserved : 0), (unicode : 8482; flag : umf_noinfo; reserved : 0),
(unicode : 1113; flag : umf_noinfo; reserved : 0), (unicode : 1113; flag : umf_noinfo; reserved : 0),
(unicode : 8250; flag : umf_noinfo; reserved : 0), (unicode : 8250; flag : umf_noinfo; reserved : 0),

View File

@ -462,7 +462,7 @@ begin
begin begin
Result:=FSize-FPosition; Result:=FSize-FPosition;
If Result>Count then Result:=Count; If Result>Count then Result:=Count;
Move (Pointer(PtrInt(FMemory)+FPosition)^,Buffer,Result); Move (Pointer(PtrUInt(FMemory)+FPosition)^,Buffer,Result);
FPosition:=Fposition+Result; FPosition:=Fposition+Result;
end; end;
end; end;
@ -613,7 +613,7 @@ begin
SetCapacity (NewPos); SetCapacity (NewPos);
FSize:=Newpos; FSize:=Newpos;
end; end;
System.Move (Buffer,Pointer(Ptrint(FMemory)+FPosition)^,Count); System.Move (Buffer,Pointer(Ptruint(FMemory)+FPosition)^,Count);
FPosition:=NewPos; FPosition:=NewPos;
Result:=Count; Result:=Count;
end; end;

View File

@ -1620,8 +1620,6 @@ implementation
var var
procendlabel : tasmlabel; procendlabel : tasmlabel;
funcrettype : tasmsymbol; funcrettype : tasmsymbol;
mangled_length : longint;
p : pchar;
procentry : string; procentry : string;
dreg : byte; dreg : byte;
begin begin
@ -2489,7 +2487,6 @@ implementation
lastfileinfo : tfileposinfo; lastfileinfo : tfileposinfo;
currfuncname : pshortstring; currfuncname : pshortstring;
currsectype : TAsmSectiontype; currsectype : TAsmSectiontype;
hlabel : tasmlabel;
hp : tai; hp : tai;
infile : tinputfile; infile : tinputfile;
prevcolumn, prevcolumn,

View File

@ -413,9 +413,8 @@ implementation
constructor tmodule.create(LoadedFrom:TModule;const s:string;_is_unit:boolean); constructor tmodule.create(LoadedFrom:TModule;const s:string;_is_unit:boolean);
var var
p,n : string; n : string;
begin begin
p:=ExtractFilePath(s);
n:=ChangeFileExt(ExtractFileName(s),''); n:=ChangeFileExt(ExtractFileName(s),'');
{ Programs have the name 'Program' to don't conflict with dup id's } { Programs have the name 'Program' to don't conflict with dup id's }
if _is_unit then if _is_unit then

View File

@ -982,8 +982,6 @@ uses
procedure tppumodule.writeppu; procedure tppumodule.writeppu;
var
pu : tused_unit;
begin begin
Message1(unit_u_ppu_write,realmodulename^); Message1(unit_u_ppu_write,realmodulename^);
@ -1195,11 +1193,9 @@ uses
procedure tppumodule.load_usedunits; procedure tppumodule.load_usedunits;
var var
pu : tused_unit; pu : tused_unit;
load_refs : boolean;
begin begin
if current_module<>self then if current_module<>self then
internalerror(200212284); internalerror(200212284);
load_refs:=true;
{ load the used units from interface } { load the used units from interface }
in_interface:=true; in_interface:=true;

View File

@ -487,7 +487,7 @@ implementation
procedure TLinkStrMap.Expand(Src:TCmdStrList;Dest:TLinkStrMap); procedure TLinkStrMap.Expand(Src:TCmdStrList;Dest:TLinkStrMap);
// expands every thing in Src to Dest for linkorder purposes. // expands every thing in Src to Dest for linkorder purposes.
var var
l,r : longint; r : longint;
LibN : TCmdStr; LibN : TCmdStr;
begin begin
while not src.empty do while not src.empty do
@ -1082,8 +1082,6 @@ implementation
end; end;
procedure InitGlobals; procedure InitGlobals;
var
i : tfeature;
begin begin
get_exepath; get_exepath;

View File

@ -2339,8 +2339,7 @@ implementation
end; end;
var var
paraidx, paraidx : integer;
res: integer;
currpara, bestpara: tparavarsym; currpara, bestpara: tparavarsym;
currvcl, bestvcl: tvariantequaltype; currvcl, bestvcl: tvariantequaltype;
begin begin

View File

@ -1684,7 +1684,7 @@ implementation
var var
p: tnode; p: tnode;
newstatement : tstatementnode; newstatement : tstatementnode;
tempnode,tempnode2 : ttempcreatenode; tempnode (*,tempnode2*) : ttempcreatenode;
cmpfuncname: string; cmpfuncname: string;
begin begin
{ when we get here, we are sure that both the left and the right } { when we get here, we are sure that both the left and the right }

View File

@ -443,8 +443,6 @@ implementation
function tblocknode.simplify: tnode; function tblocknode.simplify: tnode;
var
hp, next: tstatementnode;
begin begin
result := nil; result := nil;
{ Warning: never replace a blocknode with another node type, } { Warning: never replace a blocknode with another node type, }

View File

@ -1422,7 +1422,6 @@ implementation
objectdf : tobjectdef; objectdf : tobjectdef;
parents : tlinkedlist; parents : tlinkedlist;
objectinfo : tobjectinfoitem; objectinfo : tobjectinfoitem;
stritem : TCmdStrListItem;
pd : tprocdef; pd : tprocdef;
i : integer; i : integer;
first : boolean; first : boolean;

View File

@ -2138,9 +2138,11 @@ implementation
****************************************************************************} ****************************************************************************}
procedure gen_external_stub(list:TAsmList;pd:tprocdef;const externalname:string); procedure gen_external_stub(list:TAsmList;pd:tprocdef;const externalname:string);
{$ifdef x86}
var var
ref : treference; ref : treference;
sym : tasmsymbol; sym : tasmsymbol;
{$endif x86}
begin begin
{ add the procedure to the al_procedures } { add the procedure to the al_procedures }
maybe_new_object_file(list); maybe_new_object_file(list);
@ -2765,8 +2767,10 @@ implementation
procedure gen_pic_helpers(list : TAsmList); procedure gen_pic_helpers(list : TAsmList);
{$ifdef i386}
var var
href : treference; href : treference;
{$endif i386}
begin begin
{ if other cpus require such helpers as well, it can be solved more cleaner } { if other cpus require such helpers as well, it can be solved more cleaner }
{$ifdef i386} {$ifdef i386}

View File

@ -853,7 +853,6 @@ implementation
filetemp : Ttempcreatenode; filetemp : Ttempcreatenode;
name : string[31]; name : string[31];
textsym : ttypesym; textsym : ttypesym;
readfunctype : tdef;
is_typed, is_typed,
do_read, do_read,
is_rwstr, is_rwstr,

View File

@ -104,7 +104,6 @@ implementation
function tmoddivnode.simplify:tnode; function tmoddivnode.simplify:tnode;
var var
t : tnode; t : tnode;
rd,ld : torddef;
rv,lv : tconstexprint; rv,lv : tconstexprint;
begin begin
result:=nil; result:=nil;
@ -125,9 +124,6 @@ implementation
if is_constintnode(right) and is_constintnode(left) then if is_constintnode(right) and is_constintnode(left) then
begin begin
rd:=torddef(right.resultdef);
ld:=torddef(left.resultdef);
rv:=tordconstnode(right).value; rv:=tordconstnode(right).value;
lv:=tordconstnode(left).value; lv:=tordconstnode(left).value;

View File

@ -393,7 +393,6 @@ implementation
sym : tsym; sym : tsym;
srsymtable : TSymtable; srsymtable : TSymtable;
hdef : tdef; hdef : tdef;
oldfilepos,
defpos,storetokenpos : tfileposinfo; defpos,storetokenpos : tfileposinfo;
old_block_type : tblock_type; old_block_type : tblock_type;
isgeneric, isgeneric,

View File

@ -1282,7 +1282,6 @@ end;
procedure pd_dispid(pd:tabstractprocdef); procedure pd_dispid(pd:tabstractprocdef);
var pt:Tnode; var pt:Tnode;
v:Tconstexprint;
begin begin
if pd.typ<>procdef then if pd.typ<>procdef then

View File

@ -1362,15 +1362,13 @@ implementation
procedure factor_read_id(var p1:tnode;var again:boolean); procedure factor_read_id(var p1:tnode;var again:boolean);
var var
pc : pchar; pc : pchar;
len : longint;
srsym : tsym; srsym : tsym;
unit_found, unit_found : boolean;
possible_error : boolean;
srsymtable : TSymtable; srsymtable : TSymtable;
hdef : tdef; hdef : tdef;
static_name : string;
orgstoredpattern, orgstoredpattern,
storedpattern : string; storedpattern : string;
len : longint;
begin begin
{ allow post fix operators } { allow post fix operators }
again:=true; again:=true;
@ -2208,9 +2206,6 @@ implementation
l : longint; l : longint;
ic : int64; ic : int64;
qc : qword; qc : qword;
{$ifndef cpu64}
card : cardinal;
{$endif cpu64}
oldp1, oldp1,
p1 : tnode; p1 : tnode;
code : integer; code : integer;

View File

@ -675,9 +675,7 @@ interface
procedure TPPCMPWAssembler.WriteTree(p:TAsmList); procedure TPPCMPWAssembler.WriteTree(p:TAsmList);
var var
s, s : string;
prefix,
suffix : string;
hp : tai; hp : tai;
hp1 : tailineinfo; hp1 : tailineinfo;
counter, counter,
@ -685,11 +683,8 @@ interface
InlineLevel : longint; InlineLevel : longint;
i,j,l : longint; i,j,l : longint;
consttype : taiconst_type; consttype : taiconst_type;
found,
do_line,DoNotSplitLine, do_line,DoNotSplitLine,
quoted : boolean; quoted : boolean;
sep : char;
replaced : boolean;
sin : single; sin : single;
d : double; d : double;
@ -1215,43 +1210,13 @@ interface
function TPPCMPWAssembler.DoAssemble : boolean; function TPPCMPWAssembler.DoAssemble : boolean;
var f : file;
begin begin
DoAssemble:=Inherited DoAssemble; DoAssemble:=Inherited DoAssemble;
(*
{ masm does not seem to recognize specific extensions and uses .obj allways PM }
if (target_asm.id = as_i386_masm) then
begin
if not(cs_asm_extern in current_settings.globalswitches) then
begin
if Not FileExists(objfile) and
FileExists(ForceExtension(objfile,'.obj')) then
begin
Assign(F,ForceExtension(objfile,'.obj'));
Rename(F,objfile);
end;
end
else
AsmRes.AddAsmCommand('mv',ForceExtension(objfile,'.obj')+' '+objfile,objfile);
end;
*)
end; end;
procedure TPPCMPWAssembler.WriteAsmFileHeader; procedure TPPCMPWAssembler.WriteAsmFileHeader;
begin begin
(*
AsmWriteLn(#9'.386p');
{ masm 6.11 does not seem to like LOCALS PM }
if (target_asm.id = as_i386_tasm) then
begin
AsmWriteLn(#9'LOCALS '+target_asm.labelprefix);
end;
AsmWriteLn('DGROUP'#9'GROUP'#9'_BSS,_DATA');
AsmWriteLn(#9'ASSUME'#9'CS:_CODE,ES:DGROUP,DS:DGROUP,SS:DGROUP');
AsmLn;
*)
AsmWriteLn(#9'string asis'); {Interpret strings just to be the content between the quotes.} AsmWriteLn(#9'string asis'); {Interpret strings just to be the content between the quotes.}
AsmWriteLn(#9'aligning off'); {We do our own aligning.} AsmWriteLn(#9'aligning off'); {We do our own aligning.}
AsmLn; AsmLn;

View File

@ -890,8 +890,8 @@ const
var regcounter,firstregfpu,firstregint: TSuperRegister; var regcounter,firstregfpu,firstregint: TSuperRegister;
href : treference; href : treference;
usesfpr,usesgpr,gotgot : boolean; usesfpr,usesgpr,gotgot : boolean;
cond : tasmcond; { cond : tasmcond;
instr : taicpu; instr : taicpu; }
begin begin
{ CR and LR only have to be saved in case they are modified by the current } { CR and LR only have to be saved in case they are modified by the current }

View File

@ -653,7 +653,7 @@ Unit rappcgas;
dec(ord(hs[0])); dec(ord(hs[0]));
actcondition.dirhint:=DH_Plus; actcondition.dirhint:=DH_Plus;
end; end;
actopcode := tasmop(ptrint(iasmops.find(hs))); actopcode := tasmop(ptruint(iasmops.find(hs)));
if actopcode <> A_NONE then if actopcode <> A_NONE then
begin begin
if actcondition.dirhint<>DH_None then if actcondition.dirhint<>DH_None then

View File

@ -485,7 +485,7 @@ uses cutils, cclasses;
p: tai; p: tai;
newjmp: taicpu; newjmp: taicpu;
labelpositions: TFPList; labelpositions: TFPList;
instrpos: ptrint; instrpos: ptruint;
l: tasmlabel; l: tasmlabel;
inserted_something: boolean; inserted_something: boolean;
begin begin
@ -539,7 +539,7 @@ uses cutils, cclasses;
{$q-} {$q-}
{$define overflowon} {$define overflowon}
{$endif} {$endif}
(ptruint(abs(ptrint(labelpositions[tasmlabel(taicpu(p).oper[0]^.ref^.symbol).labelnr]-instrpos)) - (low(smallint) div 4)) > ptruint((high(smallint) - low(smallint)) div 4)) then (ptruint(abs(ptruint(labelpositions[tasmlabel(taicpu(p).oper[0]^.ref^.symbol).labelnr]-instrpos)) - (low(smallint) div 4)) > ptruint((high(smallint) - low(smallint)) div 4)) then
{$ifdef overflowon} {$ifdef overflowon}
{$q+} {$q+}
{$undef overflowon} {$undef overflowon}

View File

@ -483,7 +483,6 @@ unit cgppc;
procedure tcgppcgen.g_profilecode(list: TAsmList); procedure tcgppcgen.g_profilecode(list: TAsmList);
var var
paraloc1 : tcgpara; paraloc1 : tcgpara;
reg: tregister;
begin begin
if (target_info.system in [system_powerpc_darwin]) then if (target_info.system in [system_powerpc_darwin]) then
begin begin

View File

@ -57,7 +57,6 @@ unit rgcpu;
var var
tmpref : treference; tmpref : treference;
helplist : TAsmList; helplist : TAsmList;
l : tasmlabel;
hreg : tregister; hreg : tregister;
ins : Taicpu; ins : Taicpu;
begin begin
@ -109,7 +108,6 @@ unit rgcpu;
var var
tmpref : treference; tmpref : treference;
helplist : TAsmList; helplist : TAsmList;
l : tasmlabel;
hreg : tregister; hreg : tregister;
ins : Taicpu; ins : Taicpu;
begin begin

View File

@ -1035,9 +1035,6 @@ procedure tppufile.putsmallset(const b);
procedure tppufile.putnormalset(const b); procedure tppufile.putnormalset(const b);
type type
SetLongintArray = Array [0..7] of longint; SetLongintArray = Array [0..7] of longint;
var
i : longint;
tempb : setlongintarray;
begin begin
putdata(b,32); putdata(b,32);
end; end;