summaryrefslogtreecommitdiff
path: root/codemaker
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-06-18 12:14:29 +0200
committerNoel Grandin <noel@peralex.com>2014-06-24 11:34:21 +0200
commite2080e70fe8b085f18e868e46340454720fa94ca (patch)
tree4038d1d57b41b68a47d5ebbbe6ad390648ec6303 /codemaker
parentf910280b8704ed9c289150a4ca3c8d60e15d0d97 (diff)
new compilerplugin returnbyref
Find places where we are returning a pointer to something, where we can be returning a reference. e.g. class A { struct X x; public X* getX() { return &x; } } which can be: public X& getX() { return x; } Change-Id: I796fd23fd36a18aedf6e36bc28f8fab4f518c6c7
Diffstat (limited to 'codemaker')
-rw-r--r--codemaker/source/cppumaker/cpputype.cxx10
-rw-r--r--codemaker/source/javamaker/javatype.cxx4
2 files changed, 7 insertions, 7 deletions
diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx
index 4a3e4d7c6527..5e166fa33bc5 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -3421,10 +3421,10 @@ void ServiceType::dumpHxxFile(
{
tree.add(u2b(*j), m_typeMgr);
}
- if (!tree.getRoot()->present) {
+ if (!tree.getRoot().present) {
includes.add("com.sun.star.uno.Exception");
includes.add("com.sun.star.uno.RuntimeException");
- includeExceptions(includes, tree.getRoot());
+ includeExceptions(includes, &tree.getRoot());
}
}
}
@@ -3603,7 +3603,7 @@ void ServiceType::dumpHxxFile(
{
tree.add(u2b(*j), m_typeMgr);
}
- if (!tree.getRoot()->present) {
+ if (!tree.getRoot().present) {
o << indent() << "try {\n";
inc();
}
@@ -3657,14 +3657,14 @@ void ServiceType::dumpHxxFile(
o << "the_arguments";
}
o << ", the_context), ::css::uno::UNO_QUERY);\n#endif\n";
- if (!tree.getRoot()->present) {
+ if (!tree.getRoot().present) {
dec();
o << indent()
<< ("} catch (const ::css::uno::RuntimeException &) {\n");
inc();
o << indent() << "throw;\n";
dec();
- dumpCatchClauses(o, tree.getRoot());
+ dumpCatchClauses(o, &tree.getRoot());
o << indent()
<< ("} catch (const ::css::uno::Exception &"
" the_exception) {\n");
diff --git a/codemaker/source/javamaker/javatype.cxx b/codemaker/source/javamaker/javatype.cxx
index 40a17845db55..9e08171bb07d 100644
--- a/codemaker/source/javamaker/javatype.cxx
+++ b/codemaker/source/javamaker/javatype.cxx
@@ -2156,7 +2156,7 @@ void addConstructor(
codemaker::convertString(returnType).replace('.', '/'));
// stack: instance
code->instrAreturn();
- if (!tree.getRoot()->present) {
+ if (!tree.getRoot().present) {
ClassFile::Code::Position pos1 = code->getPosition();
// stack: e
code->instrInvokevirtual(
@@ -2188,7 +2188,7 @@ void addConstructor(
ClassFile::Code::Position pos2 = code->getPosition();
code->instrAthrow();
addExceptionHandlers(
- tree.getRoot(), tryStart, tryEnd, pos2, code.get());
+ &tree.getRoot(), tryStart, tryEnd, pos2, code.get());
code->addException(
tryStart, tryEnd, pos1, "com/sun/star/uno/Exception");
dependencies->insert("com.sun.star.uno.Exception");