Mercurial > hg > octave-jordi
changeset 21025:5a340d8458d6
maint: Alphabetize list of gripes.
* gripes.h, gripes.cc: Alphabetize list of gripes.
author | Rik <rik@octave.org> |
---|---|
date | Sat, 02 Jan 2016 10:28:59 -0800 |
parents | f7e64e1baa08 |
children | 8000dacaea98 |
files | libinterp/corefcn/gripes.cc libinterp/corefcn/gripes.h |
diffstat | 2 files changed, 189 insertions(+), 180 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/gripes.cc +++ b/libinterp/corefcn/gripes.cc @@ -30,28 +30,103 @@ #include "ovl.h" #include "utils.h" +//////////////////////////////////////////////////////////////////////////////// +// Alphabetized list of gripes. +//////////////////////////////////////////////////////////////////////////////// + void -gripe_not_supported (const char *fcn) +gripe_2_or_3_dim_plot (void) +{ + error ("plot: can only plot in 2 or 3 dimensions"); +} + +void +gripe_data_conversion (const char *from, const char *to) +{ + error ("unable to convert from %s to %s format", from, to); +} + +void +gripe_data_file_in_path (const std::string& fcn, const std::string& file) { - error ("%s: not supported on this system", fcn); + warning_with_id ("Octave:data-file-in-path", + "%s: '%s' found by searching load path", + fcn.c_str (), file.c_str ()); +} + +void +gripe_disabled_feature (const std::string& func, const std::string& feature, + const std::string& pkg /*="Octave"*/) +{ + error ("%s: support for %s was disabled when %s was built", + func.c_str (), feature.c_str (), pkg.c_str ()); +} + +void +gripe_divide_by_zero (void) +{ + warning_with_id ("Octave:divide-by-zero", "division by zero"); +} + +void +gripe_empty_arg (const char *name, bool is_error) +{ + if (is_error) + error ("%s: empty matrix is invalid as an argument", name); + else + warning ("%s: argument is empty matrix", name); } void -gripe_not_implemented (const char *fcn) +gripe_implicit_conversion (const char *id, const char *from, const char *to) +{ + warning_with_id (id, "implicit conversion from %s to %s", from, to); +} + +void +gripe_implicit_conversion (const std::string& id, + const std::string& from, const std::string& to) { - error ("%s: not implemented", fcn); + warning_with_id (id.c_str (), + "implicit conversion from %s to %s", + from.c_str (), to.c_str ()); +} + +void +gripe_indexed_cs_list (void) +{ + error ("a cs-list cannot be further indexed"); } void -gripe_string_invalid (void) +gripe_invalid_conversion (const std::string& from, const std::string& to) { - error ("std::string constant used in invalid context"); + error ("invalid conversion from %s to %s", from.c_str (), to.c_str ()); +} + +void +gripe_invalid_inquiry_subscript (void) +{ + error ("invalid dimension inquiry of a non-existent value"); } void -gripe_range_invalid (void) +gripe_invalid_value_specified (const char *name) +{ + warning ("invalid value specified for '%s'", name); +} + +void +gripe_logical_conversion (void) { - error ("range constant used in invalid context"); + warning_with_id ("Octave:logical-conversion", + "value not equal to 1 or 0 converted to logical 1"); +} + +void +gripe_nonbraced_cs_list_assignment (void) +{ + error ("invalid assignment to cs-list outside multiple assignment"); } void @@ -69,12 +144,21 @@ } void -gripe_empty_arg (const char *name, bool is_error) +gripe_not_implemented (const char *fcn) +{ + error ("%s: not implemented", fcn); +} + +void +gripe_not_supported (const char *fcn) { - if (is_error) - error ("%s: empty matrix is invalid as an argument", name); - else - warning ("%s: argument is empty matrix", name); + error ("%s: not supported on this system", fcn); +} + +void +gripe_range_invalid (void) +{ + error ("range constant used in invalid context"); } void @@ -84,6 +168,30 @@ } void +gripe_string_invalid (void) +{ + error ("std::string constant used in invalid context"); +} + +void +gripe_unrecognized_data_fmt (const char *warn_for) +{ + error ("%s: unrecognized data format requested", warn_for); +} + +void +gripe_unrecognized_float_fmt (void) +{ + error ("unrecognized floating point format requested"); +} + +void +gripe_user_returned_invalid (const char *name) +{ + error ("%s: user-supplied function returned invalid value", name); +} + +void gripe_user_supplied_eval (const char *name) { octave_execution_exception e; @@ -99,45 +207,10 @@ } void -gripe_user_returned_invalid (const char *name) -{ - error ("%s: user-supplied function returned invalid value", name); -} - -void -gripe_invalid_conversion (const std::string& from, const std::string& to) -{ - error ("invalid conversion from %s to %s", from.c_str (), to.c_str ()); -} - -void -gripe_invalid_value_specified (const char *name) -{ - warning ("invalid value specified for '%s'", name); -} - -void -gripe_2_or_3_dim_plot (void) +gripe_warn_complex_cmp (void) { - error ("plot: can only plot in 2 or 3 dimensions"); -} - -void -gripe_unrecognized_float_fmt (void) -{ - error ("unrecognized floating point format requested"); -} - -void -gripe_unrecognized_data_fmt (const char *warn_for) -{ - error ("%s: unrecognized data format requested", warn_for); -} - -void -gripe_data_conversion (const char *from, const char *to) -{ - error ("unable to convert from %s to %s format", from, to); + warning_with_id ("Octave:language-extension", + "comparing complex numbers is not supported in Matlab"); } void @@ -260,13 +333,6 @@ } void -gripe_wrong_type_arg_for_unary_op (const octave_value& op) -{ - std::string type = op.type_name (); - error ("invalid operand '%s' for unary operator", type.c_str ()); -} - -void gripe_wrong_type_arg_for_binary_op (const octave_value& op) { std::string type = op.type_name (); @@ -274,70 +340,9 @@ } void -gripe_implicit_conversion (const char *id, const char *from, const char *to) -{ - warning_with_id (id, "implicit conversion from %s to %s", from, to); -} - -void -gripe_implicit_conversion (const std::string& id, - const std::string& from, const std::string& to) +gripe_wrong_type_arg_for_unary_op (const octave_value& op) { - warning_with_id (id.c_str (), - "implicit conversion from %s to %s", - from.c_str (), to.c_str ()); -} - -void -gripe_divide_by_zero (void) -{ - warning_with_id ("Octave:divide-by-zero", "division by zero"); -} - -void -gripe_logical_conversion (void) -{ - warning_with_id ("Octave:logical-conversion", - "value not equal to 1 or 0 converted to logical 1"); -} - -void -gripe_invalid_inquiry_subscript (void) -{ - error ("invalid dimension inquiry of a non-existent value"); + std::string type = op.type_name (); + error ("invalid operand '%s' for unary operator", type.c_str ()); } -void -gripe_indexed_cs_list (void) -{ - error ("a cs-list cannot be further indexed"); -} - -void -gripe_nonbraced_cs_list_assignment (void) -{ - error ("invalid assignment to cs-list outside multiple assignment"); -} - -void -gripe_warn_complex_cmp (void) -{ - warning_with_id ("Octave:language-extension", - "comparing complex numbers is not supported in Matlab"); -} - -void -gripe_disabled_feature (const std::string& func, const std::string& feature, - const std::string& pkg /*="Octave"*/) -{ - error ("%s: support for %s was disabled when %s was built", - func.c_str (), feature.c_str (), pkg.c_str ()); -} - -void -gripe_data_file_in_path (const std::string& fcn, const std::string& file) -{ - warning_with_id ("Octave:data-file-in-path", - "%s: '%s' found by searching load path", - fcn.c_str (), file.c_str ()); -}
--- a/libinterp/corefcn/gripes.h +++ b/libinterp/corefcn/gripes.h @@ -30,17 +30,53 @@ class octave_value; class octave_execution_exception; +//////////////////////////////////////////////////////////////////////////////// +// Alphabetized list of gripes. +//////////////////////////////////////////////////////////////////////////////// + extern OCTINTERP_API void GCC_ATTR_NORETURN -gripe_not_supported (const char *); +gripe_2_or_3_dim_plot (void); + +extern OCTINTERP_API void GCC_ATTR_NORETURN +gripe_data_conversion (const char *from, const char *to); + +extern OCTINTERP_API void +gripe_data_file_in_path (const std::string& fcn, const std::string& file); extern OCTINTERP_API void GCC_ATTR_NORETURN -gripe_not_implemented (const char *); +gripe_disabled_feature (const std::string& func, const std::string& feature, + const std::string& pkg="Octave"); + +extern OCTINTERP_API void +gripe_divide_by_zero (void); + +extern OCTINTERP_API void +gripe_empty_arg (const char *name, bool is_error); + +extern OCTINTERP_API void +gripe_implicit_conversion (const char *id, const char *from, const char *to); + +extern OCTINTERP_API void +gripe_implicit_conversion (const std::string& id, const std::string& from, + const std::string& to); extern OCTINTERP_API void GCC_ATTR_NORETURN -gripe_string_invalid (void); +gripe_indexed_cs_list (void); + +extern OCTINTERP_API void GCC_ATTR_NORETURN +gripe_invalid_conversion (const std::string& from, const std::string& to); extern OCTINTERP_API void GCC_ATTR_NORETURN -gripe_range_invalid (void); +gripe_invalid_inquiry_subscript (void); + +extern OCTINTERP_API void +gripe_invalid_value_specified (const char *name); + +extern OCTINTERP_API void +gripe_logical_conversion (void); + +extern OCTINTERP_API void GCC_ATTR_NORETURN +gripe_nonbraced_cs_list_assignment (void); extern OCTINTERP_API void GCC_ATTR_NORETURN gripe_nonconformant (void); @@ -49,38 +85,38 @@ gripe_nonconformant (octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2); -extern OCTINTERP_API void -gripe_empty_arg (const char *name, bool is_error); +extern OCTINTERP_API void GCC_ATTR_NORETURN +gripe_not_implemented (const char *); + +extern OCTINTERP_API void GCC_ATTR_NORETURN +gripe_not_supported (const char *); + +extern OCTINTERP_API void GCC_ATTR_NORETURN +gripe_range_invalid (void); extern OCTINTERP_API void GCC_ATTR_NORETURN gripe_square_matrix_required (const char *name); extern OCTINTERP_API void GCC_ATTR_NORETURN +gripe_string_invalid (void); + +extern OCTINTERP_API void GCC_ATTR_NORETURN +gripe_unrecognized_data_fmt (const char *warn_for); + +extern OCTINTERP_API void GCC_ATTR_NORETURN +gripe_unrecognized_float_fmt (void); + +extern OCTINTERP_API void GCC_ATTR_NORETURN +gripe_user_returned_invalid (const char *name); + +extern OCTINTERP_API void GCC_ATTR_NORETURN gripe_user_supplied_eval (const char *name); extern OCTINTERP_API void GCC_ATTR_NORETURN gripe_user_supplied_eval (octave_execution_exception& e, const char *name); -extern OCTINTERP_API void GCC_ATTR_NORETURN -gripe_user_returned_invalid (const char *name); - -extern OCTINTERP_API void GCC_ATTR_NORETURN -gripe_invalid_conversion (const std::string& from, const std::string& to); - extern OCTINTERP_API void -gripe_invalid_value_specified (const char *name); - -extern OCTINTERP_API void GCC_ATTR_NORETURN -gripe_2_or_3_dim_plot (void); - -extern OCTINTERP_API void GCC_ATTR_NORETURN -gripe_unrecognized_float_fmt (void); - -extern OCTINTERP_API void GCC_ATTR_NORETURN -gripe_unrecognized_data_fmt (const char *warn_for); - -extern OCTINTERP_API void GCC_ATTR_NORETURN -gripe_data_conversion (const char *from, const char *to); +gripe_warn_complex_cmp (void); extern OCTINTERP_API void gripe_wrong_type_arg (const char *name, const char *s, @@ -146,41 +182,9 @@ bool is_error = true); extern OCTINTERP_API void GCC_ATTR_NORETURN -gripe_wrong_type_arg_for_unary_op (const octave_value& op); - -extern OCTINTERP_API void GCC_ATTR_NORETURN gripe_wrong_type_arg_for_binary_op (const octave_value& op); -extern OCTINTERP_API void -gripe_implicit_conversion (const char *id, const char *from, const char *to); - -extern OCTINTERP_API void -gripe_implicit_conversion (const std::string& id, const std::string& from, - const std::string& to); - -extern OCTINTERP_API void -gripe_divide_by_zero (void); - -extern OCTINTERP_API void -gripe_logical_conversion (void); - extern OCTINTERP_API void GCC_ATTR_NORETURN -gripe_invalid_inquiry_subscript (void); - -extern OCTINTERP_API void GCC_ATTR_NORETURN -gripe_indexed_cs_list (void); - -extern OCTINTERP_API void GCC_ATTR_NORETURN -gripe_nonbraced_cs_list_assignment (void); - -extern OCTINTERP_API void -gripe_warn_complex_cmp (void); - -extern OCTINTERP_API void GCC_ATTR_NORETURN -gripe_disabled_feature (const std::string& func, const std::string& feature, - const std::string& pkg="Octave"); - -extern OCTINTERP_API void -gripe_data_file_in_path (const std::string& fcn, const std::string& file); +gripe_wrong_type_arg_for_unary_op (const octave_value& op); #endif