From 7766b08f08f16208831501056390a06458a54a08 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Wed, 3 Jan 2001 23:13:35 +0000 Subject: [PATCH] Cleanups. committer: mfx 978563615 +0000 --- src/p_com.cpp | 16 ++++++++++------ src/p_djgpp2.cpp | 5 +++-- src/p_sys.cpp | 10 ++++++---- src/p_tmt.cpp | 5 +++-- src/p_vmlinz.cpp | 5 +++-- src/p_w32pe.cpp | 5 +++-- src/p_wcle.cpp | 5 +++-- 7 files changed, 31 insertions(+), 20 deletions(-) diff --git a/src/p_com.cpp b/src/p_com.cpp index f158ccf7..c3a0ee6f 100644 --- a/src/p_com.cpp +++ b/src/p_com.cpp @@ -62,7 +62,9 @@ const int *PackCom::getCompressionMethods(int method, int level) const const int *PackCom::getFilters() const { - static const int filters[] = { 0x06, 0x03, 0x04, 0x01, 0x05, 0x02, -1 }; + static const int filters[] = { + 0x06, 0x03, 0x04, 0x01, 0x05, 0x02, + -1 }; return filters; } @@ -138,21 +140,23 @@ void PackCom::patchLoader(OutputFile *fo, int PackCom::buildLoader(const Filter *ft) { - const int filter_id = ft->id; initLoader(nrv2b_loader,sizeof(nrv2b_loader)); addLoader("COMMAIN1""COMSUBSI", ph.first_offset_found == 1 ? "COMSBBBP" : "", "COMPSHDI", - filter_id ? "COMCALLT" : "", + ft->id ? "COMCALLT" : "", "COMMAIN2""UPX1HEAD""COMCUTPO""NRV2B160", - filter_id ? "NRVDDONE" : "NRVDRETU", + ft->id ? "NRVDDONE" : "NRVDRETU", "NRVDECO1", ph.max_offset_found <= 0xd00 ? "NRVLED00" : "NRVGTD00", "NRVDECO2""NRV2B169", NULL ); - if (filter_id) - addFilter16(filter_id); + if (ft->id) + { + assert(ft->calls > 0); + addFilter16(ft->id); + } return getLoaderSize(); } diff --git a/src/p_djgpp2.cpp b/src/p_djgpp2.cpp index e4535fbb..4fd76eb6 100644 --- a/src/p_djgpp2.cpp +++ b/src/p_djgpp2.cpp @@ -67,8 +67,9 @@ const int *PackDjgpp2::getCompressionMethods(int method, int level) const const int *PackDjgpp2::getFilters() const { - static const int filters[] = { 0x26, 0x24, 0x11, 0x14, 0x13, 0x16, - 0x25, 0x15, 0x12, -1 }; + static const int filters[] = { + 0x26, 0x24, 0x11, 0x14, 0x13, 0x16, 0x25, 0x15, 0x12, + -1 }; return filters; } diff --git a/src/p_sys.cpp b/src/p_sys.cpp index 74f9202d..8986d6dc 100644 --- a/src/p_sys.cpp +++ b/src/p_sys.cpp @@ -104,20 +104,22 @@ void PackSys::patchLoader(OutputFile *fo, int PackSys::buildLoader(const Filter *ft) { - const int filter_id = ft->id; initLoader(nrv2b_loader,sizeof(nrv2b_loader)); addLoader("SYSMAIN1", opt->cpu == opt->CPU_8086 ? "SYSI0861" : "SYSI2861", "SYSMAIN2""SYSSUBSI", ph.first_offset_found == 1 ? "SYSSBBBP" : "", - filter_id ? "SYSCALLT" : "", + ft->id ? "SYSCALLT" : "", "SYSMAIN3""UPX1HEAD""SYSCUTPO""NRV2B160""NRVDDONE""NRVDECO1", ph.max_offset_found <= 0xd00 ? "NRVLED00" : "NRVGTD00", "NRVDECO2""NRV2B169", NULL ); - if (filter_id) - addFilter16(filter_id); + if (ft->id) + { + assert(ft->calls > 0); + addFilter16(ft->id); + } addLoader("SYSMAIN5", opt->cpu == opt->CPU_8086 ? "SYSI0862" : "SYSI2862", "SYSJUMP1", diff --git a/src/p_tmt.cpp b/src/p_tmt.cpp index 67856a4c..3a59141a 100644 --- a/src/p_tmt.cpp +++ b/src/p_tmt.cpp @@ -64,8 +64,9 @@ const int *PackTmt::getCompressionMethods(int method, int level) const const int *PackTmt::getFilters() const { - static const int filters[] = { 0x26, 0x24, 0x11, 0x14, 0x13, 0x16, - 0x25, 0x12, 0x15, -1 }; + static const int filters[] = { + 0x26, 0x24, 0x11, 0x14, 0x13, 0x16, 0x25, 0x12, 0x15, + -1 }; return filters; } diff --git a/src/p_vmlinz.cpp b/src/p_vmlinz.cpp index def46c0a..5aef40c1 100644 --- a/src/p_vmlinz.cpp +++ b/src/p_vmlinz.cpp @@ -73,8 +73,9 @@ const int *PackVmlinuzI386::getCompressionMethods(int method, int level) const const int *PackVmlinuzI386::getFilters() const { - static const int filters[] = { 0x26, 0x24, 0x11, 0x14, 0x13, 0x16, - 0x25, 0x15, 0x12, -1 }; + static const int filters[] = { + 0x26, 0x24, 0x11, 0x14, 0x13, 0x16, 0x25, 0x15, 0x12, + -1 }; return filters; } diff --git a/src/p_w32pe.cpp b/src/p_w32pe.cpp index 9fd576fb..0e542bcb 100644 --- a/src/p_w32pe.cpp +++ b/src/p_w32pe.cpp @@ -115,8 +115,9 @@ const int *PackW32Pe::getCompressionMethods(int method, int level) const const int *PackW32Pe::getFilters() const { - static const int filters[] = { 0x26, 0x24, 0x16, 0x13, 0x14, 0x11, - 0x25, 0x15, 0x12, -1 }; + static const int filters[] = { + 0x26, 0x24, 0x16, 0x13, 0x14, 0x11, 0x25, 0x15, 0x12, + -1 }; return filters; } diff --git a/src/p_wcle.cpp b/src/p_wcle.cpp index c11b04fc..6438a512 100644 --- a/src/p_wcle.cpp +++ b/src/p_wcle.cpp @@ -83,8 +83,9 @@ const int *PackWcle::getCompressionMethods(int method, int level) const const int *PackWcle::getFilters() const { - static const int filters[] = { 0x26, 0x24, 0x14, 0x11, 0x16, 0x13, - 0x25, 0x12, 0x15, -1 }; + static const int filters[] = { + 0x26, 0x24, 0x14, 0x11, 0x16, 0x13, 0x25, 0x12, 0x15, + -1 }; return filters; }