Mercurial > hg > octave-avbm
changeset 5755:ca40a52804f4
[project @ 2006-04-12 18:27:47 by jwe]
author | jwe |
---|---|
date | Wed, 12 Apr 2006 18:27:47 +0000 |
parents | a9ac02e9fda5 |
children | 493849caf7e9 |
files | src/ChangeLog src/gripes.cc src/ov.cc src/ov.h |
diffstat | 4 files changed, 31 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,11 @@ 2006-04-12 John W. Eaton <jwe@octave.org> + * gripes.cc (warn_divide_by_zero): Move here from ov.cc. + (Vwarn_divide_by_zero): Likewise. Now static. + (symbols_of_gripes): New function. Move DEFVAR for + warn_divide_by_zero here from symbols_of_ov in ov.cc. + * ov.h (Vwarn_divide_by_zero): Delete decl. + * load-save.cc (do_load): Declare count octave_idx_type, not int. * ls-oct-ascii.cc, ls-oct-ascii.h (read_ascii_data): Likewise.
--- a/src/gripes.cc +++ b/src/gripes.cc @@ -25,9 +25,14 @@ #include <config.h> #endif +#include "defun.h" #include "error.h" #include "gripes.h" #include "oct-obj.h" +#include "utils.h" + +// Allow divide by zero errors to be suppressed. +bool Vwarn_divide_by_zero; void gripe_not_supported (const char *fcn) @@ -180,6 +185,26 @@ warning ("division by zero"); } +static int +warn_divide_by_zero (void) +{ + Vwarn_divide_by_zero = check_preference ("warn_divide_by_zero"); + + return 0; +} + +void +symbols_of_gripes (void) +{ + DEFVAR (warn_divide_by_zero, true, warn_divide_by_zero, + "-*- texinfo -*-\n\ +@defvr {Built-in Variable} warn_divide_by_zero\n\ +If the value of @code{warn_divide_by_zero} is nonzero, a warning\n\ +is issued when Octave encounters a division by zero. If the value is\n\ +0, the warning is omitted. The default value is 1.\n\ +@end defvr"); +} + /* ;;; Local Variables: *** ;;; mode: C++ ***
--- a/src/ov.cc +++ b/src/ov.cc @@ -113,9 +113,6 @@ // How many levels of structure elements should we print? int Vstruct_levels_to_print; -// Allow divide by zero errors to be suppressed. -bool Vwarn_divide_by_zero; - // If TRUE, print a warning when a matrix is resized by an indexed // assignment with indices outside the current bounds. bool Vwarn_resize_on_range_error; @@ -2331,14 +2328,6 @@ return -1; } -static int -warn_divide_by_zero (void) -{ - Vwarn_divide_by_zero = check_preference ("warn_divide_by_zero"); - - return 0; -} - void symbols_of_ov (void) { @@ -2378,14 +2367,6 @@ built-in variable @code{struct_levels_to_print}. The default value is 2.\n\ @end defvr"); - DEFVAR (warn_divide_by_zero, true, warn_divide_by_zero, - "-*- texinfo -*-\n\ -@defvr {Built-in Variable} warn_divide_by_zero\n\ -If the value of @code{warn_divide_by_zero} is nonzero, a warning\n\ -is issued when Octave encounters a division by zero. If the value is\n\ -0, the warning is omitted. The default value is 1.\n\ -@end defvr"); - DEFVAR (warn_fortran_indexing, false, warn_fortran_indexing, "-*- texinfo -*-\n\ @defvr {Built-in Variable} warn_fortran_indexing\n\
--- a/src/ov.h +++ b/src/ov.h @@ -978,9 +978,6 @@ // How many levels of structure elements should we print? extern int Vstruct_levels_to_print; -// Allow divide by zero errors to be suppressed. -extern bool Vwarn_divide_by_zero; - // If TRUE, print a warning when a matrix is resized by an indexed // assignment with indices outside the current bounds. extern bool Vwarn_resize_on_range_error;