From: Leonardo Florez Valencia Date: Mon, 15 Feb 2016 15:11:53 +0000 (-0500) Subject: Some minor warnings on windows removed. X-Git-Tag: v0.1~240 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=e9a9772a905a8c516a6ae2767fc0cf39ea0e7f73;p=cpPlugins.git Some minor warnings on windows removed. --- diff --git a/lib/cpExtensions/Algorithms/CPRFilter.hxx b/lib/cpExtensions/Algorithms/CPRFilter.hxx index 3b19a9f..5db673d 100644 --- a/lib/cpExtensions/Algorithms/CPRFilter.hxx +++ b/lib/cpExtensions/Algorithms/CPRFilter.hxx @@ -16,6 +16,7 @@ const typename cpExtensions::Algorithms::CPRFilter< I, S >:: TAxis* cpExtensions::Algorithms::CPRFilter< I, S >:: GetAxis( ) const { + return( NULL ); } // ------------------------------------------------------------------------- diff --git a/lib/cpExtensions/Visualization/ImageSliceActors.cxx b/lib/cpExtensions/Visualization/ImageSliceActors.cxx index 88a0a4b..90e0923 100644 --- a/lib/cpExtensions/Visualization/ImageSliceActors.cxx +++ b/lib/cpExtensions/Visualization/ImageSliceActors.cxx @@ -902,10 +902,17 @@ UpdateText( ) else if( axId == 1 ) axis = 'Y'; else if( axId == 2 ) axis = 'Z'; +#if defined(WIN32) + sprintf_s( + this->m_TextBuffer, 1024, "Axis: %c (%d)", + axis, this->m_ImageMapper->GetSliceNumber( ) + ); +#else // defined(WIN32) std::sprintf( this->m_TextBuffer, "Axis: %c (%d)", axis, this->m_ImageMapper->GetSliceNumber( ) ); +#endif // defined(WIN32) } else this->m_TextBuffer[ 0 ] = '\0'; @@ -956,10 +963,18 @@ UpdateText( double pos[ 3 ] ) ijk[ 0 ], ijk[ 1 ], ijk[ 2 ], n ); str << ")"; +#if defined(WIN32) + sprintf_s( + this->m_TextBuffer, 1024, "Axis: %c (%d)\nPixel %s", + axis, slice, str.str( ).c_str( ) + ); +#else // defined(WIN32) std::sprintf( this->m_TextBuffer, "Axis: %c (%d)\nPixel %s", axis, slice, str.str( ).c_str( ) ); +#endif // defined(WIN32) + } // fi } @@ -982,10 +997,17 @@ UpdateText( const double& w, const double& l ) else if( axId == 1 ) axis = 'Y'; else if( axId == 2 ) axis = 'Z'; +#if defined(WIN32) + sprintf_s( + this->m_TextBuffer, 1024, "Axis: %c (%d)\nW/L (%.2f/%.2f)", + axis, this->m_ImageMapper->GetSliceNumber( ), w, l + ); +#else // defined(WIN32) std::sprintf( this->m_TextBuffer, "Axis: %c (%d)\nW/L (%.2f/%.2f)", axis, this->m_ImageMapper->GetSliceNumber( ), w, l ); +#endif // defined(WIN32) } else this->m_TextBuffer[ 0 ] = '\0'; diff --git a/lib/cpPlugins/Interface/Workspace.cxx b/lib/cpPlugins/Interface/Workspace.cxx index 0abe927..7f7f7db 100644 --- a/lib/cpPlugins/Interface/Workspace.cxx +++ b/lib/cpPlugins/Interface/Workspace.cxx @@ -295,6 +295,7 @@ RenameExposedInputPort( { this->m_ExposedInputPorts[ new_name ] = o->second; this->m_ExposedInputPorts.erase( o ); + return( true ); } else return( false ); @@ -316,6 +317,7 @@ RenameExposedOutputPort( { this->m_ExposedOutputPorts[ new_name ] = o->second; this->m_ExposedOutputPorts.erase( o ); + return( true ); } else return( false ); diff --git a/lib/cpPlugins/Plugins/IO/MeshReader.cxx b/lib/cpPlugins/Plugins/IO/MeshReader.cxx index 943d3ac..040f8ae 100644 --- a/lib/cpPlugins/Plugins/IO/MeshReader.cxx +++ b/lib/cpPlugins/Plugins/IO/MeshReader.cxx @@ -90,7 +90,7 @@ _GD1( ) } else if( ext == "obj" ) { - // TODO + return( "cpPlugins::IO::MeshReader: OBJ reader not ready yet." ); } else if( ext == "vtk" ) { @@ -101,8 +101,9 @@ _GD1( ) auto out = this->GetOutputData< cpPlugins::Interface::Mesh >( "Output" ); out->SetVTK( pdr->GetOutput( ) ); return( "" ); - - } // fi + } + else + return( "cpPlugins::IO::MeshReader: Input file format not recognized." ); } // eof - $RCSfile$ diff --git a/lib/third_party/Pluma/uce-dirent.h b/lib/third_party/Pluma/uce-dirent.h index ecf78eb..91415bd 100644 --- a/lib/third_party/Pluma/uce-dirent.h +++ b/lib/third_party/Pluma/uce-dirent.h @@ -296,6 +296,15 @@ static void rewinddir (DIR *dirp); #include #include +/** Change by florez-l@javeriana.edu.co **/ +#if defined(WIN32) +# define NEW_STRCPY(A,B) strcpy_s(A,strlen(A),B) +# define NEW_STRNCPY(A,B,C) strncpy_s(A,C,B,C) +#else // defined(WIN32) +# define NEW_STRCPY(A,B) strcpy(A,B) +# define NEW_STRNCPY(A,B,C) strncpy(A,B,C) +#endif // defined(WIN32) + /* use ffblk instead of _find_t if requested */ #if defined(DIRENT_USE_FFBLK) # define _A_ARCH (FA_ARCH) @@ -361,17 +370,17 @@ opendir( * Directory separator is not appended if the name already ends with * drive or directory separator. Directory separator is assumed to be * '/' or '\' and drive separator is assumed to be ':'. */ - strcpy (dirp->dirname, dirname); + NEW_STRCPY (dirp->dirname, dirname); p = strchr (dirp->dirname, '\0'); if (dirp->dirname < p && *(p - 1) != '\\' && *(p - 1) != '/' && *(p - 1) != ':') { - strcpy (p++, "/"); + NEW_STRCPY (p++, "/"); } # ifdef DIRENT_WIN32_INTERFACE - strcpy (p, "*"); /*scan files with and without extension in win32*/ + NEW_STRCPY (p, "*"); /*scan files with and without extension in win32*/ # else - strcpy (p, "*.*"); /*scan files with and without extension in DOS*/ + NEW_STRCPY (p, "*.*"); /*scan files with and without extension in DOS*/ # endif /* open stream */ @@ -659,7 +668,7 @@ _setdirname (struct DIR *dirp) { /* make sure that d_name is long enough */ assert (strlen (_getdirname (&dirp->current)) <= NAME_MAX); - strncpy (dirp->current.d_name, + NEW_STRNCPY (dirp->current.d_name, _getdirname (&dirp->current), NAME_MAX); dirp->current.d_name[NAME_MAX] = '\0'; /*char d_name[NAME_MAX+1]*/