Mercurial > hg > octave-nkf
changeset 4320:cc3a9c2608bd
[project @ 2003-02-13 21:09:31 by jwe]
author | jwe |
---|---|
date | Thu, 13 Feb 2003 21:09:31 +0000 |
parents | 05973ead74eb |
children | 8460c03f3b4b |
files | ChangeLog examples/make_int.cc |
diffstat | 2 files changed, 14 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2003-02-13 Paul Kienzle <pkienzle@users.sf.net> + + * examples/make_int.cc: Support for ISO standard compilers. + 2003-01-22 Richard Stallman <rms@gnu.org> * emacs/octave-mod.el (octave-mode-map): Avoid binding keys that
--- a/examples/make_int.cc +++ b/examples/make_int.cc @@ -26,7 +26,7 @@ #include <string> -class ostream; +#include <ostream> #include <octave/lo-mappers.h> #include <octave/lo-utils.h> @@ -113,7 +113,7 @@ ComplexMatrix complex_matrix_value (bool = false) const { return ComplexMatrix (1, 1, Complex (scalar)); } - octave_value not (void) const { return octave_value ((double) ! scalar); } + octave_value gnot (void) const { return octave_value ((double) ! scalar); } octave_value uminus (void) const { return new octave_integer (- scalar); } @@ -125,7 +125,7 @@ void decrement (void) { --scalar; } - void print (ostream& os, bool pr_as_read_syntax = false) const; + void print (std::ostream& os, bool pr_as_read_syntax = false) const; private: @@ -137,9 +137,10 @@ }; void -octave_integer::print (ostream& os, bool pr_as_read_syntax) const +octave_integer::print (std::ostream& os, bool pr_as_read_syntax) const { - octave_print_internal (os, scalar, pr_as_read_syntax); + os << scalar; + // octave_print_internal (os, scalar, pr_as_read_syntax); } #ifdef DEFUNOP_OP @@ -153,7 +154,7 @@ return octave_value (new octave_integer (op v.t ## _value ())); \ } -DEFUNOP_OP (not, integer, !) +DEFUNOP_OP (gnot, integer, !) DEFUNOP_OP (uminus, integer, -) DEFUNOP_OP (transpose, integer, /* no-op */) DEFUNOP_OP (hermitian, integer, /* no-op */) @@ -262,11 +263,12 @@ if (! type_loaded) { octave_integer::register_type (); + mlock ("make_int"); - cerr << "installing integer type at type-id = " + octave_stdout << "installing integer type at type-id = " << octave_integer::static_type_id () << "\n"; - INSTALL_UNOP (op_not, octave_integer, not); + INSTALL_UNOP (op_not, octave_integer, gnot); INSTALL_UNOP (op_uminus, octave_integer, uminus); INSTALL_UNOP (op_transpose, octave_integer, transpose); INSTALL_UNOP (op_hermitian, octave_integer, hermitian);