# HG changeset patch # User John W. Eaton # Date 1285746636 14400 # Node ID 14993c9e857e83b311814fd84b969446bff37606 # Parent cc3aad9dd3ef3b8d35f26d7edf23b0c6451b700a amd.cc, cellfun.cc: use octave_scalar_map instead of Octave_map diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2010-09-29 John W. Eaton + + * DLD-FUNCTIONS/amd.cc (Famd): Use octave_scalar_map instead of + Octave_map. + * DLD-FUNCTIONS/cellfun.cc (get_output_list): Likewise. + 2010-09-29 John W. Eaton * DLD-FUNCTIONS/dispatch.cc (Fdispatch): Use octave_scalar_map diff --git a/src/DLD-FUNCTIONS/amd.cc b/src/DLD-FUNCTIONS/amd.cc --- a/src/DLD-FUNCTIONS/amd.cc +++ b/src/DLD-FUNCTIONS/amd.cc @@ -138,27 +138,22 @@ AMD_NAME (_defaults) (Control) ; if (nargin > 1) { - Octave_map arg1 = args(1).map_value (); + octave_scalar_map arg1 = args(1).scalar_map_value (); if (!error_state) { - if (arg1.contains ("dense")) - { - Cell c = arg1.contents ("dense"); - if (c.length() == 1) - Control[AMD_DENSE] = c.elem(0).double_value (); - else - error ("amd: invalid options structure"); - } - if (arg1.contains ("aggressive")) - { - Cell c = arg1.contents ("aggressive"); - if (c.length() == 1) - Control[AMD_AGGRESSIVE] = c.elem(0).double_value (); - else - error ("amd: invalid options structure"); - } + octave_value tmp; + + tmp = arg1.contents ("dense"); + if (tmp.is_defined ()) + Control[AMD_DENSE] = tmp.double_value (); + + tmp = arg1.contents ("aggressive"); + if (tmp.is_defined ()) + Control[AMD_AGGRESSIVE] = tmp.double_value (); } + else + error ("amd: options argument must be a scalar structure"); } if (!error_state) diff --git a/src/DLD-FUNCTIONS/cellfun.cc b/src/DLD-FUNCTIONS/cellfun.cc --- a/src/DLD-FUNCTIONS/cellfun.cc +++ b/src/DLD-FUNCTIONS/cellfun.cc @@ -70,10 +70,10 @@ { if (error_handler.is_defined ()) { - Octave_map msg; + octave_scalar_map msg; msg.assign ("identifier", last_error_id ()); msg.assign ("message", last_error_message ()); - msg.assign ("index", octave_value(double (count + static_cast(1)))); + msg.assign ("index", static_cast (count + static_cast(1))); octave_value_list errlist = inputlist; errlist.prepend (msg); buffer_error_messages--;