From 9a7db6b95337b005c9404cf57fb721218212fcda Mon Sep 17 00:00:00 2001
From: Dmitrij Naumov <dmitrij@naumov.de>
Date: Sat, 20 Jul 2013 15:25:54 +0200
Subject: [PATCH] Specify internal or external linkage explicitly.

---
 BaseLib/FileTools.cpp                                        | 2 ++
 GeoLib/AnalyticalGeometry.cpp                                | 2 ++
 MathLib/LinAlg/Preconditioner/generateDiagPrecond.cpp        | 3 +++
 MathLib/LinAlg/Solvers/CG.cpp                                | 1 +
 MathLib/LinAlg/Sparse/NestedDissectionPermutation/AdjMat.cpp | 2 ++
 5 files changed, 10 insertions(+)

diff --git a/BaseLib/FileTools.cpp b/BaseLib/FileTools.cpp
index 40fb244da92..953196758ff 100644
--- a/BaseLib/FileTools.cpp
+++ b/BaseLib/FileTools.cpp
@@ -45,6 +45,7 @@ void truncateFile( std::string const& filename)
  * position of the last one or std::string::npos if no file path separator was
  * found.
  */
+static
 size_t findLastPathSeparator(std::string const& path)
 {
 	return path.find_last_of("/\\");
@@ -53,6 +54,7 @@ size_t findLastPathSeparator(std::string const& path)
 /** Finds the position of last dot.
  * This could be used to extract file extension.
  */
+static
 size_t findLastDot(std::string const& path)
 {
 	return path.find_last_of(".");
diff --git a/GeoLib/AnalyticalGeometry.cpp b/GeoLib/AnalyticalGeometry.cpp
index 7c86836c268..15ab660a154 100644
--- a/GeoLib/AnalyticalGeometry.cpp
+++ b/GeoLib/AnalyticalGeometry.cpp
@@ -135,6 +135,7 @@ bool lineSegmentsIntersect(const GeoLib::Polyline* ply,
 	return false;
 }
 
+static
 bool isPointInTriangle(const double p[3], const double a[3], const double b[3], const double c[3])
 {
 	// criterion: p-b = u0 * (b - a) + u1 * (b - c); 0 <= u0, u1 <= 1, u0+u1 <= 1
@@ -159,6 +160,7 @@ bool isPointInTriangle(const GeoLib::Point* p, const GeoLib::Point* a, const Geo
 	return isPointInTriangle(p->getCoords(), a->getCoords(), b->getCoords(), c->getCoords());
 }
 
+static
 double getOrientedTriArea(GeoLib::Point const& a, GeoLib::Point const& b, GeoLib::Point const& c)
 {
 	const double u[3] = { c[0] - a[0], c[1] - a[1], c[2] - a[2] };
diff --git a/MathLib/LinAlg/Preconditioner/generateDiagPrecond.cpp b/MathLib/LinAlg/Preconditioner/generateDiagPrecond.cpp
index c0f3b735b1d..ebe7d9072a1 100644
--- a/MathLib/LinAlg/Preconditioner/generateDiagPrecond.cpp
+++ b/MathLib/LinAlg/Preconditioner/generateDiagPrecond.cpp
@@ -18,6 +18,7 @@
 
 namespace MathLib {
 
+static
 bool generateDiagPrecond (unsigned n, unsigned const*const iA, unsigned const*const jA,
 				double const*const A, double* diag)
 {
@@ -44,6 +45,7 @@ bool generateDiagPrecond (unsigned n, unsigned const*const iA, unsigned const*co
 	return true;
 }
 
+static
 bool generateDiagPrecondRowSum(unsigned n, unsigned const*const iA, double const*const A, double* diag)
 {
 	unsigned idx; // first idx of next row
@@ -64,6 +66,7 @@ bool generateDiagPrecondRowSum(unsigned n, unsigned const*const iA, double const
 	return true;
 }
 
+static
 bool generateDiagPrecondRowMax(unsigned n, unsigned const*const iA, double const*const A, double* diag)
 {
 	unsigned idx; // first idx of next row
diff --git a/MathLib/LinAlg/Solvers/CG.cpp b/MathLib/LinAlg/Solvers/CG.cpp
index cdc499109db..13b7d15ad97 100644
--- a/MathLib/LinAlg/Solvers/CG.cpp
+++ b/MathLib/LinAlg/Solvers/CG.cpp
@@ -34,6 +34,7 @@
 
 namespace MathLib {
 
+extern
 unsigned CG(CRSMatrix<double,unsigned> const * mat, double const * const b,
 		double* const x, double& eps, unsigned& nsteps)
 {
diff --git a/MathLib/LinAlg/Sparse/NestedDissectionPermutation/AdjMat.cpp b/MathLib/LinAlg/Sparse/NestedDissectionPermutation/AdjMat.cpp
index 417849af6cd..74c1d78db7d 100644
--- a/MathLib/LinAlg/Sparse/NestedDissectionPermutation/AdjMat.cpp
+++ b/MathLib/LinAlg/Sparse/NestedDissectionPermutation/AdjMat.cpp
@@ -71,6 +71,7 @@ AdjMat* AdjMat::getMat(unsigned beg, unsigned end,
  * @param iA array of size of the number of rows/columns + 1, array contains pointer into jA array
  * @param jA array of the length of the number of non-zero entries (edges in the matrix graph)
  */
+static
 void genAdjMat(unsigned n, unsigned* &iA, unsigned* &jA)
 {
 	unsigned i;
@@ -152,6 +153,7 @@ void genAdjMat(unsigned n, unsigned* &iA, unsigned* &jA)
 	delete[] iAn;
 }
 
+static
 void genFullAdjMat(unsigned n, unsigned* &iA, unsigned* &jA)
 {
 	unsigned i;
-- 
GitLab