# HG changeset patch # User jwe # Date 1041649902 0 # Node ID 3dc0815a2954ab1f5b8d6a5ce62d9fccbd39d471 # Parent 64c444ac1feec1924976ef1f8a21fa0bb55c9467 [project @ 2003-01-04 03:11:42 by jwe] diff -r 64c444ac1fee -r 3dc0815a2954 src/ChangeLog --- 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 + * 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::resize_fill_value before instantiation of + Array. + + * 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++. diff -r 64c444ac1fee -r 3dc0815a2954 src/TEMPLATE-INST/Array-tc.cc --- 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; - template<> octave_value Array::resize_fill_value (void) @@ -47,6 +45,8 @@ return retval; } +template class Array; + template int assign (Array&, const Array&); template int assign (Array&, diff -r 64c444ac1fee -r 3dc0815a2954 src/oct-obj.h --- 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 (0)); } octave_value_list& operator = (const octave_value_list& obj) { diff -r 64c444ac1fee -r 3dc0815a2954 src/ov-usr-fcn.cc --- 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); } diff -r 64c444ac1fee -r 3dc0815a2954 src/variables.cc --- 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 ();