diff liboctave/util/oct-inttypes.h @ 30232:a2936935c7c8

attempt to limit possible const_cast damage * Array.h (Array<T>::mex_get_data): Delete. * Sparse.h (Sparse<T>::mex_get_data, Sparse<T>::mex_get_ir, Sparse<T>::mex_get_jc): Delete. * oct-inttypes.h (octave_int<T>::mex_get_data): Delete. * mex.cc (mxArray_octave_value::get_data, mxArray_octave_value::get_ir, mxArray_octave_value::get_jc): Cast away const here, not in octave_value methods. * ov.h, ov.cc (octave_value::mex_get_data, octave_value::mex_get_ir, octave_value::mex_get_jc): Return const void pointer. * ov-base.h (octave_base_value::mex_get_data, octave_base_value::mex_get_ir, octave_base_value::mex_get_jc): Likewise. Change all derived classes.
author John W. Eaton <jwe@octave.org>
date Thu, 07 Oct 2021 17:08:44 -0400
parents 8d6bdd961494
children f3f3e3793fb5
line wrap: on
line diff
--- a/liboctave/util/oct-inttypes.h	Thu Oct 07 09:16:18 2021 -0700
+++ b/liboctave/util/oct-inttypes.h	Thu Oct 07 17:08:44 2021 -0400
@@ -912,10 +912,6 @@
   // The following are provided for convenience.
   static const octave_int s_zero, s_one;
 
-  // Unsafe.  This function exists to support the MEX interface.
-  // You should not use it anywhere else.
-  void * mex_get_data (void) const { return const_cast<T *> (&m_ival); }
-
 private:
 
   T m_ival;