Mercurial > hg > octave-lyh
changeset 4788:82a558043db9
[project @ 2004-02-18 22:31:57 by jwe]
author | jwe |
---|---|
date | Wed, 18 Feb 2004 22:31:57 +0000 |
parents | 02c748eb2ddc |
children | ac4441e16ffa |
files | liboctave/ChangeLog liboctave/oct-fftw.cc src/ChangeLog src/load-save.cc |
diffstat | 4 files changed, 57 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,5 +1,9 @@ 2004-02-18 John W. Eaton <jwe@bevo.che.wisc.edu> + * oct-fftw.cc (octave_fftw_planner::create_plan): + Cast IN and OUT args to ptrdiff_t instead of long before masking. + From Paul Kienzle <pkienzle@users.sf.net>. + * Array.cc (Array<T>::insertN (const Array<T>&, int, int)): Rename from Array<T>::insert. (Array<T>::insert2 (const Array<T>&, int, int)):
--- a/liboctave/oct-fftw.cc +++ b/liboctave/oct-fftw.cc @@ -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<long> (in)) & 0xF; - char out_align = (reinterpret_cast<long> (out)) & 0xF; + char in_align = (reinterpret_cast<ptrdiff_t> (in)) & 0xF; + char out_align = (reinterpret_cast<ptrdiff_t> (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<long> (in)) & 0xF; - char out_align = (reinterpret_cast<long> (out)) & 0xF; + char in_align = (reinterpret_cast<ptrdiff_t> (in)) & 0xF; + char out_align = (reinterpret_cast<ptrdiff_t> (out)) & 0xF; if (rplan == 0 || rd != dist || rs != stride || rr != rank || rh != howmany || rialign != in_align || roalign != out_align)
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,14 @@ 2004-02-18 John W. Eaton <jwe@bevo.che.wisc.edu> + * 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
--- a/src/load-save.cc +++ b/src/load-save.cc @@ -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 (),