# HG changeset patch # User jwe # Date 1077143517 0 # Node ID 82a558043db9a38e8cce5b3407da04896f74c42a # Parent 02c748eb2ddc76ee6ed8fb2d098cab32b963bead [project @ 2004-02-18 22:31:57 by jwe] diff -r 02c748eb2ddc -r 82a558043db9 liboctave/ChangeLog --- a/liboctave/ChangeLog Wed Feb 18 21:20:26 2004 +0000 +++ b/liboctave/ChangeLog Wed Feb 18 22:31:57 2004 +0000 @@ -1,5 +1,9 @@ 2004-02-18 John W. Eaton + * oct-fftw.cc (octave_fftw_planner::create_plan): + Cast IN and OUT args to ptrdiff_t instead of long before masking. + From Paul Kienzle . + * Array.cc (Array::insertN (const Array&, int, int)): Rename from Array::insert. (Array::insert2 (const Array&, int, int)): diff -r 02c748eb2ddc -r 82a558043db9 liboctave/oct-fftw.cc --- a/liboctave/oct-fftw.cc Wed Feb 18 21:20:26 2004 +0000 +++ b/liboctave/oct-fftw.cc Wed Feb 18 22:31:57 2004 +0000 @@ -110,8 +110,8 @@ int which = (dir == FFTW_FORWARD) ? 0 : 1; fftw_plan *cur_plan_p = &plan[which]; bool create_new_plan = false; - char in_align = (reinterpret_cast (in)) & 0xF; - char out_align = (reinterpret_cast (out)) & 0xF; + char in_align = (reinterpret_cast (in)) & 0xF; + char out_align = (reinterpret_cast (out)) & 0xF; if (plan[which] == 0 || d[which] != dist || s[which] != stride || r[which] != rank || h[which] != howmany @@ -164,8 +164,8 @@ { fftw_plan *cur_plan_p = &rplan; bool create_new_plan = false; - char in_align = (reinterpret_cast (in)) & 0xF; - char out_align = (reinterpret_cast (out)) & 0xF; + char in_align = (reinterpret_cast (in)) & 0xF; + char out_align = (reinterpret_cast (out)) & 0xF; if (rplan == 0 || rd != dist || rs != stride || rr != rank || rh != howmany || rialign != in_align || roalign != out_align) diff -r 02c748eb2ddc -r 82a558043db9 src/ChangeLog --- a/src/ChangeLog Wed Feb 18 21:20:26 2004 +0000 +++ b/src/ChangeLog Wed Feb 18 22:31:57 2004 +0000 @@ -1,5 +1,14 @@ 2004-02-18 John W. Eaton + * load-save.cc (Voctave_core_format): New static_variable. + (octave_core_format): New function. + (symbols_of_load_save): Add DEFVAR for octave_core_format. + (get_save_format): Rename from get_default_save_format. + Pass name of format as arg. New optional arg, default_format. + Change all uses. + (save_user_variables): Use pass Voctave_core_format to + get_save_format here. Pass LS_BINARY as default_format. + * sighandlers.cc (my_friendly_exit): New optional arg, save_vars. Only call save_user_variables if save_vars is true. (sigint_handler): If interactive, offer to abort and save diff -r 02c748eb2ddc -r 82a558043db9 src/load-save.cc --- a/src/load-save.cc Wed Feb 18 21:20:26 2004 +0000 +++ b/src/load-save.cc Wed Feb 18 22:31:57 2004 +0000 @@ -87,6 +87,10 @@ // "mat-binary", or "hdf5". static std::string Vdefault_save_format; +// The output format for octave-core files. May be one of "binary", +// "text", "mat-binary", or "hdf5". +static std::string Voctave_core_format; + // The format string for the comment line at the top of text-format // save files. Passed to strftime. Should begin with `#' and contain // no newline characters. @@ -910,11 +914,10 @@ } static load_save_format -get_default_save_format (void) +get_save_format (const std::string& fmt, + load_save_format fallback_format = LS_ASCII) { - load_save_format retval = LS_ASCII; - - std::string fmt = Vdefault_save_format; + load_save_format retval = fallback_format; if (fmt == "binary") retval = LS_BINARY; @@ -1046,7 +1049,8 @@ message (0, "attempting to save variables to `%s'...", fname); - load_save_format format = get_default_save_format (); + load_save_format format + = get_save_format (Voctave_core_format, LS_BINARY); std::ios::openmode mode = std::ios::out|std::ios::trunc; if (format == LS_BINARY || @@ -1186,7 +1190,7 @@ bool save_as_floats = false; - load_save_format format = get_default_save_format (); + load_save_format format = get_save_format (Vdefault_save_format); bool append = false; @@ -1369,6 +1373,24 @@ return status; } +static int +octave_core_format (void) +{ + int status = 0; + + std::string s = builtin_string_variable ("octave_core_format"); + + if (s.empty ()) + { + gripe_invalid_value_specified ("octave_core_format"); + status = -1; + } + else + Voctave_core_format = s; + + return status; +} + static std::string default_save_header_format (void) { @@ -1417,6 +1439,18 @@ It should have one of the following values: @code{\"ascii\"},\n\ @code{\"binary\"}, @code{float-binary}, or @code{\"mat-binary\"}. The\n\ initial default save format is Octave's text format.\n\ +@seealso{octave_core_format}\n\ +@end defvr"); + + DEFVAR (octave_core_format, "binary", octave_core_format, + "-*- texinfo -*-\n\ +@defvr {Built-in Variable} octave_core_format\n\ +If Octave aborts, it attempts to save the contents of the top-level\n\ +workspace in a file using this format. The value of\n\ +@code{octave_core_format} should have one of the following values:\n\ +@code{\"ascii\"}, @code{\"binary\"}, @code{float-binary}, or\n\ +@code{\"mat-binary\"}. The default value is Octave's binary format.\n\ +@seealso{default_save_format}\n\ @end defvr"); DEFVAR (save_header_format_string, default_save_header_format (),