diff options
author | Noel Grandin <noel@peralex.com> | 2014-06-18 12:14:29 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-06-24 11:34:21 +0200 |
commit | e2080e70fe8b085f18e868e46340454720fa94ca (patch) | |
tree | 4038d1d57b41b68a47d5ebbbe6ad390648ec6303 /shell | |
parent | f910280b8704ed9c289150a4ca3c8d60e15d0d97 (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 'shell')
-rw-r--r-- | shell/source/sessioninstall/SyncDbusSessionHelper.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx index c02274dbfb11..42e4f4df9b07 100644 --- a/shell/source/sessioninstall/SyncDbusSessionHelper.cxx +++ b/shell/source/sessioninstall/SyncDbusSessionHelper.cxx @@ -36,7 +36,7 @@ namespace g_error_free(m_pError); throw RuntimeException(sMsg); } - GError** getRef() { return &m_pError; } + GError*& getRef() { return m_pError; } }; static inline GDBusProxy* lcl_GetPackageKitProxy(const OUString& sInterface) { @@ -49,7 +49,7 @@ namespace "/org/freedesktop/PackageKit", reinterpret_cast<const gchar*>(sFullInterface.getStr()), NULL, - error.getRef()); + &error.getRef()); if(!proxy) throw RuntimeException("couldnt get a proxy!"); return proxy; @@ -87,7 +87,7 @@ namespace shell { namespace sessioninstall G_DBUS_CALL_FLAGS_NONE, -1, /* timeout */ NULL, /* cancellable */ - error.getRef()); + &error.getRef()); } void SAL_CALL SyncDbusSessionHelper::IsInstalled( const OUString& sPackagename, const OUString& sInteraction, sal_Bool& o_isInstalled ) throw (RuntimeException, std::exception) @@ -104,7 +104,7 @@ namespace shell { namespace sessioninstall G_DBUS_CALL_FLAGS_NONE, -1, /* timeout */ NULL, /* cancellable */ - error.getRef()),GVariantDeleter()); + &error.getRef()),GVariantDeleter()); if(result.get()) o_isInstalled = g_variant_get_boolean(g_variant_get_child_value(result.get(),0)) ? sal_True : sal_False; } |