summaryrefslogtreecommitdiff
path: root/libreofficekit
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-09-15 19:13:19 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-09-17 09:05:38 +0200
commit206b5b2661be37efdff3c6aedb6f248c4636be79 (patch)
treeaf385e5b4725dcfea23988d9113cced8e9ccaf3c /libreofficekit
parenta85d3ba1c0de313b60324b9ecfa488bb99d69d06 (diff)
New loplugin:external
...warning about (for now only) functions and variables with external linkage that likely don't need it. The problems with moving entities into unnamed namespacs and breaking ADL (as alluded to in comments in compilerplugins/clang/external.cxx) are illustrated by the fact that while struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } returns 1, both moving just the struct S2 into an nunnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { namespace { struct S2: S1 { int f() { return 1; } }; } int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } as well as moving just the function f overload into an unnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; namespace { int f(S2 s) { return s.f(); } } } int main() { return f(N::S2()); } would each change the program to return 0 instead. Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c Reviewed-on: https://gerrit.libreoffice.org/60539 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'libreofficekit')
-rw-r--r--libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx4
-rw-r--r--libreofficekit/qa/tilebench/tilebench.cxx6
2 files changed, 5 insertions, 5 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx b/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx
index 2657075dd3f6..1987bdc909cf 100644
--- a/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtv-calc-header-bar.cxx
@@ -81,7 +81,7 @@ gtv_calc_header_bar_finalize(GObject* object)
G_OBJECT_CLASS (gtv_calc_header_bar_parent_class)->finalize (object);
}
-void gtv_calc_header_bar_draw_text(cairo_t* pCairo, const GdkRectangle& rRectangle, const std::string& rText)
+static void gtv_calc_header_bar_draw_text(cairo_t* pCairo, const GdkRectangle& rRectangle, const std::string& rText)
{
cairo_text_extents_t extents;
cairo_text_extents(pCairo, rText.c_str(), &extents);
@@ -90,7 +90,7 @@ void gtv_calc_header_bar_draw_text(cairo_t* pCairo, const GdkRectangle& rRectang
cairo_show_text(pCairo, rText.c_str());
}
-gboolean gtv_calc_header_bar_draw_impl(GtkWidget* pWidget, cairo_t* pCairo)
+static gboolean gtv_calc_header_bar_draw_impl(GtkWidget* pWidget, cairo_t* pCairo)
{
GtvCalcHeaderBar* self = GTV_CALC_HEADER_BAR(pWidget);
GtvCalcHeaderBarPrivate& priv = getPrivate(GTV_CALC_HEADER_BAR(self));
diff --git a/libreofficekit/qa/tilebench/tilebench.cxx b/libreofficekit/qa/tilebench/tilebench.cxx
index 4cb76dd1366e..60a856212c5d 100644
--- a/libreofficekit/qa/tilebench/tilebench.cxx
+++ b/libreofficekit/qa/tilebench/tilebench.cxx
@@ -103,7 +103,7 @@ static void dumpTile(const int nWidth, const int nHeight, const int mode, const
}
}
-void testTile( Document *pDocument, int max_parts,
+static void testTile( Document *pDocument, int max_parts,
int max_tiles, bool dump )
{
const int mode = pDocument->getTileMode();
@@ -219,7 +219,7 @@ void testTile( Document *pDocument, int max_parts,
static std::atomic<bool> bDialogRendered(false);
static std::atomic<int> nDialogId(-1);
-void kitCallback(int nType, const char* pPayload, void* pData)
+static void kitCallback(int nType, const char* pPayload, void* pData)
{
Document *pDocument = static_cast<Document *>(pData);
@@ -261,7 +261,7 @@ void kitCallback(int nType, const char* pPayload, void* pData)
}
}
-void testDialog( Document *pDocument, const char *uno_cmd )
+static void testDialog( Document *pDocument, const char *uno_cmd )
{
int view = pDocument->createView();
pDocument->setView(view);