changeset 30008:9adf2b6a18fc

mark some internal functions as static * oct-stream.cc (octave_scan_1, octave_scan, do_scanf_conv, do_printf_conv): Declare static. These templates that are only used internally. (octave_scan<> (std::istream&, const scanf_format_elt&, char*)): Delete unused specialization.
author John W. Eaton <jwe@octave.org>
date Wed, 18 Aug 2021 16:53:56 -0400
parents 62f2c0a3982c
children feb1a81ced05
files libinterp/corefcn/oct-stream.cc
diffstat 1 files changed, 4 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/oct-stream.cc	Wed Aug 18 16:14:06 2021 -0400
+++ b/libinterp/corefcn/oct-stream.cc	Wed Aug 18 16:53:56 2021 -0400
@@ -4195,7 +4195,7 @@
   }
 
   template <typename T>
-  std::istream&
+  static std::istream&
   octave_scan_1 (std::istream& is, const scanf_format_elt& fmt,
                  T *valptr)
   {
@@ -4284,7 +4284,7 @@
   }
 
   template <typename T>
-  std::istream&
+  static std::istream&
   octave_scan (std::istream& is, const scanf_format_elt& fmt, T *valptr)
   {
     if (fmt.width)
@@ -4332,17 +4332,6 @@
     return is;
   }
 
-  // Note that this specialization is only used for reading characters, not
-  // character strings.  See BEGIN_S_CONVERSION for details.
-
-  template <>
-  std::istream&
-  octave_scan<> (std::istream& is, const scanf_format_elt& /* fmt */,
-                 char *valptr)
-  {
-    return is >> valptr;
-  }
-
   template <>
   std::istream&
   octave_scan<> (std::istream& is, const scanf_format_elt& fmt, double *valptr)
@@ -4381,7 +4370,7 @@
   }
 
   template <typename T>
-  void
+  static void
   do_scanf_conv (std::istream& is, const scanf_format_elt& fmt,
                  T valptr, Matrix& mval, double *data, octave_idx_type& idx,
                  octave_idx_type& conversion_count, octave_idx_type nr,
@@ -5604,7 +5593,7 @@
   // Ugh again and again.
 
   template <typename T>
-  int
+  static int
   do_printf_conv (std::ostream& os, const std::string& encoding,
                   const char *fmt, int nsa, int sa_1, int sa_2, T arg,
                   const std::string& who)