File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed
Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -340,6 +340,12 @@ IF(RENDERER_TRACE_ON)
340340 ADD_DEFINITIONS (-DRENDERER_TRACE_ON)
341341ENDIF ()
342342
343+ ########################################################################
344+ # Matlab i/o option--see issue #1727 and #1692
345+
346+ OPTION (MATLAB_STRING_OUTPUT_SIGNED_TYPE_FIX_FOR_SCIPY "Toggle quasi-fix for Issue #1692." OFF )
347+ MARK_AS_ADVANCED (MATLAB_STRING_OUTPUT_SIGNED_TYPE_FIX_FOR_SCIPY)
348+
343349########################################################################
344350# Copy Spire-SCIRun specific assets and shaders
345351
Original file line number Diff line number Diff line change @@ -68,6 +68,10 @@ TARGET_LINK_LIBRARIES(Core_Matlab
6868 ${SCI_TEEM_LIBRARY}
6969)
7070
71+ IF (MATLAB_STRING_OUTPUT_SIGNED_TYPE_FIX_FOR_SCIPY)
72+ ADD_DEFINITIONS (-DMATLAB_STRING_OUTPUT_SIGNED_TYPE_FIX_FOR_SCIPY)
73+ ENDIF ()
74+
7175IF (BUILD_SHARED_LIBS )
7276 ADD_DEFINITIONS (-DBUILD_Core_Matlab)
7377ENDIF (BUILD_SHARED_LIBS )
Original file line number Diff line number Diff line change 5959
6060using namespace SCIRun ::MatlabIO;
6161
62+ #ifdef MATLAB_STRING_OUTPUT_SIGNED_TYPE_FIX_FOR_SCIPY
63+ #define MATLAB_STRING_OUTPUT_DATATYPE miINT8
64+ #else
65+ #define MATLAB_STRING_OUTPUT_DATATYPE miUINT8
66+ #endif
67+
6268matfiledata::matfiledata ()
6369 : m_(nullptr ), ptr_(nullptr )
6470{
@@ -273,13 +279,13 @@ void matfiledata::putstring(const std::string& str)
273279 clear ();
274280 if (dsize > 0 )
275281 {
276- newdatabuffer (dsize,miUINT8 );
282+ newdatabuffer (dsize, MATLAB_STRING_OUTPUT_DATATYPE );
277283 ptr = static_cast <char *>(databuffer ());
278284 for (int p=0 ;p<dsize;p++) { ptr[p] = str[p];}
279285 }
280286 else
281287 {
282- m_->type_ = miUINT8 ;
288+ m_->type_ = MATLAB_STRING_OUTPUT_DATATYPE ;
283289 }
284290}
285291
You can’t perform that action at this time.
0 commit comments