diff --git a/compiler/aggas.pas b/compiler/aggas.pas index 89ce026751..6f96c3088e 100644 --- a/compiler/aggas.pas +++ b/compiler/aggas.pas @@ -443,13 +443,10 @@ implementation do_line : boolean; sepChar : char; - nextdwarffileidx : longint; begin if not assigned(p) then exit; - nextdwarffileidx:=1; - last_align := 2; InlineLevel:=0; { lineinfo is only needed for al_procedures (PFV) } @@ -995,9 +992,6 @@ implementation if CurrSecType<>sec_none then WriteSection(CurrSecType,'',secorder_default); AsmStartSize:=AsmSize; - - { reset dwarf file index } - nextdwarffileidx:=1; end; end; diff --git a/compiler/cfileutl.pas b/compiler/cfileutl.pas index 9288a3b17a..47f980261c 100644 --- a/compiler/cfileutl.pas +++ b/compiler/cfileutl.pas @@ -177,9 +177,9 @@ implementation Result:=0; end else - Result:=PtrInt(DirectoryEntries.Find(Lower(AName))) + Result:=PtrUInt(DirectoryEntries.Find(Lower(AName))) else - Result:=PtrInt(DirectoryEntries.Find(AName)); + Result:=PtrUInt(DirectoryEntries.Find(AName)); end; @@ -367,7 +367,7 @@ implementation else begin 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; inc(Res.EntryIndex); Result:=true; diff --git a/compiler/constexp.pas b/compiler/constexp.pas index df0e47c8fe..eec3e45e5a 100644 --- a/compiler/constexp.pas +++ b/compiler/constexp.pas @@ -199,7 +199,7 @@ function sub_from(const a:Tconstexprint;b:qword):Tconstexprint; const abs_low_int64=qword(9223372036854775808); {abs(low(int64)) -> overflow error} -var sspace,uspace:qword; +var sspace:qword; label try_qword,ov; @@ -375,7 +375,6 @@ end; operator mod (const a,b:Tconstexprint):Tconstexprint; var aa,bb:qword; - sa,sb:boolean; begin if a.overflow or b.overflow then @@ -385,25 +384,13 @@ begin end; result.overflow:=false; if a.signed then - begin - aa:=qword(a.svalue); - sa:=a.svalue<0; - end + aa:=qword(a.svalue) else - begin - aa:=a.uvalue; - sa:=false; - end; + aa:=a.uvalue; if b.signed then - begin - bb:=qword(b.svalue); - sb:=b.svalue<0; - end + bb:=qword(b.svalue) else - begin - bb:=b.uvalue; - sb:=false; - end; + bb:=b.uvalue; if bb=0 then result.overflow:=true else diff --git a/compiler/cp1251.pas b/compiler/cp1251.pas index 83c6bb3418..a2534fb531 100644 --- a/compiler/cp1251.pas +++ b/compiler/cp1251.pas @@ -162,7 +162,7 @@ unit cp1251; (unicode : 8226; flag : umf_noinfo; reserved : 0), (unicode : 8211; 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 : 1113; flag : umf_noinfo; reserved : 0), (unicode : 8250; flag : umf_noinfo; reserved : 0), diff --git a/compiler/cstreams.pas b/compiler/cstreams.pas index da1b74ecfc..bf4a72235c 100644 --- a/compiler/cstreams.pas +++ b/compiler/cstreams.pas @@ -462,7 +462,7 @@ begin begin Result:=FSize-FPosition; If Result>Count then Result:=Count; - Move (Pointer(PtrInt(FMemory)+FPosition)^,Buffer,Result); + Move (Pointer(PtrUInt(FMemory)+FPosition)^,Buffer,Result); FPosition:=Fposition+Result; end; end; @@ -613,7 +613,7 @@ begin SetCapacity (NewPos); FSize:=Newpos; end; - System.Move (Buffer,Pointer(Ptrint(FMemory)+FPosition)^,Count); + System.Move (Buffer,Pointer(Ptruint(FMemory)+FPosition)^,Count); FPosition:=NewPos; Result:=Count; end; diff --git a/compiler/dbgdwarf.pas b/compiler/dbgdwarf.pas index 5e1b062271..46694d963c 100644 --- a/compiler/dbgdwarf.pas +++ b/compiler/dbgdwarf.pas @@ -1620,8 +1620,6 @@ implementation var procendlabel : tasmlabel; funcrettype : tasmsymbol; - mangled_length : longint; - p : pchar; procentry : string; dreg : byte; begin @@ -2489,7 +2487,6 @@ implementation lastfileinfo : tfileposinfo; currfuncname : pshortstring; currsectype : TAsmSectiontype; - hlabel : tasmlabel; hp : tai; infile : tinputfile; prevcolumn, diff --git a/compiler/fmodule.pas b/compiler/fmodule.pas index f407c3b024..570f0e8487 100644 --- a/compiler/fmodule.pas +++ b/compiler/fmodule.pas @@ -413,9 +413,8 @@ implementation constructor tmodule.create(LoadedFrom:TModule;const s:string;_is_unit:boolean); var - p,n : string; + n : string; begin - p:=ExtractFilePath(s); n:=ChangeFileExt(ExtractFileName(s),''); { Programs have the name 'Program' to don't conflict with dup id's } if _is_unit then diff --git a/compiler/fppu.pas b/compiler/fppu.pas index 90015e7c90..be3052b631 100644 --- a/compiler/fppu.pas +++ b/compiler/fppu.pas @@ -982,8 +982,6 @@ uses procedure tppumodule.writeppu; - var - pu : tused_unit; begin Message1(unit_u_ppu_write,realmodulename^); @@ -1195,11 +1193,9 @@ uses procedure tppumodule.load_usedunits; var pu : tused_unit; - load_refs : boolean; begin if current_module<>self then internalerror(200212284); - load_refs:=true; { load the used units from interface } in_interface:=true; diff --git a/compiler/globals.pas b/compiler/globals.pas index e00a9c395b..609b40f0ec 100644 --- a/compiler/globals.pas +++ b/compiler/globals.pas @@ -487,7 +487,7 @@ implementation procedure TLinkStrMap.Expand(Src:TCmdStrList;Dest:TLinkStrMap); // expands every thing in Src to Dest for linkorder purposes. var - l,r : longint; + r : longint; LibN : TCmdStr; begin while not src.empty do @@ -1082,8 +1082,6 @@ implementation end; procedure InitGlobals; - var - i : tfeature; begin get_exepath; diff --git a/compiler/htypechk.pas b/compiler/htypechk.pas index f9c06f3918..a1e879e428 100644 --- a/compiler/htypechk.pas +++ b/compiler/htypechk.pas @@ -2339,8 +2339,7 @@ implementation end; var - paraidx, - res: integer; + paraidx : integer; currpara, bestpara: tparavarsym; currvcl, bestvcl: tvariantequaltype; begin diff --git a/compiler/nadd.pas b/compiler/nadd.pas index 576dcdace4..1624d287c9 100644 --- a/compiler/nadd.pas +++ b/compiler/nadd.pas @@ -1684,7 +1684,7 @@ implementation var p: tnode; newstatement : tstatementnode; - tempnode,tempnode2 : ttempcreatenode; + tempnode (*,tempnode2*) : ttempcreatenode; cmpfuncname: string; begin { when we get here, we are sure that both the left and the right } diff --git a/compiler/nbas.pas b/compiler/nbas.pas index 04ca7139c9..7edca18799 100644 --- a/compiler/nbas.pas +++ b/compiler/nbas.pas @@ -443,8 +443,6 @@ implementation function tblocknode.simplify: tnode; - var - hp, next: tstatementnode; begin result := nil; { Warning: never replace a blocknode with another node type, } diff --git a/compiler/ncal.pas b/compiler/ncal.pas index 1258c87a38..5e4a038943 100644 --- a/compiler/ncal.pas +++ b/compiler/ncal.pas @@ -1422,7 +1422,6 @@ implementation objectdf : tobjectdef; parents : tlinkedlist; objectinfo : tobjectinfoitem; - stritem : TCmdStrListItem; pd : tprocdef; i : integer; first : boolean; diff --git a/compiler/ncgutil.pas b/compiler/ncgutil.pas index 7c84e976b1..598445c32f 100644 --- a/compiler/ncgutil.pas +++ b/compiler/ncgutil.pas @@ -2138,9 +2138,11 @@ implementation ****************************************************************************} procedure gen_external_stub(list:TAsmList;pd:tprocdef;const externalname:string); +{$ifdef x86} var ref : treference; sym : tasmsymbol; +{$endif x86} begin { add the procedure to the al_procedures } maybe_new_object_file(list); @@ -2765,8 +2767,10 @@ implementation procedure gen_pic_helpers(list : TAsmList); +{$ifdef i386} var href : treference; +{$endif i386} begin { if other cpus require such helpers as well, it can be solved more cleaner } {$ifdef i386} diff --git a/compiler/ninl.pas b/compiler/ninl.pas index 049886a93b..e41f1ca57c 100644 --- a/compiler/ninl.pas +++ b/compiler/ninl.pas @@ -853,7 +853,6 @@ implementation filetemp : Ttempcreatenode; name : string[31]; textsym : ttypesym; - readfunctype : tdef; is_typed, do_read, is_rwstr, diff --git a/compiler/nmat.pas b/compiler/nmat.pas index b557255c75..beaabd0c48 100644 --- a/compiler/nmat.pas +++ b/compiler/nmat.pas @@ -104,7 +104,6 @@ implementation function tmoddivnode.simplify:tnode; var t : tnode; - rd,ld : torddef; rv,lv : tconstexprint; begin result:=nil; @@ -125,9 +124,6 @@ implementation if is_constintnode(right) and is_constintnode(left) then begin - rd:=torddef(right.resultdef); - ld:=torddef(left.resultdef); - rv:=tordconstnode(right).value; lv:=tordconstnode(left).value; diff --git a/compiler/pdecl.pas b/compiler/pdecl.pas index e85cbae3fd..a4f0057058 100644 --- a/compiler/pdecl.pas +++ b/compiler/pdecl.pas @@ -393,7 +393,6 @@ implementation sym : tsym; srsymtable : TSymtable; hdef : tdef; - oldfilepos, defpos,storetokenpos : tfileposinfo; old_block_type : tblock_type; isgeneric, diff --git a/compiler/pdecsub.pas b/compiler/pdecsub.pas index b91255d43b..2f9f36ef53 100644 --- a/compiler/pdecsub.pas +++ b/compiler/pdecsub.pas @@ -1282,7 +1282,6 @@ end; procedure pd_dispid(pd:tabstractprocdef); var pt:Tnode; - v:Tconstexprint; begin if pd.typ<>procdef then diff --git a/compiler/pexpr.pas b/compiler/pexpr.pas index 30c5b7d6d4..149e8b68e9 100644 --- a/compiler/pexpr.pas +++ b/compiler/pexpr.pas @@ -1362,15 +1362,13 @@ implementation procedure factor_read_id(var p1:tnode;var again:boolean); var pc : pchar; - len : longint; srsym : tsym; - unit_found, - possible_error : boolean; + unit_found : boolean; srsymtable : TSymtable; hdef : tdef; - static_name : string; orgstoredpattern, storedpattern : string; + len : longint; begin { allow post fix operators } again:=true; @@ -2208,9 +2206,6 @@ implementation l : longint; ic : int64; qc : qword; -{$ifndef cpu64} - card : cardinal; -{$endif cpu64} oldp1, p1 : tnode; code : integer; diff --git a/compiler/powerpc/agppcmpw.pas b/compiler/powerpc/agppcmpw.pas index d52541d4fd..31017f4717 100644 --- a/compiler/powerpc/agppcmpw.pas +++ b/compiler/powerpc/agppcmpw.pas @@ -675,9 +675,7 @@ interface procedure TPPCMPWAssembler.WriteTree(p:TAsmList); var - s, - prefix, - suffix : string; + s : string; hp : tai; hp1 : tailineinfo; counter, @@ -685,11 +683,8 @@ interface InlineLevel : longint; i,j,l : longint; consttype : taiconst_type; - found, do_line,DoNotSplitLine, quoted : boolean; - sep : char; - replaced : boolean; sin : single; d : double; @@ -1215,43 +1210,13 @@ interface function TPPCMPWAssembler.DoAssemble : boolean; - var f : file; begin 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; procedure TPPCMPWAssembler.WriteAsmFileHeader; 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'aligning off'); {We do our own aligning.} AsmLn; diff --git a/compiler/powerpc/cgcpu.pas b/compiler/powerpc/cgcpu.pas index 1991e75144..fa6579367c 100644 --- a/compiler/powerpc/cgcpu.pas +++ b/compiler/powerpc/cgcpu.pas @@ -890,8 +890,8 @@ const var regcounter,firstregfpu,firstregint: TSuperRegister; href : treference; usesfpr,usesgpr,gotgot : boolean; - cond : tasmcond; - instr : taicpu; +{ cond : tasmcond; + instr : taicpu; } begin { CR and LR only have to be saved in case they are modified by the current } diff --git a/compiler/powerpc/rappcgas.pas b/compiler/powerpc/rappcgas.pas index 9534d9bd65..fdffd92bcb 100644 --- a/compiler/powerpc/rappcgas.pas +++ b/compiler/powerpc/rappcgas.pas @@ -653,7 +653,7 @@ Unit rappcgas; dec(ord(hs[0])); actcondition.dirhint:=DH_Plus; end; - actopcode := tasmop(ptrint(iasmops.find(hs))); + actopcode := tasmop(ptruint(iasmops.find(hs))); if actopcode <> A_NONE then begin if actcondition.dirhint<>DH_None then diff --git a/compiler/ppcgen/aasmcpu.pas b/compiler/ppcgen/aasmcpu.pas index 522ffe7c24..6f80f3ad11 100644 --- a/compiler/ppcgen/aasmcpu.pas +++ b/compiler/ppcgen/aasmcpu.pas @@ -485,7 +485,7 @@ uses cutils, cclasses; p: tai; newjmp: taicpu; labelpositions: TFPList; - instrpos: ptrint; + instrpos: ptruint; l: tasmlabel; inserted_something: boolean; begin @@ -539,7 +539,7 @@ uses cutils, cclasses; {$q-} {$define overflowon} {$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} {$q+} {$undef overflowon} diff --git a/compiler/ppcgen/cgppc.pas b/compiler/ppcgen/cgppc.pas index e8bfaf43cc..b085b31bb2 100644 --- a/compiler/ppcgen/cgppc.pas +++ b/compiler/ppcgen/cgppc.pas @@ -483,7 +483,6 @@ unit cgppc; procedure tcgppcgen.g_profilecode(list: TAsmList); var paraloc1 : tcgpara; - reg: tregister; begin if (target_info.system in [system_powerpc_darwin]) then begin diff --git a/compiler/ppcgen/rgcpu.pas b/compiler/ppcgen/rgcpu.pas index 9564121664..a57dfc70f0 100644 --- a/compiler/ppcgen/rgcpu.pas +++ b/compiler/ppcgen/rgcpu.pas @@ -57,7 +57,6 @@ unit rgcpu; var tmpref : treference; helplist : TAsmList; - l : tasmlabel; hreg : tregister; ins : Taicpu; begin @@ -109,7 +108,6 @@ unit rgcpu; var tmpref : treference; helplist : TAsmList; - l : tasmlabel; hreg : tregister; ins : Taicpu; begin diff --git a/compiler/ppu.pas b/compiler/ppu.pas index f73f0af42f..783829dc87 100644 --- a/compiler/ppu.pas +++ b/compiler/ppu.pas @@ -1035,9 +1035,6 @@ procedure tppufile.putsmallset(const b); procedure tppufile.putnormalset(const b); type SetLongintArray = Array [0..7] of longint; - var - i : longint; - tempb : setlongintarray; begin putdata(b,32); end;