From f95b13785cde145291432c39bf23eaead4213644 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Fri, 7 Jun 2024 07:54:34 +0200 Subject: [PATCH] Fix build under windows when visp namespace enabled --- modules/core/include/visp3/core/vpImage.h | 2 +- modules/io/src/tools/vpKeyboard.cpp | 10 +++---- .../test/framegrabber/test1394TwoGrabber.cpp | 27 +++++++------------ .../test/framegrabber/test1394TwoResetBus.cpp | 24 ++++++----------- 4 files changed, 21 insertions(+), 42 deletions(-) diff --git a/modules/core/include/visp3/core/vpImage.h b/modules/core/include/visp3/core/vpImage.h index 085bfa357d..39552fa9c1 100644 --- a/modules/core/include/visp3/core/vpImage.h +++ b/modules/core/include/visp3/core/vpImage.h @@ -1505,7 +1505,7 @@ void vpImage::getMinMaxLoc(vpImagePoint *minLoc, vpImagePoint *maxLoc, Typ */ template vpImage &vpImage::operator=(vpImage other) { - swap(*this, other); + ::swap(*this, other); if (other.display != nullptr) { display = other.display; } diff --git a/modules/io/src/tools/vpKeyboard.cpp b/modules/io/src/tools/vpKeyboard.cpp index 25b8a035a8..d0efc4c9ab 100644 --- a/modules/io/src/tools/vpKeyboard.cpp +++ b/modules/io/src/tools/vpKeyboard.cpp @@ -58,11 +58,9 @@ vpKeyboard::vpKeyboard() init(); } #else -{} +{ } #endif - - /*! Stops the raw mode. */ @@ -74,7 +72,6 @@ vpKeyboard::~vpKeyboard() } /*! - Get the hit key. kbhit() indicates if a key was hitten. */ int vpKeyboard::getchar() @@ -91,8 +88,6 @@ int vpKeyboard::getchar() } /*! - - \return 1 : if a key was hit. */ int vpKeyboard::kbhit() @@ -163,5 +158,6 @@ void vpKeyboard::setRawMode(bool active) tcsetattr(STDIN_FILENO, TCSANOW, &initial_settings); } } -END_VISP_NAMESPACE #endif // defined UNIX + +END_VISP_NAMESPACE diff --git a/modules/sensor/test/framegrabber/test1394TwoGrabber.cpp b/modules/sensor/test/framegrabber/test1394TwoGrabber.cpp index 305cfb4bb3..5157b7f26b 100644 --- a/modules/sensor/test/framegrabber/test1394TwoGrabber.cpp +++ b/modules/sensor/test/framegrabber/test1394TwoGrabber.cpp @@ -30,14 +30,12 @@ * * Description: * Firewire cameras video capture. - * -*****************************************************************************/ + */ /*! \file test1394TwoGrabber.cpp \brief Aquire images using libdc1394-2.x library. - */ #include @@ -46,22 +44,21 @@ #include #include +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + #if defined(VISP_HAVE_DC1394) #include #include #include + /*! \example test1394TwoGrabber.cpp - - - */ int main() { -#ifdef ENABLE_VISP_NAMESPACE - using namespace VISP_NAMESPACE_NAME; -#endif try { std::cout << "IEEE1394 test in progress..." << std::endl; @@ -123,14 +120,8 @@ int main() #else int main() { - vpTRACE("Ieee 1394 grabber capabilities are not available...\n" - "You should install libdc1394-2 to use this binary."); - } + vpTRACE("Ieee 1394 grabber capabilities are not available..."); + vpTRACE("You should install libdc1394-2 to use this binary."); +} #endif - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/modules/sensor/test/framegrabber/test1394TwoResetBus.cpp b/modules/sensor/test/framegrabber/test1394TwoResetBus.cpp index 39ce19f116..eaacbe8989 100644 --- a/modules/sensor/test/framegrabber/test1394TwoResetBus.cpp +++ b/modules/sensor/test/framegrabber/test1394TwoResetBus.cpp @@ -30,14 +30,12 @@ * * Description: * Firewire cameras video capture. - * -*****************************************************************************/ + */ /*! \file test1394TwoResetBus.cpp \brief Resets the IEEE1394 bus using libdc1394-2.x library. - */ #include @@ -45,6 +43,10 @@ #include +#ifdef ENABLE_VISP_NAMESPACE +using namespace VISP_NAMESPACE_NAME; +#endif + #if defined(VISP_HAVE_DC1394) #include @@ -61,13 +63,9 @@ is if a program shuts down uncleanly and needs to free leftover ISO channels or bandwidth. A bus reset will free those things as a side effect. - */ int main() { -#ifdef ENABLE_VISP_NAMESPACE - using namespace VISP_NAMESPACE_NAME; -#endif try { std::cout << "IEEE1394 bus reset in progress..." << std::endl; vp1394TwoGrabber g; @@ -86,14 +84,8 @@ int main() #else int main() { - vpTRACE("Ieee 1394 grabber capabilities are not available...\n" - "You should install libdc1394-2 to use this binary."); - } + vpTRACE("Ieee 1394 grabber capabilities are not available..."); + vpTRACE("You should install libdc1394-2 to use this binary."); +} #endif - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */