Mercurial > octave
changeset 23398:d4ef04757ead
eliminate some compiler warnings
* oct-stream.cc (textscan::numeric_delim): Delete unused data member.
* pr-output.cc (set_format): Delete unused functions.
* xdiv.cc (result_ok): Delete unused function.
* oct-parse.in.yy: Tag token with octave:: as needed.
* pt-eval.cc: Tag tree_break_command with octave:: as needed.
* pt-loop.h (tree_while_command::compiled): Only define data member if
HAVE_LLVM is defined.
* Range.cc (tceil): Delete unused function.
* quit.cc (octave_throw_exit_exception, octave_rethrow_exception):
Avoid deprecated declaration warning.
* quit.h (octave_throw_exit_exception): Deprecate.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 13 Apr 2017 14:25:16 -0400 |
parents | 5970860bc70c |
children | 5e0350f5e2dd |
files | libinterp/corefcn/oct-stream.cc libinterp/corefcn/pr-output.cc libinterp/corefcn/xdiv.cc libinterp/parse-tree/oct-parse.in.yy libinterp/parse-tree/pt-eval.cc libinterp/parse-tree/pt-loop.h liboctave/array/Range.cc liboctave/cruft/misc/quit.cc liboctave/cruft/misc/quit.h |
diffstat | 9 files changed, 40 insertions(+), 59 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/oct-stream.cc Thu Apr 13 11:42:43 2017 -0400 +++ b/libinterp/corefcn/oct-stream.cc Thu Apr 13 14:25:16 2017 -0400 @@ -1883,7 +1883,6 @@ bool collect_output; bool multiple_delims_as_one; bool default_exp; - bool numeric_delim; octave_idx_type lines; @@ -2550,8 +2549,7 @@ header_lines (0), treat_as_empty (), treat_as_empty_len (0), whitespace (" \b\t"), eol1 ('\r'), eol2 ('\n'), return_on_error (1), collect_output (false), - multiple_delims_as_one (false), default_exp (true), - numeric_delim (false), lines (0) + multiple_delims_as_one (false), default_exp (true), lines (0) { } octave_value
--- a/libinterp/corefcn/pr-output.cc Thu Apr 13 11:42:43 2017 -0400 +++ b/libinterp/corefcn/pr-output.cc Thu Apr 13 14:25:16 2017 -0400 @@ -832,14 +832,6 @@ set_real_matrix_format (x_max, x_min, inf_or_nan, int_or_inf_or_nan, fw); } -static inline void -set_format (const Matrix& m) -{ - int fw; - double scale; - set_format (m, fw, scale); -} - static void set_complex_format (int x_max, int x_min, int r_x, bool inf_or_nan, int int_only, int& r_fw, int& i_fw) @@ -1252,14 +1244,6 @@ int_or_inf_or_nan, r_fw, i_fw); } -static inline void -set_format (const ComplexMatrix& cm) -{ - int r_fw, i_fw; - double scale; - set_format (cm, r_fw, i_fw, scale); -} - static void set_range_format (int x_max, int x_min, int all_ints, int& fw) { @@ -1407,14 +1391,6 @@ set_range_format (x_max, x_min, all_ints, fw); } -static inline void -set_format (const Range& r) -{ - int fw; - double scale; - set_format (r, fw, scale); -} - union equiv { double d;
--- a/libinterp/corefcn/xdiv.cc Thu Apr 13 11:42:43 2017 -0400 +++ b/libinterp/corefcn/xdiv.cc Thu Apr 13 14:25:16 2017 -0400 @@ -48,14 +48,6 @@ #include "error.h" #include "xdiv.h" -static inline bool -result_ok (octave_idx_type info) -{ - assert (info != -1); - - return (info != -2); -} - static void solve_singularity_warning (double rcond) {
--- a/libinterp/parse-tree/oct-parse.in.yy Thu Apr 13 11:42:43 2017 -0400 +++ b/libinterp/parse-tree/oct-parse.in.yy Thu Apr 13 14:25:16 2017 -0400 @@ -1561,12 +1561,12 @@ { parser.endfunction_found = true; - if (parser.end_token_ok ($1, token::function_end)) + if (parser.end_token_ok ($1, octave::token::function_end)) $$ = parser.make_end ("endfunction", false, $1->line (), $1->column ()); else { - parser.end_token_error ($1, token::function_end); + parser.end_token_error ($1, octave::token::function_end); YYABORT; } } @@ -2197,65 +2197,65 @@ // Error mesages for mismatched end tokens. static std::string -end_token_as_string (token::end_tok_type ettype) +end_token_as_string (octave::token::end_tok_type ettype) { std::string retval = "<unknown>"; switch (ettype) { - case token::simple_end: + case octave::token::simple_end: retval = "end"; break; - case token::classdef_end: + case octave::token::classdef_end: retval = "endclassdef"; break; - case token::enumeration_end: + case octave::token::enumeration_end: retval = "endenumeration"; break; - case token::events_end: + case octave::token::events_end: retval = "endevents"; break; - case token::for_end: + case octave::token::for_end: retval = "endfor"; break; - case token::function_end: + case octave::token::function_end: retval = "endfunction"; break; - case token::if_end: + case octave::token::if_end: retval = "endif"; break; - case token::methods_end: + case octave::token::methods_end: retval = "endmethods"; break; - case token::parfor_end: + case octave::token::parfor_end: retval = "endparfor"; break; - case token::properties_end: + case octave::token::properties_end: retval = "endproperties"; break; - case token::switch_end: + case octave::token::switch_end: retval = "endswitch"; break; - case token::try_catch_end: + case octave::token::try_catch_end: retval = "end_try_catch"; break; - case token::unwind_protect_end: + case octave::token::unwind_protect_end: retval = "end_unwind_protect"; break; - case token::while_end: + case octave::token::while_end: retval = "endwhile"; break;
--- a/libinterp/parse-tree/pt-eval.cc Thu Apr 13 11:42:43 2017 -0400 +++ b/libinterp/parse-tree/pt-eval.cc Thu Apr 13 14:25:16 2017 -0400 @@ -249,7 +249,7 @@ || octave::tree_break_command::breaking || octave::tree_continue_command::continuing); - if (tree_break_command::breaking) + if (octave::tree_break_command::breaking) octave::tree_break_command::breaking--; return quit;
--- a/libinterp/parse-tree/pt-loop.h Thu Apr 13 11:42:43 2017 -0400 +++ b/libinterp/parse-tree/pt-loop.h Thu Apr 13 14:25:16 2017 -0400 @@ -262,8 +262,10 @@ // Comment preceding ENDFOR token. octave_comment_list *trail_comm; +#if defined (HAVE_LLVM) // compiled version of the loop jit_info *compiled; +#endif }; class tree_complex_for_command : public tree_command
--- a/liboctave/array/Range.cc Thu Apr 13 11:42:43 2017 -0400 +++ b/liboctave/array/Range.cc Thu Apr 13 14:25:16 2017 -0400 @@ -498,12 +498,6 @@ return t1 - 1.0; } -static inline double -tceil (double x, double ct) -{ - return -tfloor (-x, ct); -} - static inline bool teq (double u, double v, double ct = 3.0 * std::numeric_limits<double>::epsilon ())
--- a/liboctave/cruft/misc/quit.cc Thu Apr 13 11:42:43 2017 -0400 +++ b/liboctave/cruft/misc/quit.cc Thu Apr 13 14:25:16 2017 -0400 @@ -89,7 +89,16 @@ { octave_exception_state = octave_quit_exception; +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + throw octave_exit_exception (exit_status, safe_to_return); + +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic pop +#endif } void @@ -112,11 +121,20 @@ octave_throw_bad_alloc (); break; +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + case octave_quit_exception: octave_throw_exit_exception (octave_exit_exception_status, octave_exit_exception_safe_to_return); break; +#if defined (HAVE_PRAGMA_GCC_DIAGNOSTIC) +#pragma GCC diagnostic pop +#endif + default: break; }
--- a/liboctave/cruft/misc/quit.h Thu Apr 13 11:42:43 2017 -0400 +++ b/liboctave/cruft/misc/quit.h Thu Apr 13 14:25:16 2017 -0400 @@ -189,6 +189,7 @@ OCTAVE_NORETURN OCTAVE_API extern void octave_throw_bad_alloc (void); +OCTAVE_DEPRECATED ("see the Octave documentation for other options") OCTAVE_NORETURN OCTAVE_API extern void octave_throw_exit_exception (int exit_status, int safe_to_return);