# HG changeset patch # User Rik # Date 1440713960 25200 # Node ID 4bef1880098ce3bc15bb074c1f73babc84351a4d # Parent 16b9ec39ff46a42c28074466a050f3afbca03442 More specific warning messages when saving onCleanup variables. * ov-oncleanup.cc (warn_save_load): Delete function (save_ascii, save_binary, save_hdf5): Call warning() with message about inability to save onCleanup variables. (load_ascii, load_binary, load_hdf5): Silently skip over instances of onCleanup in file that were not truly saved. diff -r 16b9ec39ff46 -r 4bef1880098c libinterp/octave-value/ov-oncleanup.cc --- a/libinterp/octave-value/ov-oncleanup.cc Thu Aug 27 13:12:21 2015 -0700 +++ b/libinterp/octave-value/ov-oncleanup.cc Thu Aug 27 15:19:20 2015 -0700 @@ -111,23 +111,18 @@ return retval; } -static void -warn_save_load (void) -{ - warning ("onCleanup: load and save not supported"); -} - bool octave_oncleanup::save_ascii (std::ostream& /* os */) { - warn_save_load (); + warning ("save: unable to save onCleanup variables, skipping"); + return true; } bool octave_oncleanup::load_ascii (std::istream& /* is */) { - warn_save_load (); + // Silently skip object that was not saved return true; } @@ -135,7 +130,8 @@ octave_oncleanup::save_binary (std::ostream& /* os */, bool& /* save_as_floats */) { - warn_save_load (); + warning ("save: unable to save onCleanup variables, skipping"); + return true; } @@ -143,7 +139,7 @@ octave_oncleanup::load_binary (std::istream& /* is */, bool /* swap */, oct_mach_info::float_format /* fmt */) { - warn_save_load (); + // Silently skip object that was not saved return true; } @@ -152,7 +148,8 @@ const char * /* name */, bool /* save_as_floats */) { - warn_save_load (); + warning ("save: unable to save onCleanup variables, skipping"); + return true; } @@ -160,7 +157,7 @@ octave_oncleanup::load_hdf5 (octave_hdf5_id /* loc_id */, const char * /* name */) { - warn_save_load (); + // Silently skip object that was not saved return true; }