changeset 4280:3dc0815a2954

[project @ 2003-01-04 03:11:42 by jwe]
author jwe
date Sat, 04 Jan 2003 03:11:42 +0000
parents 64c444ac1fee
children e0f687d372ef
files src/ChangeLog src/TEMPLATE-INST/Array-tc.cc src/oct-obj.h src/ov-usr-fcn.cc src/variables.cc
diffstat 5 files changed, 38 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sat Jan 04 01:10:26 2003 +0000
+++ b/src/ChangeLog	Sat Jan 04 03:11:42 2003 +0000
@@ -1,5 +1,16 @@
 2003-01-03  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
+	* ov-usr-fcn.cc (octave_vr_val): Assert vr_list != 0, not vr_list.
+	* variables.cc (builtin_string_variable, builtin_any_variable,
+	builtin_real_scalar_variable, bind_builtin_variable): Likewise.
+
+	* TEMPLATE-INST/Array-tc.cc: Provide specialization of
+	Array<octave_value>::resize_fill_value before instantiation of
+	Array<octave_value>.
+
+	* oct-obj.h (octave_value_list::operator delete): Define version
+	of delete operator to correspond to placement new operator.
+
 	* mkgendoc: In generated code, define __USE_STD_IOSTREAM if using
 	Compaq C++.
 
--- a/src/TEMPLATE-INST/Array-tc.cc	Sat Jan 04 01:10:26 2003 +0000
+++ b/src/TEMPLATE-INST/Array-tc.cc	Sat Jan 04 03:11:42 2003 +0000
@@ -37,8 +37,6 @@
 
 #include "oct-obj.h"
 
-template class Array<octave_value>;
-
 template<>
 octave_value
 Array<octave_value>::resize_fill_value (void)
@@ -47,6 +45,8 @@
   return retval;
 }
 
+template class Array<octave_value>;
+
 template int assign (Array<octave_value>&, const Array<octave_value>&);
 
 template int assign (Array<octave_value>&,
--- a/src/oct-obj.h	Sat Jan 04 01:10:26 2003 +0000
+++ b/src/oct-obj.h	Sat Jan 04 03:11:42 2003 +0000
@@ -57,13 +57,16 @@
   void *operator new (size_t size)
     { return allocator.alloc (size); }
 
+  void operator delete (void *p, size_t size)
+    { allocator.free (p, size); }
+
   // XXX FIXME XXX -- without this, I have errors with the stack of
   // octave_value_list objects in ov-usr-fcn.h.  Why?
   void *operator new (size_t size, void *p)
     { return ::operator new (size, p); }
 
-  void operator delete (void *p, size_t size)
-    { allocator.free (p, size); }
+  void operator delete (void *p, void *)
+    { return ::operator delete (p, static_cast<void *> (0)); }
 
   octave_value_list& operator = (const octave_value_list& obj)
     {
--- a/src/ov-usr-fcn.cc	Sat Jan 04 01:10:26 2003 +0000
+++ b/src/ov-usr-fcn.cc	Sat Jan 04 03:11:42 2003 +0000
@@ -198,7 +198,10 @@
 void
 octave_user_function::octave_vr_val (const octave_value& val)
 {
-  assert (vr_list);
+  // Use != here to avoid possible conversion to int of smaller type
+  // than the vr_list pointer.
+
+  assert (vr_list != 0);
 
   vr_list->append (val);
 }
--- a/src/variables.cc	Sat Jan 04 01:10:26 2003 +0000
+++ b/src/variables.cc	Sat Jan 04 03:11:42 2003 +0000
@@ -835,7 +835,10 @@
 
   // It is a prorgramming error to look for builtins that aren't.
 
-  assert (sr);
+  // Use != here to avoid possible conversion to int of smaller type
+  // than the sr pointer.
+
+  assert (sr != 0);
 
   std::string retval;
 
@@ -859,7 +862,10 @@
 
   // It is a prorgramming error to look for builtins that aren't.
 
-  assert (sr);
+  // Use != here to avoid possible conversion to int of smaller type
+  // than the sr pointer.
+
+  assert (sr != 0);
 
   octave_value val = sr->def ();
 
@@ -881,7 +887,10 @@
 
   // It is a prorgramming error to look for builtins that aren't.
 
-  assert (sr);
+  // Use != here to avoid possible conversion to int of smaller type
+  // than the sr pointer.
+
+  assert (sr != 0);
 
   return sr->def ();
 }
@@ -1256,7 +1265,10 @@
   // It is a programming error for a builtin symbol to be missing.
   // Besides, we just inserted it, so it must be there.
 
-  assert (sr);
+  // Use != here to avoid possible conversion to int of smaller type
+  // than the sr pointer.
+
+  assert (sr != 0);
 
   sr->unprotect ();