summaryrefslogtreecommitdiff
path: root/codemaker
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-11-25 18:33:25 +0100
committerJulien Nabet <serval2412@yahoo.fr>2017-11-26 00:48:10 +0100
commit10593acac0bc42878fea34fe7da3f389f256c317 (patch)
tree51c6c72f1870f5eea36cc59415a501a78c280a82 /codemaker
parent2618e4a13d719122e6358d9d96864d1691e56a02 (diff)
Replace most lists by vectors in codemaker
Change-Id: Id867b497514d2d795504ae5c9e7d0ad356524ad5 Reviewed-on: https://gerrit.libreoffice.org/45274 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'codemaker')
-rw-r--r--codemaker/source/javamaker/classfile.cxx8
-rw-r--r--codemaker/source/javamaker/classfile.hxx5
-rw-r--r--codemaker/source/javamaker/javatype.cxx5
3 files changed, 8 insertions, 10 deletions
diff --git a/codemaker/source/javamaker/classfile.cxx b/codemaker/source/javamaker/classfile.cxx
index 37858991edec..1df31aea6947 100644
--- a/codemaker/source/javamaker/classfile.cxx
+++ b/codemaker/source/javamaker/classfile.cxx
@@ -227,12 +227,12 @@ void ClassFile::Code::instrInvokevirtual(
void ClassFile::Code::instrLookupswitch(
Code const * defaultBlock,
- std::list< std::pair< sal_Int32, Code * > > const & blocks)
+ std::vector< std::pair< sal_Int32, Code * > > const & blocks)
{
// lookupswitch <0--3 byte pad> <defaultbyte1> <defaultbyte2> <defaultbyte3>
// <defaultbyte4> <npairs1> <npairs2> <npairs3> <npairs4>
// <match--offset pairs...>:
- std::list< std::pair< sal_Int32, Code * > >::size_type size = blocks.size();
+ std::vector< std::pair< sal_Int32, Code * > >::size_type size = blocks.size();
if (size > SAL_MAX_INT32) {
throw CannotDumpException("Lookup-switch too large for Java class file format");
}
@@ -312,7 +312,7 @@ void ClassFile::Code::instrSwap() {
void ClassFile::Code::instrTableswitch(
Code const * defaultBlock, sal_Int32 low,
- std::list< Code * > const & blocks)
+ std::vector< Code * > const & blocks)
{
// tableswitch <0--3 byte pad> <defaultbyte1> <defaultbyte2> <defaultbyte3>
// <defaultbyte4> <lowbyte1> <lowbyte2> <lowbyte3> <lowbyte4> <highbyte1>
@@ -323,7 +323,7 @@ void ClassFile::Code::instrTableswitch(
for (int i = 0; i < pad; ++i) {
appendU1(m_code, 0);
}
- std::list< Code * >::size_type size = blocks.size();
+ std::vector< Code * >::size_type size = blocks.size();
Position pos2 = pos1 + 1 + pad + 12 + size * 4; //FIXME: overflow
sal_uInt32 defaultOffset = static_cast< sal_uInt32 >(pos2 - pos1);
//FIXME: overflow
diff --git a/codemaker/source/javamaker/classfile.hxx b/codemaker/source/javamaker/classfile.hxx
index 6e5466d5b701..be6e3a36abe4 100644
--- a/codemaker/source/javamaker/classfile.hxx
+++ b/codemaker/source/javamaker/classfile.hxx
@@ -23,7 +23,6 @@
#include <codemaker/unotype.hxx>
#include <sal/types.h>
-#include <list>
#include <map>
#include <utility>
#include <vector>
@@ -89,7 +88,7 @@ public:
void instrLookupswitch(
Code const * defaultBlock,
- std::list< std::pair< sal_Int32, Code * > > const & blocks);
+ std::vector< std::pair< sal_Int32, Code * > > const & blocks);
void instrNew(rtl::OString const & type);
void instrNewarray(codemaker::UnoType::Sort sort);
@@ -108,7 +107,7 @@ public:
void instrTableswitch(
Code const * defaultBlock, sal_Int32 low,
- std::list< Code * > const & blocks);
+ std::vector< Code * > const & blocks);
void loadIntegerConstant(sal_Int32 value);
void loadStringConstant(rtl::OString const & value);
diff --git a/codemaker/source/javamaker/javatype.cxx b/codemaker/source/javamaker/javatype.cxx
index dae125e7a3bb..71f4faa16117 100644
--- a/codemaker/source/javamaker/javatype.cxx
+++ b/codemaker/source/javamaker/javatype.cxx
@@ -22,7 +22,6 @@
#include <algorithm>
#include <cassert>
#include <cstdlib>
-#include <list>
#include <map>
#include <memory>
#include <set>
@@ -752,7 +751,7 @@ void handleEnumType(
std::unique_ptr< ClassFile::Code > defCode(cf->newCode());
defCode->instrAconstNull();
defCode->instrAreturn();
- std::list< ClassFile::Code * > blocks;
+ std::vector< ClassFile::Code * > blocks;
//FIXME: pointers contained in blocks may leak
sal_Int32 last = SAL_MAX_INT32;
for (const auto& pair : map)
@@ -779,7 +778,7 @@ void handleEnumType(
std::unique_ptr< ClassFile::Code > defCode(cf->newCode());
defCode->instrAconstNull();
defCode->instrAreturn();
- std::list< std::pair< sal_Int32, ClassFile::Code * > > blocks;
+ std::vector< std::pair< sal_Int32, ClassFile::Code * > > blocks;
//FIXME: pointers contained in blocks may leak
for (const auto& pair : map )
{