diff options
author | Erich Eckner <git@eckner.net> | 2016-03-08 14:14:47 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2016-03-08 15:47:45 +0100 |
commit | c26b5e79bbc8da96b12a3585a4cbbd0f415aa7cc (patch) | |
tree | 9996d1ab2bced2233e9625053eda1dc354438152 | |
parent | 56fc1d42b0ee0f5554d67be8b0473c45ee974a03 (diff) | |
download | epost-c26b5e79bbc8da96b12a3585a4cbbd0f415aa7cc.tar.xz |
unnötige Zuweisung zu typisierten Pointern entfernt
-rw-r--r-- | epost.lps | 158 | ||||
-rw-r--r-- | epostunit.pas | 109 |
2 files changed, 117 insertions, 150 deletions
@@ -3,12 +3,12 @@ <ProjectSession> <Version Value="9"/> <BuildModes Active="Default"/> - <Units Count="18"> + <Units Count="22"> <Unit0> <Filename Value="epost.lpr"/> <IsPartOfProject Value="True"/> - <TopLine Value="56"/> - <CursorPos X="46" Y="73"/> + <TopLine Value="75"/> + <CursorPos Y="187"/> <FoldState Value=" T0iXW39123111221]65151[84313[4421[Q4121[85]as"/> <UsageCount Value="202"/> <Loaded Value="True"/> @@ -25,9 +25,9 @@ <IsPartOfProject Value="True"/> <IsVisibleTab Value="True"/> <EditorIndex Value="1"/> - <TopLine Value="6438"/> - <CursorPos Y="6478"/> - <FoldState Value=" T0\0m$0C1k"/> + <TopLine Value="2882"/> + <CursorPos X="63" Y="2896"/> + <FoldState Value=" T0/Jm$0C1-"/> <UsageCount Value="201"/> <Loaded Value="True"/> </Unit2> @@ -41,7 +41,7 @@ <Unit4> <Filename Value="werteunit.pas"/> <IsPartOfProject Value="True"/> - <EditorIndex Value="4"/> + <EditorIndex Value="5"/> <TopLine Value="348"/> <CursorPos Y="619"/> <UsageCount Value="200"/> @@ -50,7 +50,7 @@ <Unit5> <Filename Value="typenunit.pas"/> <IsPartOfProject Value="True"/> - <EditorIndex Value="5"/> + <EditorIndex Value="6"/> <TopLine Value="560"/> <CursorPos Y="600"/> <UsageCount Value="200"/> @@ -62,7 +62,7 @@ <EditorIndex Value="-1"/> <TopLine Value="162"/> <CursorPos X="56" Y="177"/> - <UsageCount Value="60"/> + <UsageCount Value="68"/> </Unit6> <Unit7> <Filename Value="../units/fftunit.inc"/> @@ -70,198 +70,226 @@ <EditorIndex Value="-1"/> <TopLine Value="10"/> <CursorPos X="22" Y="10"/> - <UsageCount Value="57"/> + <UsageCount Value="65"/> </Unit7> <Unit8> <Filename Value="../fpGUI/src/corelib/render/software/agg_scanline_storage_aa.pas"/> <EditorIndex Value="-1"/> <TopLine Value="1612"/> <CursorPos X="2" Y="1675"/> - <UsageCount Value="10"/> + <UsageCount Value="9"/> </Unit8> <Unit9> <Filename Value="../units/mystringlistunit.pas"/> <EditorIndex Value="-1"/> <TopLine Value="313"/> <CursorPos Y="435"/> - <UsageCount Value="12"/> + <UsageCount Value="11"/> </Unit9> <Unit10> <Filename Value="../units/lowlevelunit.pas"/> - <EditorIndex Value="3"/> + <EditorIndex Value="4"/> + <TopLine Value="37"/> <CursorPos Y="20"/> - <UsageCount Value="27"/> + <UsageCount Value="31"/> <Loaded Value="True"/> </Unit10> <Unit11> <Filename Value="../units/randomunit.pas"/> <EditorIndex Value="-1"/> - <UsageCount Value="10"/> + <UsageCount Value="9"/> </Unit11> <Unit12> <Filename Value="../units/matheunit.pas"/> - <EditorIndex Value="2"/> + <EditorIndex Value="3"/> <TopLine Value="460"/> <CursorPos X="47" Y="482"/> <FoldState Value=" T3v2041$"/> - <UsageCount Value="17"/> + <UsageCount Value="21"/> <Loaded Value="True"/> </Unit12> <Unit13> <Filename Value="../units/systemunit.pas"/> - <EditorIndex Value="-1"/> - <TopLine Value="127"/> - <CursorPos X="72" Y="160"/> - <UsageCount Value="14"/> + <EditorIndex Value="2"/> + <TopLine Value="126"/> + <CursorPos X="14" Y="159"/> + <UsageCount Value="16"/> + <Loaded Value="True"/> </Unit13> <Unit14> <Filename Value="../fpGUI/src/corelib/render/software/agg_2D.pas"/> <EditorIndex Value="-1"/> <TopLine Value="807"/> <CursorPos Y="818"/> - <UsageCount Value="3"/> + <UsageCount Value="2"/> </Unit14> <Unit15> <Filename Value="../units/protokollunit.pas"/> <EditorIndex Value="-1"/> <TopLine Value="82"/> <CursorPos X="15" Y="30"/> - <UsageCount Value="3"/> + <UsageCount Value="2"/> </Unit15> <Unit16> <Filename Value="/usr/lib/fpc/src/rtl/inc/objpash.inc"/> <EditorIndex Value="-1"/> <TopLine Value="182"/> <CursorPos X="21" Y="202"/> - <UsageCount Value="5"/> + <UsageCount Value="4"/> </Unit16> <Unit17> <Filename Value="/usr/lib/fpc/src/rtl/unix/bunxovlh.inc"/> <EditorIndex Value="-1"/> <TopLine Value="61"/> <CursorPos X="10" Y="99"/> - <UsageCount Value="8"/> + <UsageCount Value="10"/> </Unit17> + <Unit18> + <Filename Value="/usr/lib/fpc/src/rtl/unix/baseunix.pp"/> + <UnitName Value="BaseUnix"/> + <EditorIndex Value="-1"/> + <TopLine Value="61"/> + <UsageCount Value="10"/> + </Unit18> + <Unit19> + <Filename Value="/usr/lib/fpc/src/rtl/unix/bunxovl.inc"/> + <EditorIndex Value="-1"/> + <TopLine Value="414"/> + <CursorPos X="20" Y="434"/> + <UsageCount Value="10"/> + </Unit19> + <Unit20> + <Filename Value="/usr/lib/fpc/src/rtl/linux/bunxsysc.inc"/> + <EditorIndex Value="-1"/> + <TopLine Value="16"/> + <UsageCount Value="10"/> + </Unit20> + <Unit21> + <Filename Value="/usr/lib/fpc/src/rtl/unix/bunxh.inc"/> + <EditorIndex Value="-1"/> + <TopLine Value="74"/> + <CursorPos X="15" Y="102"/> + <UsageCount Value="10"/> + </Unit21> </Units> <JumpHistory Count="30" HistoryIndex="29"> <Position1> - <Filename Value="epostunit.pas"/> - <Caret Line="887" Column="19" TopLine="854"/> + <Filename Value="epost.lpr"/> + <Caret Line="58" Column="47" TopLine="19"/> </Position1> <Position2> - <Filename Value="epostunit.pas"/> - <Caret Line="982" Column="34" TopLine="963"/> + <Filename Value="epost.lpr"/> + <Caret Line="13" Column="79"/> </Position2> <Position3> - <Filename Value="epostunit.pas"/> - <Caret Line="72" Column="32" TopLine="52"/> + <Filename Value="epost.lpr"/> + <Caret Line="55" Column="43" TopLine="35"/> </Position3> <Position4> - <Filename Value="epostunit.pas"/> - <Caret Line="5100" Column="32" TopLine="5068"/> + <Filename Value="epost.lpr"/> + <Caret Line="13" Column="84"/> </Position4> <Position5> - <Filename Value="epostunit.pas"/> - <Caret Line="5353" Column="56" TopLine="5341"/> + <Filename Value="epost.lpr"/> + <Caret Line="55" Column="43"/> </Position5> <Position6> - <Filename Value="epostunit.pas"/> - <Caret Line="1443" Column="49" TopLine="1412"/> + <Filename Value="epost.lpr"/> + <Caret Line="54" Column="10" TopLine="34"/> </Position6> <Position7> - <Filename Value="epostunit.pas"/> - <Caret Line="1442" Column="21" TopLine="1422"/> + <Filename Value="epost.lpr"/> + <Caret Line="46" TopLine="34"/> </Position7> <Position8> - <Filename Value="epostunit.pas"/> - <Caret Line="1445" Column="61" TopLine="1423"/> + <Filename Value="../units/systemunit.pas"/> + <Caret Line="23" Column="43" TopLine="13"/> </Position8> <Position9> - <Filename Value="epostunit.pas"/> - <Caret Line="72" Column="32" TopLine="52"/> + <Filename Value="epost.lpr"/> + <Caret Line="50" Column="21" TopLine="40"/> </Position9> <Position10> - <Filename Value="epostunit.pas"/> - <Caret Line="5108" Column="32" TopLine="5076"/> + <Filename Value="epost.lpr"/> + <Caret Line="45" TopLine="32"/> </Position10> <Position11> - <Filename Value="epostunit.pas"/> - <Caret Line="5365" Column="27" TopLine="5310"/> + <Filename Value="epost.lpr"/> + <Caret Line="193" Column="37" TopLine="75"/> </Position11> <Position12> <Filename Value="epostunit.pas"/> + <Caret Line="356" TopLine="354"/> </Position12> <Position13> <Filename Value="epostunit.pas"/> - <Caret Line="382" Column="24" TopLine="349"/> + <Caret Line="2130" Column="105" TopLine="2111"/> </Position13> <Position14> <Filename Value="epostunit.pas"/> - <Caret Line="387" Column="27" TopLine="354"/> </Position14> <Position15> <Filename Value="epostunit.pas"/> - <Caret Line="394" Column="79" TopLine="361"/> + <Caret Line="136" Column="35" TopLine="104"/> </Position15> <Position16> <Filename Value="epostunit.pas"/> - <Caret Line="3405" Column="18" TopLine="3391"/> + <Caret Line="2023" Column="41" TopLine="1999"/> </Position16> <Position17> <Filename Value="epostunit.pas"/> - <Caret Line="3236" Column="15" TopLine="3216"/> </Position17> <Position18> <Filename Value="epostunit.pas"/> - <Caret Line="3281" Column="25" TopLine="3249"/> + <Caret Line="447" TopLine="431"/> </Position18> <Position19> <Filename Value="epostunit.pas"/> - <Caret Line="3404" Column="51" TopLine="3372"/> + <Caret Line="457" Column="74" TopLine="431"/> </Position19> <Position20> <Filename Value="epostunit.pas"/> - <Caret Line="3405" Column="41" TopLine="3373"/> + <Caret Line="508" Column="54" TopLine="490"/> </Position20> <Position21> <Filename Value="epostunit.pas"/> - <Caret Line="3406" Column="89" TopLine="3374"/> + <Caret Line="2004" TopLine="1971"/> </Position21> <Position22> <Filename Value="epostunit.pas"/> - <Caret Line="3559" Column="84" TopLine="3548"/> + <Caret Line="2156" TopLine="2128"/> </Position22> <Position23> <Filename Value="epostunit.pas"/> - <Caret Line="6481" TopLine="6441"/> + <Caret Line="2140" Column="47" TopLine="2115"/> </Position23> <Position24> <Filename Value="epostunit.pas"/> - <Caret Line="5368" TopLine="5352"/> + <Caret Line="2350" TopLine="2317"/> </Position24> <Position25> <Filename Value="epostunit.pas"/> - <Caret Line="3559" Column="15" TopLine="3540"/> + <Caret Line="2407" Column="66" TopLine="2386"/> </Position25> <Position26> <Filename Value="epostunit.pas"/> - <Caret Line="117" Column="23" TopLine="99"/> + <Caret Line="5766" TopLine="5763"/> </Position26> <Position27> <Filename Value="epostunit.pas"/> - <Caret Line="1627" Column="26" TopLine="1609"/> + <Caret Line="5770" Column="52" TopLine="5762"/> </Position27> <Position28> <Filename Value="epostunit.pas"/> - <Caret Line="3225" Column="51" TopLine="3220"/> + <Caret Line="5779" Column="52" TopLine="5762"/> </Position28> <Position29> <Filename Value="epostunit.pas"/> - <Caret Line="3226" Column="29" TopLine="3208"/> + <Caret Line="5777" Column="38" TopLine="5759"/> </Position29> <Position30> <Filename Value="epostunit.pas"/> - <Caret Line="3564" Column="22" TopLine="3548"/> + <Caret Line="145" Column="32" TopLine="127"/> </Position30> </JumpHistory> </ProjectSession> diff --git a/epostunit.pas b/epostunit.pas index 32cccfd..0ff74a1 100644 --- a/epostunit.pas +++ b/epostunit.pas @@ -434,9 +434,6 @@ end; constructor tWerte.create(original: tWerte; xmin,xmax: longint); var ps: tExtrainfos; - pSi: pTLLWerteSingle; - pDo: pTLLWerteDouble; - pEx: pTLLWerteExtended; begin inherited create(original.Konturen,original.wertes); original.warteAufBeendigungDesLeseThreads; @@ -445,22 +442,19 @@ begin Genauigkeit:=original.Genauigkeit; case Genauigkeit of gSingle: begin - pSi:=@(original.sWerte); - sWerte:=tLLWerteSingle.create(pSi,ps,xmin,xmax); + sWerte:=tLLWerteSingle.create(pTLLWerteSingle(@original.sWerte),ps,xmin,xmax); dWerte:=tLLWerteDouble.create(ps); eWerte:=tLLWerteExtended.create(ps); end; gDouble: begin - pDo:=@(original.dWerte); sWerte:=tLLWerteSingle.create(ps); - dWerte:=tLLWerteDouble.create(pDo,ps,xmin,xmax); + dWerte:=tLLWerteDouble.create(pTLLWerteDouble(@original.dWerte),ps,xmin,xmax); eWerte:=tLLWerteExtended.create(ps); end; gExtended: begin sWerte:=tLLWerteSingle.create(ps); dWerte:=tLLWerteDouble.create(ps); - pEx:=@(original.eWerte); - eWerte:=tLLWerteExtended.create(pEx,ps,xmin,xmax); + eWerte:=tLLWerteExtended.create(pTLLWerteExtended(@original.eWerte),ps,xmin,xmax); end; end{of case}; if original.bezeichner='' then bezeichner:='' @@ -504,27 +498,14 @@ begin end; procedure tWerte.kopiereVon(st: boolean; original: tWerte; xmin,xmax: longint); overload; -var - pSi: pTLLWerteSingle; - pDo: pTLLWerteDouble; - pEx: pTLLWerteExtended; begin original.warteAufBeendigungDesLeseThreads; Transformationen:=tIdentitaet.create(original.Transformationen); Genauigkeit:=original.Genauigkeit; case Genauigkeit of - gSingle: begin - pSi:=@(original.sWerte); - sWerte.kopiereVon(st,pSi,xmin,xmax); - end; - gDouble: begin - pDo:=@(original.dWerte); - dWerte.kopiereVon(st,pDo,xmin,xmax); - end; - gExtended: begin - pEx:=@(original.eWerte); - eWerte.kopiereVon(st,pEx,xmin,xmax); - end; + gSingle: sWerte.kopiereVon(st,pTLLWerteSingle(@original.sWerte),xmin,xmax); + gDouble: dWerte.kopiereVon(st,pTLLWerteDouble(@original.dWerte),xmin,xmax); + gExtended: eWerte.kopiereVon(st,pTLLWerteExtended(@original.eWerte),xmin,xmax); end{of case}; end; @@ -2019,9 +2000,6 @@ var quellen: tWerteArray; s: string; Zeit: extended; - pSi: pTLLWerteSingle; - pDo: pTLLWerteDouble; - pEx: pTLLWerteExtended; begin result:=false; warteaufBeendigungDesLeseThreads; @@ -2150,36 +2128,30 @@ begin for i:=0 to length(quellen)-1 do case quellen[i].Genauigkeit of - gSingle: begin - pSi:=@(quellen[i].sWerte); + gSingle: eWerte.kopiereVonNach( - pSi, + pTLLWerteSingle(@quellen[i].sWerte), xmin,xmax, tmin,tmax, (1+xmax-xmin)*i*byte((Transformationen as tAgglomeration).horizontal), (1+tmax-tmin)*i*byte(not (Transformationen as tAgglomeration).horizontal) ); - end; - gDouble: begin - pDo:=@(quellen[i].dWerte); + gDouble: eWerte.kopiereVonNach( - pDo, + pTLLWerteDouble(@quellen[i].dWerte), xmin,xmax, tmin,tmax, (1+xmax-xmin)*i*byte((Transformationen as tAgglomeration).horizontal), (1+tmax-tmin)*i*byte(not (Transformationen as tAgglomeration).horizontal) ); - end; - gExtended: begin - pEx:=@(quellen[i].eWerte); + gExtended: eWerte.kopiereVonNach( - pEx, + pTLLWerteExtended(@quellen[i].eWerte), xmin,xmax, tmin,tmax, (1+xmax-xmin)*i*byte((Transformationen as tAgglomeration).horizontal), (1+tmax-tmin)*i*byte(not (Transformationen as tAgglomeration).horizontal) ); - end; end; gibAus('... fertig '+timetostr(now-Zeit),3); @@ -2374,9 +2346,6 @@ var fertig: boolean; korrelThreads: array of tKorrelThread; Zeit,pvFehler: extended; - pSi: pTLLWerteSingle; - pDo: pTLLWerteDouble; - pEx: pTLLWerteExtended; begin result:=false; warteaufBeendigungDesLeseThreads; @@ -2432,18 +2401,9 @@ begin gibAus(paramsDump,3); gibAus(quelle.paramsDump,3); case quelle.genauigkeit of - gSingle: begin - pSi:=@(quelle.sWerte); - eWerte.kopiereVon(st,pSi); - end; - gDouble: begin - pDo:=@(quelle.dWerte); - dWerte.kopiereVon(st,pDo); - end; - gExtended: begin - pEx:=@(quelle.eWerte); - eWerte.kopiereVon(st,pEx); - end; + gSingle: eWerte.kopiereVon(st,pTLLWerteSingle(@quelle.sWerte)); + gDouble: dWerte.kopiereVon(st,pTLLWerteDouble(@quelle.dWerte)); + gExtended: eWerte.kopiereVon(st,pTLLWerteExtended(@quelle.eWerte)); end{of case}; gibAus('... fertig '+timetostr(now-Zeit)+', berechne ...',3); end @@ -5800,56 +5760,35 @@ begin end; procedure tVerzerrThread.stExecute; -var - sw: pTLLWerteSingle; - dw: pTLLWerteDouble; - ew: pTLLWerteExtended; begin gibAus('Verzerrthread gestartet '+floattostr(qu._minW)+' '+floattostr(qu._maxW),1); - case qu.genauigkeit of - gSingle: begin - sw:=@(qu.sWerte); - dw:=nil; - ew:=nil; - end; - gDouble: begin - sw:=nil; - dw:=@(qu.dWerte); - ew:=nil; - end; - gExtended: begin - sw:=nil; - dw:=nil; - ew:=@(qu.eWerte); - end; - end{of case}; case zi.genauigkeit of gSingle: case qu.genauigkeit of gSingle: - zi.sWerte.kopiereVerzerrt(sw,ZPs,ZGs,ZAs,xMi,xMa,tMi,tMa,vb,nb,va,na); + zi.sWerte.kopiereVerzerrt(pTLLWerteSingle(@qu.sWerte),ZPs,ZGs,ZAs,xMi,xMa,tMi,tMa,vb,nb,va,na); gDouble: - zi.sWerte.kopiereVerzerrt(dw,ZPs,ZGs,ZAs,xMi,xMa,tMi,tMa,vb,nb,va,na); + zi.sWerte.kopiereVerzerrt(pTLLWerteDouble(@qu.dWerte),ZPs,ZGs,ZAs,xMi,xMa,tMi,tMa,vb,nb,va,na); gExtended: - zi.sWerte.kopiereVerzerrt(ew,ZPs,ZGs,ZAs,xMi,xMa,tMi,tMa,vb,nb,va,na); + zi.sWerte.kopiereVerzerrt(pTLLWerteExtended(@qu.eWerte),ZPs,ZGs,ZAs,xMi,xMa,tMi,tMa,vb,nb,va,na); end{of case}; gDouble: case qu.genauigkeit of gSingle: - zi.dWerte.kopiereVerzerrt(sw,ZPs,ZGs,ZAs,xMi,xMa,tMi,tMa,vb,nb,va,na); + zi.dWerte.kopiereVerzerrt(pTLLWerteSingle(@qu.sWerte),ZPs,ZGs,ZAs,xMi,xMa,tMi,tMa,vb,nb,va,na); gDouble: - zi.dWerte.kopiereVerzerrt(dw,ZPs,ZGs,ZAs,xMi,xMa,tMi,tMa,vb,nb,va,na); + zi.dWerte.kopiereVerzerrt(pTLLWerteDouble(@qu.dWerte),ZPs,ZGs,ZAs,xMi,xMa,tMi,tMa,vb,nb,va,na); gExtended: - zi.dWerte.kopiereVerzerrt(ew,ZPs,ZGs,ZAs,xMi,xMa,tMi,tMa,vb,nb,va,na); + zi.dWerte.kopiereVerzerrt(pTLLWerteExtended(@qu.eWerte),ZPs,ZGs,ZAs,xMi,xMa,tMi,tMa,vb,nb,va,na); end{of case}; gExtended: case qu.genauigkeit of gSingle: - zi.eWerte.kopiereVerzerrt(sw,ZPs,ZGs,ZAs,xMi,xMa,tMi,tMa,vb,nb,va,na); + zi.eWerte.kopiereVerzerrt(pTLLWerteSingle(@qu.sWerte),ZPs,ZGs,ZAs,xMi,xMa,tMi,tMa,vb,nb,va,na); gDouble: - zi.eWerte.kopiereVerzerrt(dw,ZPs,ZGs,ZAs,xMi,xMa,tMi,tMa,vb,nb,va,na); + zi.eWerte.kopiereVerzerrt(pTLLWerteDouble(@qu.dWerte),ZPs,ZGs,ZAs,xMi,xMa,tMi,tMa,vb,nb,va,na); gExtended: - zi.eWerte.kopiereVerzerrt(ew,ZPs,ZGs,ZAs,xMi,xMa,tMi,tMa,vb,nb,va,na); + zi.eWerte.kopiereVerzerrt(pTLLWerteExtended(@qu.eWerte),ZPs,ZGs,ZAs,xMi,xMa,tMi,tMa,vb,nb,va,na); end{of case}; end{of case}; gibAus('Verzerrthread beendet',1); |