# HG changeset patch
# User Petter Tomner <tomner@kth.se>
# Date 1641990173 -3600
#      Wed Jan 12 13:22:53 2022 +0100
# Node ID 9749aa686101e5b444788d6dca1927940a4d24c7
# Parent  b4f1a6eead03d7d7113858e37fd17bb3107c39c9
WIP: dyn -> static cast in idx-vector.h

diff -r b4f1a6eead03 -r 9749aa686101 liboctave/array/idx-vector.h
--- a/liboctave/array/idx-vector.h	Tue Jan 11 12:03:59 2022 +0100
+++ b/liboctave/array/idx-vector.h	Wed Jan 12 13:22:53 2022 +0100
@@ -607,7 +607,7 @@
 
         case class_range:
           {
-            idx_range_rep *r = dynamic_cast<idx_range_rep *> (m_rep);
+            idx_range_rep *r = static_cast<idx_range_rep *> (m_rep);
             octave_idx_type start = r->get_start ();
             octave_idx_type step = r->get_step ();
             const T *ssrc = src + start;
@@ -627,14 +627,14 @@
 
         case class_scalar:
           {
-            idx_scalar_rep *r = dynamic_cast<idx_scalar_rep *> (m_rep);
+            idx_scalar_rep *r = static_cast<idx_scalar_rep *> (m_rep);
             dest[0] = src[r->get_data ()];
           }
           break;
 
         case class_vector:
           {
-            idx_vector_rep *r = dynamic_cast<idx_vector_rep *> (m_rep);
+            idx_vector_rep *r = static_cast<idx_vector_rep *> (m_rep);
             const octave_idx_type *data = r->get_data ();
             for (octave_idx_type i = 0; i < len; i++)
               dest[i] = src[data[i]];
@@ -643,7 +643,7 @@
 
         case class_mask:
           {
-            idx_mask_rep *r = dynamic_cast<idx_mask_rep *> (m_rep);
+            idx_mask_rep *r = static_cast<idx_mask_rep *> (m_rep);
             const bool *data = r->get_data ();
             octave_idx_type ext = r->extent (0);
             for (octave_idx_type i = 0; i < ext; i++)
@@ -681,7 +681,7 @@
 
         case class_range:
           {
-            idx_range_rep *r = dynamic_cast<idx_range_rep *> (m_rep);
+            idx_range_rep *r = static_cast<idx_range_rep *> (m_rep);
             octave_idx_type start = r->get_start ();
             octave_idx_type step = r->get_step ();
             T *sdest = dest + start;
@@ -699,14 +699,14 @@
 
         case class_scalar:
           {
-            idx_scalar_rep *r = dynamic_cast<idx_scalar_rep *> (m_rep);
+            idx_scalar_rep *r = static_cast<idx_scalar_rep *> (m_rep);
             dest[r->get_data ()] = src[0];
           }
           break;
 
         case class_vector:
           {
-            idx_vector_rep *r = dynamic_cast<idx_vector_rep *> (m_rep);
+            idx_vector_rep *r = static_cast<idx_vector_rep *> (m_rep);
             const octave_idx_type *data = r->get_data ();
             for (octave_idx_type i = 0; i < len; i++)
               dest[data[i]] = src[i];
@@ -715,7 +715,7 @@
 
         case class_mask:
           {
-            idx_mask_rep *r = dynamic_cast<idx_mask_rep *> (m_rep);
+            idx_mask_rep *r = static_cast<idx_mask_rep *> (m_rep);
             const bool *data = r->get_data ();
             octave_idx_type ext = r->extent (0);
             for (octave_idx_type i = 0; i < ext; i++)
@@ -753,7 +753,7 @@
 
         case class_range:
           {
-            idx_range_rep *r = dynamic_cast<idx_range_rep *> (m_rep);
+            idx_range_rep *r = static_cast<idx_range_rep *> (m_rep);
             octave_idx_type start = r->get_start ();
             octave_idx_type step = r->get_step ();
             T *sdest = dest + start;
@@ -771,14 +771,14 @@
 
         case class_scalar:
           {
-            idx_scalar_rep *r = dynamic_cast<idx_scalar_rep *> (m_rep);
+            idx_scalar_rep *r = static_cast<idx_scalar_rep *> (m_rep);
             dest[r->get_data ()] = val;
           }
           break;
 
         case class_vector:
           {
-            idx_vector_rep *r = dynamic_cast<idx_vector_rep *> (m_rep);
+            idx_vector_rep *r = static_cast<idx_vector_rep *> (m_rep);
             const octave_idx_type *data = r->get_data ();
             for (octave_idx_type i = 0; i < len; i++)
               dest[data[i]] = val;
@@ -787,7 +787,7 @@
 
         case class_mask:
           {
-            idx_mask_rep *r = dynamic_cast<idx_mask_rep *> (m_rep);
+            idx_mask_rep *r = static_cast<idx_mask_rep *> (m_rep);
             const bool *data = r->get_data ();
             octave_idx_type ext = r->extent (0);
             for (octave_idx_type i = 0; i < ext; i++)
@@ -823,7 +823,7 @@
 
         case class_range:
           {
-            idx_range_rep *r = dynamic_cast<idx_range_rep *> (m_rep);
+            idx_range_rep *r = static_cast<idx_range_rep *> (m_rep);
             octave_idx_type start = r->get_start ();
             octave_idx_type step = r->get_step ();
             octave_idx_type i, j;
@@ -838,14 +838,14 @@
 
         case class_scalar:
           {
-            idx_scalar_rep *r = dynamic_cast<idx_scalar_rep *> (m_rep);
+            idx_scalar_rep *r = static_cast<idx_scalar_rep *> (m_rep);
             body (r->get_data ());
           }
           break;
 
         case class_vector:
           {
-            idx_vector_rep *r = dynamic_cast<idx_vector_rep *> (m_rep);
+            idx_vector_rep *r = static_cast<idx_vector_rep *> (m_rep);
             const octave_idx_type *data = r->get_data ();
             for (octave_idx_type i = 0; i < len; i++) body (data[i]);
           }
@@ -853,7 +853,7 @@
 
         case class_mask:
           {
-            idx_mask_rep *r = dynamic_cast<idx_mask_rep *> (m_rep);
+            idx_mask_rep *r = static_cast<idx_mask_rep *> (m_rep);
             const bool *data = r->get_data ();
             octave_idx_type ext = r->extent (0);
             for (octave_idx_type i = 0; i < ext; i++)
@@ -895,7 +895,7 @@
 
         case class_range:
           {
-            idx_range_rep *r = dynamic_cast<idx_range_rep *> (m_rep);
+            idx_range_rep *r = static_cast<idx_range_rep *> (m_rep);
             octave_idx_type start = r->get_start ();
             octave_idx_type step = r->get_step ();
             octave_idx_type i, j;
@@ -911,14 +911,14 @@
 
         case class_scalar:
           {
-            idx_scalar_rep *r = dynamic_cast<idx_scalar_rep *> (m_rep);
+            idx_scalar_rep *r = static_cast<idx_scalar_rep *> (m_rep);
             ret = (body (r->get_data ()) ? 1 : 0);
           }
           break;
 
         case class_vector:
           {
-            idx_vector_rep *r = dynamic_cast<idx_vector_rep *> (m_rep);
+            idx_vector_rep *r = static_cast<idx_vector_rep *> (m_rep);
             const octave_idx_type *data = r->get_data ();
             octave_idx_type i;
             for (i = 0; i < len && body (data[i]); i++) ;
@@ -928,7 +928,7 @@
 
         case class_mask:
           {
-            idx_mask_rep *r = dynamic_cast<idx_mask_rep *> (m_rep);
+            idx_mask_rep *r = static_cast<idx_mask_rep *> (m_rep);
             const bool *data = r->get_data ();
             octave_idx_type ext = r->extent (0);
             octave_idx_type j = 0;
