From 5f1495dcfa3b72126be005ab60ae6262b2adb866 Mon Sep 17 00:00:00 2001
From: Paul McCarthy <pauldmccarthy@gmail.com>
Date: Wed, 22 Sep 2021 12:21:30 +0100
Subject: [PATCH] RF: Move "using namespace" statements to source files

---
 histogram.cc  | 8 +-------
 kernel.cc     | 2 ++
 minimize.cc   | 3 ---
 miscmaths.cc  | 3 +++
 optimise.cc   | 3 +++
 rungekutta.cc | 1 +
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/histogram.cc b/histogram.cc
index 8184cd3..5fe931f 100644
--- a/histogram.cc
+++ b/histogram.cc
@@ -10,10 +10,9 @@
 #include "histogram.h"
 
 using namespace std;
+using namespace NEWMAT;
 
-#ifndef NO_NAMESPACE
 namespace MISCMATHS {
-#endif
 
   float Histogram::getPercentile(float perc) 
   {
@@ -267,11 +266,6 @@ namespace MISCMATHS {
       }
     }
   }
-  
-#ifndef NO_NAMESPACE
-  }
-#endif
-
 
 
 
diff --git a/kernel.cc b/kernel.cc
index 0cc024d..5f438e1 100644
--- a/kernel.cc
+++ b/kernel.cc
@@ -9,6 +9,8 @@
 #include "kernel.h"
 #include "miscmaths.h"
 
+using namespace NEWMAT;
+
 namespace MISCMATHS {
 
   set<kernelstorage*, kernelstorage::comparer> kernel::existingkernels;  
diff --git a/minimize.cc b/minimize.cc
index 46b84d0..f484768 100644
--- a/minimize.cc
+++ b/minimize.cc
@@ -17,9 +17,6 @@
 #include "miscmaths.h"
 #include "minimize.h"
 
-#define WANT_STREAM
-#define WANT_MATH
-
 using namespace NEWMAT;
 using namespace std;
 ///////////////////////////////////////////////////////
diff --git a/miscmaths.cc b/miscmaths.cc
index 10a6971..fc78720 100644
--- a/miscmaths.cc
+++ b/miscmaths.cc
@@ -15,8 +15,11 @@
 #include "miscprob.h"
 #include "stdlib.h"
 #include "armawrap/newmatio.h"
+#include "NewNifti/NewNifti.h"
 
 using namespace std;
+using namespace NEWMAT;
+using namespace NiftiIO;
 
 namespace MISCMATHS {
 
diff --git a/optimise.cc b/optimise.cc
index 07386c9..22c308e 100644
--- a/optimise.cc
+++ b/optimise.cc
@@ -14,6 +14,9 @@
 #include "optimise.h"
 #include "miscmaths.h"
 
+using namespace NEWMAT;
+using namespace std;
+
 namespace MISCMATHS {
 
   // The following lines are ignored by the current SGI compiler
diff --git a/rungekutta.cc b/rungekutta.cc
index 2b83814..9e7042d 100644
--- a/rungekutta.cc
+++ b/rungekutta.cc
@@ -9,6 +9,7 @@
 #include "rungekutta.h"
 
 using namespace std;
+using namespace NEWMAT;
 
 namespace MISCMATHS {
 
-- 
GitLab