Mercurial > hg > octave-lyh
changeset 8677:095ae5e0a831
eliminte some compiler warnings
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 05 Feb 2009 02:42:58 -0500 |
parents | 22462fd58e66 |
children | e2b4c19c455c |
files | liboctave/Array-util.cc liboctave/ChangeLog liboctave/MArray-f.cc liboctave/MArray-fC.cc liboctave/Sparse.cc liboctave/eigs-base.cc liboctave/idx-vector.cc src/ChangeLog src/debug.cc src/ov-base.cc src/ov-flt-cx-diag.cc src/ov-flt-re-diag.cc src/ov-null-mat.cc src/ov-typeinfo.cc src/pt-eval.cc src/variables.cc |
diffstat | 16 files changed, 63 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/Array-util.cc +++ b/liboctave/Array-util.cc @@ -388,8 +388,8 @@ return retval; } -dim_vector zero_dims_inquire (const Array<idx_vector>& ia, - const dim_vector& rhdv) +dim_vector +zero_dims_inquire (const Array<idx_vector>& ia, const dim_vector& rhdv) { int ial = ia.length (), rhdvl = rhdv.length (); dim_vector rdv; @@ -408,7 +408,6 @@ all_colons = all_colons && colon[i]; } - bool match = false; // If the number of nonscalar indices matches the dimensionality of // RHS, we try an exact match, inquiring even singleton dimensions. if (all_colons) @@ -444,8 +443,9 @@ return rdv; } -dim_vector zero_dims_inquire (const idx_vector& i, const idx_vector& j, - const dim_vector& rhdv) +dim_vector +zero_dims_inquire (const idx_vector& i, const idx_vector& j, + const dim_vector& rhdv) { bool icol = i.is_colon (), jcol = j.is_colon (); dim_vector rdv;
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,17 @@ +2009-02-05 John W. Eaton <jwe@octave.org> + + * Array-util.cc (zero_dims_inquire): Eliminate unused variable MATCH. + + * Sparse.cc (assign (Sparse<LT>& lhs, const Sparse<RT>& rhs)): + Eliminate unused variable N. + + * MArray-f.cc (MArray<float>::norm (float p) const, + MArray<FloatComplex>::norm (float p) const): Pass P to xnorm. + + * eigs-base.cc (EigsRealNonSymmetricFunc, EigsRealSymmetricFunc) + (EigsComplexNonSymmetricFunc): Avoid unused parameter warning. + * idx-vector.cc (idx_vector::freeze): Likewise. + 2009-02-04 Jaroslav Hajek <highegg@gmail.com> * oct-locbuf.h: Specialize OCTAVE_LOCAL_BUFFER to use chunked
--- a/liboctave/MArray-f.cc +++ b/liboctave/MArray-f.cc @@ -36,7 +36,7 @@ OCTAVE_API float MArray<float>::norm (float p) const { - return xnorm (FloatColumnVector (*this)); + return xnorm (FloatColumnVector (*this), p); } template class OCTAVE_API MArray<float>;
--- a/liboctave/MArray-fC.cc +++ b/liboctave/MArray-fC.cc @@ -39,7 +39,7 @@ OCTAVE_API float MArray<FloatComplex>::norm (float p) const { - return xnorm (FloatComplexColumnVector (*this)); + return xnorm (FloatComplexColumnVector (*this), p); } template class OCTAVE_API MArray<FloatComplex>;
--- a/liboctave/Sparse.cc +++ b/liboctave/Sparse.cc @@ -3224,7 +3224,8 @@ { octave_idx_type lhs_len = lhs.length (); - octave_idx_type n = idx_i.freeze (lhs_len, 0, true); + // Called for side-effects on idx_i. + idx_i.freeze (lhs_len, 0, true); if (idx_i) {
--- a/liboctave/eigs-base.cc +++ b/liboctave/eigs-base.cc @@ -1384,8 +1384,8 @@ octave_idx_type k, octave_idx_type p, octave_idx_type &info, Matrix &eig_vec, ColumnVector &eig_val, ColumnVector &resid, - std::ostream& os, double tol, int rvec, bool cholB, - int disp, int maxit) + std::ostream& os, double tol, int rvec, + bool /* cholB */, int disp, int maxit) { std::string typ (_typ); bool have_sigma = (sigma ? true : false); @@ -2362,8 +2362,8 @@ octave_idx_type k, octave_idx_type p, octave_idx_type &info, ComplexMatrix &eig_vec, ComplexColumnVector &eig_val, ColumnVector &resid, - std::ostream& os, double tol, int rvec, bool cholB, - int disp, int maxit) + std::ostream& os, double tol, int rvec, + bool /* cholB */, int disp, int maxit) { std::string typ (_typ); bool have_sigma = (sigmar ? true : false); @@ -3302,8 +3302,8 @@ octave_idx_type &info, ComplexMatrix &eig_vec, ComplexColumnVector &eig_val, ComplexColumnVector &cresid, std::ostream& os, - double tol, int rvec, bool cholB, int disp, - int maxit) + double tol, int rvec, bool /* cholB */, + int disp, int maxit) { std::string typ (_typ); bool have_sigma = (std::abs(sigma) ? true : false);
--- a/liboctave/idx-vector.cc +++ b/liboctave/idx-vector.cc @@ -589,7 +589,7 @@ } octave_idx_type -idx_vector::freeze (octave_idx_type z_len, const char *tag, bool resize_ok) +idx_vector::freeze (octave_idx_type z_len, const char *, bool resize_ok) { if (! resize_ok && extent (z_len) > z_len) {
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,25 @@ 2009-02-05 John W. Eaton <jwe@octave.org> + * variables.cc (Vignore_function_time_stamp): + Eliminate unused static variable. + + * debug.cc (get_file_line): Override default precedence in logical + expression. + + * ov-null-mat.cc (default_null_str_numeric_conversion_function, + default_null_sq_str_numeric_conversion_function, + default_null_matrix_numeric_conversion_function): + Avoid unused variable warning. + + * ov-flt-re-diag.cc (octave_float_diag_matrix::save_binary): + Avoid unused parameter warning. + * pt-eval.cc (tree_evaluator::visit_if_clause): Likewise. + * ov-typeinfo.cc (octave_value_typeinfo::do_register_type): Likewise. + * ov-base.cc (octave_base_value::subsref (const std::string&, + const std::list<octave_value_list>&, bool): Likewise. + * ov-flt-cx-diag.cc (octave_float_complex_diag_matrix::save_binary): + Likewise. + * oct-hdf5.h: New file. * ls-hdf5.cc, ov-base.h, ov.h: Include oct-hdf5.h instead of hdf5.h. * ls-hdf5.h: Include oct-hdf5.h.
--- a/src/debug.cc +++ b/src/debug.cc @@ -153,7 +153,7 @@ size_t bol = offsets[line]; size_t eol = offsets[line+1]; - while (eol > 0 && buf[eol-1] == '\n' || buf[eol-1] == '\r') + while (eol > 0 && (buf[eol-1] == '\n' || buf[eol-1] == '\r')) eol--; retval = buf.substr (bol, eol - bol);
--- a/src/ov-base.cc +++ b/src/ov-base.cc @@ -97,7 +97,7 @@ octave_value octave_base_value::subsref (const std::string& type, const std::list<octave_value_list>& idx, - bool auto_add) + bool /* auto_add */) { // This way we may get a more meaningful error message. return subsref (type, idx);
--- a/src/ov-flt-cx-diag.cc +++ b/src/ov-flt-cx-diag.cc @@ -145,7 +145,7 @@ bool octave_float_complex_diag_matrix::save_binary (std::ostream& os, - bool& save_as_floats) + bool& /* save_as_floats */) { int32_t r = matrix.rows (), c = matrix.cols ();
--- a/src/ov-flt-re-diag.cc +++ b/src/ov-flt-re-diag.cc @@ -115,7 +115,8 @@ } bool -octave_float_diag_matrix::save_binary (std::ostream& os, bool& save_as_floats) +octave_float_diag_matrix::save_binary (std::ostream& os, + bool& /* save_as_floats*/) { int32_t r = matrix.rows (), c = matrix.cols ();
--- a/src/ov-null-mat.cc +++ b/src/ov-null-mat.cc @@ -35,7 +35,8 @@ static octave_base_value * default_null_matrix_numeric_conversion_function (const octave_base_value& a) { - CAST_CONV_ARG (const octave_null_matrix&); + // The cast is not necessary? + // CAST_CONV_ARG (const octave_null_matrix&); return a.empty_clone (); } @@ -54,7 +55,8 @@ static octave_base_value * default_null_str_numeric_conversion_function (const octave_base_value& a) { - CAST_CONV_ARG (const octave_null_str&); + // The cast is not necessary? + // CAST_CONV_ARG (const octave_null_str&); return a.empty_clone (); } @@ -73,7 +75,8 @@ static octave_base_value * default_null_sq_str_numeric_conversion_function (const octave_base_value& a) { - CAST_CONV_ARG (const octave_null_sq_str&); + // The cast is not necessary? + // CAST_CONV_ARG (const octave_null_sq_str&); return a.empty_clone (); }
--- a/src/ov-typeinfo.cc +++ b/src/ov-typeinfo.cc @@ -211,7 +211,7 @@ int octave_value_typeinfo::do_register_type (const std::string& t_name, - const std::string& c_name, + const std::string& /* c_name */, const octave_value& val) { int i = 0;
--- a/src/pt-eval.cc +++ b/src/pt-eval.cc @@ -510,7 +510,7 @@ } void -tree_evaluator::visit_if_clause (tree_if_clause& tic) +tree_evaluator::visit_if_clause (tree_if_clause&) { panic_impossible (); }
--- a/src/variables.cc +++ b/src/variables.cc @@ -61,10 +61,6 @@ #include "utils.h" #include "variables.h" -// Should Octave always check to see if function files have changed -// since they were last compiled? -static int Vignore_function_time_stamp = 1; - // Defines layout for the whos/who -long command static std::string Vwhos_line_format = " %a:4; %ln:6; %cs:16:6:1; %rb:12; %lc:-1;\n";