changeset 26344:acfd683ea00b stable

__eigs__.cc: Fix static analyzer detected issues (bug #55347). * __eigs__.cc (eigs_complex_func): Call correct input conversion function xcomplex_vector_value. Write "0.0" rather than "0." for clarity.
author Rik <rik@octave.org>
date Tue, 01 Jan 2019 10:39:04 -0800
parents df510676ca6a
children 7c6ff9b36302
files libinterp/dldfcn/__eigs__.cc
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/dldfcn/__eigs__.cc	Tue Jan 01 18:33:08 2019 +0100
+++ b/libinterp/dldfcn/__eigs__.cc	Tue Jan 01 10:39:04 2019 -0800
@@ -114,7 +114,7 @@
 
       if (tmp.length () && tmp(0).is_defined ())
         {
-          retval = tmp(0).complex_vector_value ("eigs: evaluation of user-supplied function failed");
+          retval = tmp(0).xcomplex_vector_value ("eigs: evaluation of user-supplied function failed");
         }
       else
         {
@@ -165,7 +165,7 @@
   std::string fcn_name;
   octave_idx_type n = 0;
   octave_idx_type k = 6;
-  Complex sigma = 0.;
+  Complex sigma = 0.0;
   double sigmar, sigmai;
   bool have_sigma = false;
   std::string typ = "LM";
@@ -304,7 +304,7 @@
           // Use STL function to convert to upper case
           transform (typ.begin (), typ.end (), typ.begin (), toupper);
 
-          sigma = 0.;
+          sigma = 0.0;
         }
       else
         {
@@ -330,14 +330,14 @@
       tmp = map.getfield ("issym");
       if (tmp.is_defined () && ! sym_tested)
         {
-          symmetric = tmp.double_value () != 0.;
+          symmetric = tmp.double_value () != 0.0;
           sym_tested = true;
         }
 
       // isreal is ignored if A is not a function
       tmp = map.getfield ("isreal");
       if (tmp.is_defined () && have_a_fun)
-        a_is_complex = ! (tmp.double_value () != 0.);
+        a_is_complex = ! (tmp.double_value () != 0.0);
 
       tmp = map.getfield ("tol");
       if (tmp.is_defined ())
@@ -366,7 +366,7 @@
 
       tmp = map.getfield ("cholB");
       if (tmp.is_defined ())
-        cholB = tmp.double_value () != 0.;
+        cholB = tmp.double_value () != 0.0;
 
       tmp = map.getfield ("permB");
       if (tmp.is_defined ())
@@ -459,7 +459,7 @@
       else
         retval = ovl (eig_vec, ComplexDiagMatrix (eig_val), double (info));
     }
-  else if (sigmai != 0.)
+  else if (sigmai != 0.0)
     {
       // Promote real problem to a complex one.
       ComplexMatrix eig_vec;