From 09627de51b31c6bc419d7755363b9b76845ceeef Mon Sep 17 00:00:00 2001 From: Carlos Pereira Atencio Date: Tue, 23 Jul 2024 08:20:38 +0100 Subject: [PATCH] Ensure .cpp files are `using namespace codal`. And headerfiles declare new clases in the codal namespace. This is part of: https://github.com/lancaster-university/codal-microbit-v2/issues/240 --- inc/driver-models/Pin.h | 2 -- inc/types/Matrix4.h | 5 +++++ source/driver-models/CodalUSB.cpp | 2 ++ source/types/Matrix4.cpp | 2 ++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/inc/driver-models/Pin.h b/inc/driver-models/Pin.h index 808044ea..3d675595 100644 --- a/inc/driver-models/Pin.h +++ b/inc/driver-models/Pin.h @@ -60,8 +60,6 @@ DEALINGS IN THE SOFTWARE. namespace codal { - using namespace codal; - /** * Pin capabilities enum. * Used to determine the capabilities of each Pin as some can only be digital, or can be both digital and analogue. diff --git a/inc/types/Matrix4.h b/inc/types/Matrix4.h index 2e3a727b..816ed01d 100644 --- a/inc/types/Matrix4.h +++ b/inc/types/Matrix4.h @@ -27,6 +27,9 @@ DEALINGS IN THE SOFTWARE. #include "CodalConfig.h" +namespace codal +{ + /** * Class definition for a simple matrix, that is optimised for nx4 or 4xn matrices. * @@ -198,4 +201,6 @@ inline Matrix4 Matrix4::multiplyT(Matrix4 &matrix) return multiply(matrix, true); } +} // namespace codal + #endif diff --git a/source/driver-models/CodalUSB.cpp b/source/driver-models/CodalUSB.cpp index 9d1f7d2c..1e0a9629 100644 --- a/source/driver-models/CodalUSB.cpp +++ b/source/driver-models/CodalUSB.cpp @@ -38,6 +38,8 @@ DEALINGS IN THE SOFTWARE. #include "CodalDmesg.h" #include "codal_target_hal.h" +using namespace codal; + #define send(p, l) ctrlIn->write(p, l) CodalUSB *CodalUSB::usbInstance = NULL; diff --git a/source/types/Matrix4.cpp b/source/types/Matrix4.cpp index 085af982..f5005b17 100644 --- a/source/types/Matrix4.cpp +++ b/source/types/Matrix4.cpp @@ -25,6 +25,8 @@ DEALINGS IN THE SOFTWARE. #include "CodalConfig.h" #include "Matrix4.h" +using namespace codal; + /** * Class definition for a simple matrix, optimised for n x 4 or 4 x n matrices. *