patch to examples/make_int.cc

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

patch to examples/make_int.cc

Andy Adler
Hello,

The following patch is required to make examples/make_int.cc
compile with 2.1.40. and gcc version 3.2 20020927 (prerelease)
(cygwin).

I don't understand why "not" caused a problem. Maybe
something was conflicting in one of the header files.

Andy
------------------------------

--- make_int.cc.orig    2002-12-23 14:43:16.000000000 -0800
+++ make_int.cc 2002-12-23 14:57:28.000000000 -0800
@@ -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 _not_ (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,7 +137,7 @@
 };

 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);
 }
@@ -153,7 +153,7 @@
     return octave_value (new octave_integer (op v.t ## _value ())); \
   }

-DEFUNOP_OP (not, integer, !)
+DEFUNOP_OP (_not_, integer, !)
 DEFUNOP_OP (uminus, integer, -)
 DEFUNOP_OP (transpose, integer, /* no-op */)
 DEFUNOP_OP (hermitian, integer, /* no-op */)
@@ -263,10 +263,10 @@
     {
       octave_integer::register_type ();

-      cerr << "installing integer type at type-id = "
+      std::cerr << "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, _not_);
       INSTALL_UNOP (op_uminus, octave_integer, uminus);
       INSTALL_UNOP (op_transpose, octave_integer, transpose);
       INSTALL_UNOP (op_hermitian, octave_integer, hermitian);