Mercurial > hg > octave-thorsten
changeset 11590:4ced6b90fffb
style fixes for warning and error messages in source files
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 20 Jan 2011 18:43:39 -0500 |
parents | b0084095098e |
children | 1d13679b587e |
files | liboctave/Array.cc liboctave/Sparse.cc liboctave/base-lu.cc liboctave/idx-vector.cc liboctave/lo-array-gripes.cc src/ChangeLog src/DLD-FUNCTIONS/__delaunayn__.cc src/DLD-FUNCTIONS/__init_fltk__.cc src/DLD-FUNCTIONS/__magick_read__.cc src/DLD-FUNCTIONS/cellfun.cc src/DLD-FUNCTIONS/quadcc.cc src/DLD-FUNCTIONS/regexp.cc src/data.cc src/gripes.cc src/ls-mat5.cc src/toplev.cc src/variables.cc |
diffstat | 17 files changed, 60 insertions(+), 60 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/Array.cc +++ b/liboctave/Array.cc @@ -1461,7 +1461,7 @@ else { (*current_liboctave_error_handler) - ("A null assignment can only have one non-colon index."); + ("a null assignment can only have one non-colon index"); } }
--- a/liboctave/Sparse.cc +++ b/liboctave/Sparse.cc @@ -1262,7 +1262,7 @@ } else (*current_liboctave_error_handler) - ("A null assignment can only have one non-colon index."); + ("a null assignment can only have one non-colon index"); } template <class T>
--- a/liboctave/base-lu.cc +++ b/liboctave/base-lu.cc @@ -111,7 +111,7 @@ base_lu <lu_type> :: Y (void) const { if (! packed ()) - (*current_liboctave_error_handler) ("lu: Y() not implemented for unpacked form."); + (*current_liboctave_error_handler) ("lu: Y() not implemented for unpacked form"); return a_fact; }
--- a/liboctave/idx-vector.cc +++ b/liboctave/idx-vector.cc @@ -45,21 +45,21 @@ gripe_invalid_range (void) { (*current_liboctave_error_handler) - ("invalid range used as index."); + ("invalid range used as index"); } static void gripe_index_out_of_range (void) { (*current_liboctave_error_handler) - ("internal error: idx_vector index out of range."); + ("internal error: idx_vector index out of range"); } Array<octave_idx_type> idx_vector::idx_base_rep::as_array (void) { (*current_liboctave_error_handler) - ("internal error: as_array not allowed for this index class."); + ("internal error: as_array not allowed for this index class"); return Array<octave_idx_type> (); } @@ -71,7 +71,7 @@ if (c != ':') { (*current_liboctave_error_handler) - ("internal error: invalid character converted to idx_vector. Must be ':'."); + ("internal error: invalid character converted to idx_vector; must be ':'"); err = true; } }
--- a/liboctave/lo-array-gripes.cc +++ b/liboctave/lo-array-gripes.cc @@ -130,7 +130,7 @@ const char *err_id = error_id_invalid_index; (*current_liboctave_error_with_id_handler) - (err_id, "subscript indices must be either positive integers or logicals."); + (err_id, "subscript indices must be either positive integers or logicals"); } // FIXME -- the following is a common error message to resize, @@ -145,7 +145,7 @@ { (*current_liboctave_error_with_id_handler) ("Octave:invalid-resize", - "Invalid resizing operation or ambiguous assignment to an out-of-bounds array element."); + "Invalid resizing operation or ambiguous assignment to an out-of-bounds array element"); } void
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,17 @@ +2011-01-20 John W. Eaton <jwe@octave.org> + + * DLD-FUNCTIONS/__delaunayn__.cc, + DLD-FUNCTIONS/__init_fltk__.cc, + DLD-FUNCTIONS/__magick_read__.cc, DLD-FUNCTIONS/cellfun.cc, + DLD-FUNCTIONS/quadcc.cc, DLD-FUNCTIONS/regexp.cc, data.cc, + gripes.cc, ls-mat5.cc, toplev.cc, variables.cc: + Style fixes for error and warning messages. + +2011-01-20 John W. Eaton <jwe@octave.org> + + * Array.cc, Sparse.cc, base-lu.cc, idx-vector.cc, + lo-array-gripes.cc: Style fixes for error and warning messages. + 2011-01-20 John W. Eaton <jwe@octave.org> * DLD-FUNCTIONS/__contourc__.cc, DLD-FUNCTIONS/__delaunayn__.cc,
--- a/src/DLD-FUNCTIONS/__delaunayn__.cc +++ b/src/DLD-FUNCTIONS/__delaunayn__.cc @@ -207,7 +207,7 @@ totlong, curlong); } else - error ("__delaunayn__: qhull failed."); + error ("__delaunayn__: qhull failed"); } else if (n == dim + 1) {
--- a/src/DLD-FUNCTIONS/__init_fltk__.cc +++ b/src/DLD-FUNCTIONS/__init_fltk__.cc @@ -59,6 +59,7 @@ #include "defun-dld.h" #include "error.h" +#include "file-ops.h" #include "gl-render.h" #include "gl2ps-renderer.h" #include "graphics.h" @@ -2015,13 +2016,12 @@ } if (failed) - error ("MODE must be one of the strings: ""2D"", ""3D"", or ""None""."); + error ("MODE must be one of the strings: \"2D\", \"3D\", or \"None\""); return octave_value(mode_str); } -#include "file-ops.h" DEFUN_DLD (__fltk_uigetfile__, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __fltk_uigetfile__ (@dots{})\n\
--- a/src/DLD-FUNCTIONS/__magick_read__.cc +++ b/src/DLD-FUNCTIONS/__magick_read__.cc @@ -524,8 +524,7 @@ } #else - error ("imread: image reading ave does not support reading images." - " Image reading capabilities were disabled when this installation was compiled."); + error ("imread: image reading capabilities were disabled when Octave was compiled"); #endif @@ -579,7 +578,7 @@ // Other settings go here if (! something_set) - warning ("__magick_write__ warning: All write parameters ignored."); + warning ("__magick_write__ warning: all write parameters ignored"); } static void
--- a/src/DLD-FUNCTIONS/cellfun.cc +++ b/src/DLD-FUNCTIONS/cellfun.cc @@ -436,7 +436,7 @@ { if (mask[i] && inputs[i].dims () != fdims) { - error ("cellfun: Dimensions mismatch."); + error ("cellfun: dimensions mismatch"); return octave_value_list (); } }
--- a/src/DLD-FUNCTIONS/quadcc.cc +++ b/src/DLD-FUNCTIONS/quadcc.cc @@ -1584,24 +1584,23 @@ if (nargin < 1) { error - ("quadcc: first argument (integrand) of type function handle required."); + ("quadcc: first argument (integrand) of type function handle required"); return octave_value_list (); } else { if (args (0).is_function_handle () || args (0).is_inline_function ()) fcn = args (0).function_value (); - else { - error - ("quadcc: first argument (integrand) must be a function handle or an inline function."); - return octave_value_list(); + else + { + error ("quadcc: first argument (integrand) must be a function handle or an inline function"); + return octave_value_list(); } } if (nargin < 2 || !args (1).is_real_scalar ()) { - error - ("quadcc: second argument (left interval edge) must be a single real scalar."); + error ("quadcc: second argument (left interval edge) must be a single real scalar"); return octave_value_list (); } else @@ -1609,8 +1608,7 @@ if (nargin < 3 || !args (2).is_real_scalar ()) { - error - ("quadcc: third argument (right interval edge) must be a single real scalar."); + error ("quadcc: third argument (right interval edge) must be a single real scalar"); return octave_value_list (); } else @@ -1620,8 +1618,7 @@ tol = 1.0e-6; else if (!args (3).is_real_scalar ()) { - error - ("quadcc: fourth argument (tolerance) must be a single real scalar."); + error ("quadcc: fourth argument (tolerance) must be a single real scalar"); return octave_value_list (); } else @@ -1635,15 +1632,15 @@ } else if (!(args (4).is_real_scalar () || args (4).is_real_matrix ())) { - error - ("quadcc: fifth argument (singularities) must be a vector of real values."); + error ("quadcc: fifth argument (singularities) must be a vector of real values"); return octave_value_list (); } else { nivals = 1 + args (4).length (); if ( nivals > cquad_heapsize ) { - error("quadcc: maximum number of singular points is limited to %i.",cquad_heapsize-1); + error ("quadcc: maximum number of singular points is limited to %i", + cquad_heapsize-1); return octave_value_list(); } sing = args (4).array_value ().fortran_vec (); @@ -1697,14 +1694,13 @@ if (retval.length () != 1 || !retval (0).is_real_matrix ()) { error - ("quadcc: integrand must return a single, real-valued vector."); + ("quadcc: integrand must return a single, real-valued vector"); return octave_value_list (); } Matrix effex = retval (0).matrix_value (); if (effex.length () != ex.length ()) { - error - ("quadcc: integrand must return a single, real-valued vector of the same size as the input"); + error ("quadcc: integrand must return a single, real-valued vector of the same size as the input"); return octave_value_list (); } for (i = 0; i <= n[3]; i++) @@ -1818,15 +1814,13 @@ retval = feval (fcn, fargs, 1); if (retval.length () != 1 || !retval (0).is_real_matrix ()) { - error - ("quadcc: integrand must return a single, real-valued vector."); + error ("quadcc: integrand must return a single, real-valued vector"); return octave_value_list (); } Matrix effex = retval (0).matrix_value (); if (effex.length () != ex.length ()) { - error - ("quadcc: integrand must return a single, real-valued vector of the same size as the input."); + error ("quadcc: integrand must return a single, real-valued vector of the same size as the input"); return octave_value_list (); } neval += effex.length (); @@ -1968,15 +1962,13 @@ retval = feval (fcn, fargs, 1); if (retval.length () != 1 || !retval (0).is_real_matrix ()) { - error - ("quadcc: integrand must return a single, real-valued vector."); + error ("quadcc: integrand must return a single, real-valued vector"); return octave_value_list (); } Matrix effex = retval (0).matrix_value (); if (effex.length () != ex.length ()) { - error - ("quadcc: integrand must return a single, real-valued vector of the same size as the input."); + error ("quadcc: integrand must return a single, real-valued vector of the same size as the input"); return octave_value_list (); } neval += effex.length (); @@ -2032,7 +2024,7 @@ if (ivl->ndiv > ndiv_max && 2 * ivl->ndiv > ivl->rdepth) { igral = copysign (octave_Inf, igral); - warning ("quadcc: divergent integral detected."); + warning ("quadcc: divergent integral detected"); break; } @@ -2066,15 +2058,13 @@ retval = feval (fcn, fargs, 1); if (retval.length () != 1 || !retval (0).is_real_matrix ()) { - error - ("quadcc: integrand must return a single, real-valued vector."); + error ("quadcc: integrand must return a single, real-valued vector"); return octave_value_list (); } Matrix effex = retval (0).matrix_value (); if (effex.length () != ex.length ()) { - error - ("quadcc: integrand must return a single, real-valued vector of the same size as the input."); + error ("quadcc: integrand must return a single, real-valued vector of the same size as the input"); return octave_value_list (); } neval += effex.length (); @@ -2130,7 +2120,7 @@ if (ivr->ndiv > ndiv_max && 2 * ivr->ndiv > ivr->rdepth) { igral = copysign (octave_Inf, igral); - warning ("quadcc: divergent integral detected."); + warning ("quadcc: divergent integral detected"); break; }
--- a/src/DLD-FUNCTIONS/regexp.cc +++ b/src/DLD-FUNCTIONS/regexp.cc @@ -392,7 +392,7 @@ if (matches == PCRE_ERROR_MATCHLIMIT) { // try harder; start with default value for MATCH_LIMIT and increase it - warning("Your pattern caused PCRE to hit its MATCH_LIMIT.\nTrying harder now, but this will be slow."); + warning ("your pattern caused PCRE to hit its MATCH_LIMIT; trying harder now, but this will be slow"); pcre_extra pe; pcre_config(PCRE_CONFIG_MATCH_LIMIT, static_cast <void *> (&pe.match_limit)); pe.flags = PCRE_EXTRA_MATCH_LIMIT; @@ -413,7 +413,8 @@ if (matches < 0 && matches != PCRE_ERROR_NOMATCH) { - error ("%s: internal error calling pcre_exec\nError code from pcre_exec is %i", nm.c_str(), matches); + error ("%s: internal error calling pcre_exec; error code from pcre_exec is %i", + nm.c_str(), matches); pcre_free(re); return 0; }
--- a/src/data.cc +++ b/src/data.cc @@ -6702,7 +6702,7 @@ octave_idx_type rx = rm(i); if (static_cast<double> (rx) != rm(i)) { - error ("repelems: a matrix of integers is expected."); + error ("repelems: a matrix of integers is expected"); return retval; }
--- a/src/gripes.cc +++ b/src/gripes.cc @@ -227,7 +227,7 @@ void gripe_nonbraced_cs_list_assignment (void) { - error ("invalid assignment to cs-list outside multiple assignment."); + error ("invalid assignment to cs-list outside multiple assignment"); } void
--- a/src/ls-mat5.cc +++ b/src/ls-mat5.cc @@ -1451,10 +1451,7 @@ } if (found_big_char) - { - warning ("load: can not read non-ASCII portions of UTF characters."); - warning (" Replacing unreadable characters with '?'."); - } + warning ("load: can not read non-ASCII portions of UTF characters; replacing unreadable characters with '?'"); } else if (type == miUTF8) { @@ -1471,8 +1468,7 @@ if (utf8_multi_byte) { - warning ("load: can not read multi-byte encoded UTF8 characters."); - warning (" Replacing unreadable characters with '?'."); + warning ("load: can not read multi-byte encoded UTF8 characters; replacing unreadable characters with '?'"); for (octave_idx_type i = 0; i < n; i++) { unsigned char a = static_cast<unsigned char> (re(i));
--- a/src/toplev.cc +++ b/src/toplev.cc @@ -691,7 +691,7 @@ octave_value_list retval; if (! quit_allowed) - error ("quit: not supported in embedded mode."); + error ("quit: not supported in embedded mode"); else { if (args.length () > 0)
--- a/src/variables.cc +++ b/src/variables.cc @@ -172,8 +172,8 @@ return retval; } - warning ("%s: passing function body as a string is obsolete." - " Please use anonymous functions.", warn_for.c_str ()); + warning ("%s: passing function body as a string is obsolete; please use anonymous functions", + warn_for.c_str ()); } else error ("%s: `%s' is not valid as a function",