Update patch for several small bugs.

This commit is contained in:
Quentin Spencer 2006-08-15 04:28:58 +00:00
parent 29a158d0dc
commit cc7c3dd91f
2 changed files with 566 additions and 5 deletions

View File

@ -1,10 +1,276 @@
Index: doc/ChangeLog
===================================================================
RCS file: /cvs/octave/doc/ChangeLog,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -r1.107 -r1.108
--- doc/ChangeLog 28 Jun 2006 16:05:22 -0000 1.107
+++ doc/ChangeLog 14 Aug 2006 19:16:07 -0000 1.108
@@ -1,3 +1,8 @@
+2006-08-14 Dmitri A. Sergatskov <dasergatskov@gmail.com>
+
+ * interpreter/images/sparseimages.m: Adapt to new automatic_replot
+ definition.
+
2006-06-27 John W. Eaton <jwe@octave.org>
* interpreter/Makefile.in: Elminate double-colon rules.
Index: doc/interpreter/image.txi
===================================================================
RCS file: /cvs/octave/doc/interpreter/image.txi,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- doc/interpreter/image.txi 1 Oct 2004 18:12:11 -0000 1.5
+++ doc/interpreter/image.txi 14 Aug 2006 18:07:02 -0000 1.6
@@ -49,4 +49,4 @@
@DOCSTRING(saveimage)
-@DOCSTRING(IMAGEPATH)
+@DOCSTRING(IMAGE_PATH)
Index: doc/interpreter/octave-config.1
===================================================================
RCS file: /cvs/octave/doc/interpreter/octave-config.1,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- doc/interpreter/octave-config.1 19 Sep 2005 19:26:00 -0000 1.4
+++ doc/interpreter/octave-config.1 14 Aug 2006 18:07:02 -0000 1.5
@@ -38,7 +38,7 @@
FCNFILEDIR LOCALVERFCNFILEDIR
FCNFILEPATH LOCALVEROCTFILEDIR
IMAGEDIR MAN1DIR
- IMAGEPATH MAN1EXT
+ IMAGE_PATH MAN1EXT
INCLUDEDIR MANDIR
INFODIR OCTFILEDIR
INFOFILE OCTINCLUDEDIR
Index: doc/interpreter/images/sparseimages.m
===================================================================
RCS file: /cvs/octave/doc/interpreter/images/sparseimages.m,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- doc/interpreter/images/sparseimages.m 10 May 2006 22:30:50 -0000 1.7
+++ doc/interpreter/images/sparseimages.m 14 Aug 2006 19:16:07 -0000 1.8
@@ -20,7 +20,7 @@
## print since print() resets output to stdout (unfortunately, gnpulot
## can't pop output as it can the terminal type).
function bury_output ()
- automatic_replot = false;
+ automatic_replot(0);
__gnuplot_set__ term dumb
[status, dummy] = fileattrib("/dev/null");
if (status)
Index: emacs/octave-mod.el
===================================================================
RCS file: /cvs/octave/emacs/octave-mod.el,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- emacs/octave-mod.el 2 Mar 2006 20:51:32 -0000 1.40
+++ emacs/octave-mod.el 14 Aug 2006 18:07:07 -0000 1.41
@@ -129,7 +129,7 @@
(defvar octave-variables
'("DEFAULT_EXEC_PATH" "DEFAULT_LOADPATH"
"EDITOR" "EXEC_PATH" "F_DUPFD" "F_GETFD" "F_GETFL" "F_SETFD"
- "F_SETFL" "I" "IMAGEPATH" "INFO_FILE" "INFO_PROGRAM" "Inf" "J"
+ "F_SETFL" "I" "IMAGE_PATH" "INFO_FILE" "INFO_PROGRAM" "Inf" "J"
"LOADPATH" "NaN" "OCTAVE_VERSION" "O_APPEND" "O_CREAT" "O_EXCL"
"O_NONBLOCK" "O_RDONLY" "O_RDWR" "O_TRUNC" "O_WRONLY" "PAGER" "PS1"
"PS2" "PS4" "PWD" "SEEK_CUR" "SEEK_END" "SEEK_SET" "__F_DUPFD__"
Index: scripts/ChangeLog
===================================================================
RCS file: /cvs/octave/scripts/ChangeLog,v
retrieving revision 1.563
retrieving revision 1.569
diff -u -r1.563 -r1.569
--- scripts/ChangeLog 28 Jul 2006 03:40:22 -0000 1.563
+++ scripts/ChangeLog 14 Aug 2006 19:54:46 -0000 1.569
@@ -1,3 +1,30 @@
+2006-08-14 John W. Eaton <jwe@octave.org>
+
+ * pkg/Makefile.in (script_sub_dir): Change from plot to pkg.
+
+2006-08-14 Dmitri A. Sergatskov <dasergatskov@gmail.com>
+
+ * sparse/spy.m, control/base/bode.m, control/base/__stepimp__.m,
+ signal/freqz_plot.m: Adapt to new automatic_replot definition.
+
+2006-08-14 Søren Hauberg <soren@hauberg.org>
+
+ * pkg/pkg.m: Don't pass function name to print_usage.
+ Use addpath and rmpath instead of manipulating LOADPATH.
+ Handle changes to system function.
+ (rm_rf): New subfunction. Use it to avoid confirmation dialog for
+ recursive directory removal.
+
+ * strings/bin2dec.m: Ignore spaces in input for compatibility.
+
+ * colormap.m: Change global variable to persistent.
+
+ * rgb2ind.m: Handle single 3-d array as rgb image.
+
+2006-08-14 John W. Eaton <jwe@octave.org>
+
+ * strings/str2double.m: Fix missing semicolon.
+
2006-07-27 Jim Peterson <jpeterson@annapmicro.com>
* plot/plot3.m: Accept one complex or one real and one complex
Index: scripts/control/base/__stepimp__.m
===================================================================
RCS file: /cvs/octave/scripts/control/base/__stepimp__.m,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- scripts/control/base/__stepimp__.m 6 Mar 2006 21:26:48 -0000 1.13
+++ scripts/control/base/__stepimp__.m 14 Aug 2006 19:16:07 -0000 1.14
@@ -216,7 +216,7 @@
save_automatic_replot = automatic_replot;
unwind_protect
- automatic_replot = 0;
+ automatic_replot(0);
if(nargout == 0)
## Plot the information
oneplot();
@@ -272,6 +272,6 @@
endif
## printf("##STEPIMP-DEBUG: gratulations, successfull completion.\n");
unwind_protect_cleanup
- automatic_replot = save_automatic_replot;
+ automatic_replot(save_automatic_replot);
end_unwind_protect
endfunction
Index: scripts/control/base/bode.m
===================================================================
RCS file: /cvs/octave/scripts/control/base/bode.m,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- scripts/control/base/bode.m 26 Apr 2005 19:24:29 -0000 1.15
+++ scripts/control/base/bode.m 14 Aug 2006 19:16:07 -0000 1.16
@@ -147,7 +147,7 @@
## Plot the information
save_automatic_replot = automatic_replot;
unwind_protect
- automatic_replot = 0;
+ automatic_replot(0);
oneplot();
__gnuplot_set__ autoscale;
__gnuplot_set__ nokey;
@@ -204,7 +204,7 @@
oneplot();
endif
unwind_protect_cleanup
- automatic_replot = save_automatic_replot;
+ automatic_replot(save_automatic_replot);
end_unwind_protect
else
mag_r = mag;
Index: scripts/image/colormap.m
===================================================================
RCS file: /cvs/octave/scripts/image/colormap.m,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- scripts/image/colormap.m 8 Sep 2005 01:40:58 -0000 1.24
+++ scripts/image/colormap.m 14 Aug 2006 18:29:18 -0000 1.25
@@ -39,10 +39,10 @@
function cmap = colormap (map)
- global __current_color_map__ = gray ();
+ persistent current_color_map = gray ();
if (nargin > 1)
- usage ("colormap (map)");
+ print_usage ();
endif
if (nargin == 1)
@@ -63,12 +63,12 @@
error ("colormap: map must have values in [0,1]");
endif
## Set the new color map
- __current_color_map__ = map;
+ current_color_map = map;
endif
endif
## Return current color map.
- cmap = __current_color_map__;
+ cmap = current_color_map;
endfunction
Index: scripts/image/loadimage.m
===================================================================
RCS file: /cvs/octave/scripts/image/loadimage.m,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- scripts/image/loadimage.m 6 Mar 2006 21:26:49 -0000 1.22
+++ scripts/image/loadimage.m 14 Aug 2006 18:06:58 -0000 1.23
@@ -36,7 +36,7 @@
error ("loadimage: expecting filename as a string");
endif
- file = file_in_path (IMAGEPATH, filename);
+ file = file_in_path (IMAGE_PATH, filename);
if (isempty (file))
error ("loadimage: unable to find image file");
Index: scripts/image/rgb2ind.m
===================================================================
RCS file: /cvs/octave/scripts/image/rgb2ind.m,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- scripts/image/rgb2ind.m 6 Mar 2006 21:26:49 -0000 1.20
+++ scripts/image/rgb2ind.m 14 Aug 2006 18:16:57 -0000 1.21
@@ -18,7 +18,8 @@
## 02110-1301, USA.
## -*- texinfo -*-
-## @deftypefn {Function File} {[@var{x}, @var{map}] =} rgb2ind (@var{r}, @var{g}, @var{b})
+## @deftypefn {Function File} {[@var{x}, @var{map}] =} rgb2ind (@var{rgb})
+## @deftypefnx {Function File} {[@var{x}, @var{map}] =} rgb2ind (@var{r}, @var{g}, @var{b})
## Convert and RGB image to an Octave indexed image.
## @seealso{ind2rgb, rgb2ntsc}
## @end deftypefn
@@ -31,8 +32,19 @@
function [X, map] = rgb2ind (R, G, B)
- if (nargin != 3)
- usage ("[X, map] = rgb2ind (R, G, B)");
+ if (nargin != 1 && nargin != 3)
+ print_usage ();
+ endif
+
+ if (nargin == 1)
+ rgb = R;
+ if (length (size (rgb)) == 3 && size (rgb, 3) == 3)
+ R = rgb(:,:,1);
+ G = rgb(:,:,2);
+ B = rgb(:,:,3);
+ else
+ error ("rgb2ind: argument is not an RGB image");
+ endif
endif
if (size (R) != size (G) || size (R) != size (B))
Index: scripts/miscellaneous/mex.m Index: scripts/miscellaneous/mex.m
=================================================================== ===================================================================
RCS file: /cvs/octave/scripts/miscellaneous/mex.m,v RCS file: /cvs/octave/scripts/miscellaneous/mex.m,v
retrieving revision 1.1 retrieving revision 1.1
diff -u -r1.1 mex.m retrieving revision 1.2
diff -u -r1.1 -r1.2
--- scripts/miscellaneous/mex.m 26 Jul 2006 17:19:10 -0000 1.1 --- scripts/miscellaneous/mex.m 26 Jul 2006 17:19:10 -0000 1.1
+++ scripts/miscellaneous/mex.m 28 Jul 2006 21:06:42 -0000 +++ scripts/miscellaneous/mex.m 28 Jul 2006 21:21:51 -0000 1.2
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
## -*- texinfo -*- ## -*- texinfo -*-
## @deftypefn {Function File} {} mex [options] file ... ## @deftypefn {Function File} {} mex [options] file ...
@ -14,3 +280,295 @@ diff -u -r1.1 mex.m
## @seealso{mkoctfile} ## @seealso{mkoctfile}
## @end deftypefn ## @end deftypefn
Index: scripts/signal/freqz_plot.m
===================================================================
RCS file: /cvs/octave/scripts/signal/freqz_plot.m,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- scripts/signal/freqz_plot.m 24 Apr 2006 19:13:08 -0000 1.8
+++ scripts/signal/freqz_plot.m 14 Aug 2006 19:16:07 -0000 1.9
@@ -42,7 +42,7 @@
## Protect graph state.
replot_state = automatic_replot;
- automatic_replot = 0;
+ automatic_replot(0);
subplot (311);
__gnuplot_set__ lmargin 10;
@@ -88,7 +88,7 @@
__gnuplot_set__ tmargin;
oneplot ();
- automatic_replot = replot_state;
+ automatic_replot(replot_state);
end_unwind_protect
Index: scripts/sparse/spy.m
===================================================================
RCS file: /cvs/octave/scripts/sparse/spy.m,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- scripts/sparse/spy.m 26 Apr 2005 19:24:31 -0000 1.4
+++ scripts/sparse/spy.m 14 Aug 2006 19:16:07 -0000 1.5
@@ -30,7 +30,7 @@
arp = automatic_replot;
unwind_protect
- automatic_replot = 0;
+ automatic_replot (0);
eval(sprintf('__gnuplot_set__ nokey'))
eval(sprintf('__gnuplot_set__ yrange [0:%d] reverse',m+1))
@@ -46,6 +46,6 @@
__gnuplot_set__ yrange [0:1] noreverse
axis;
unwind_protect_cleanup
- automatic_replot = arp;
+ automatic_replot (arp);
end_unwind_protect
endfunction
Index: scripts/strings/bin2dec.m
===================================================================
RCS file: /cvs/octave/scripts/strings/bin2dec.m,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- scripts/strings/bin2dec.m 15 Mar 2006 02:37:55 -0000 1.14
+++ scripts/strings/bin2dec.m 14 Aug 2006 18:41:15 -0000 1.15
@@ -37,10 +37,16 @@
function d = bin2dec (h)
- if (nargin != 1)
- usage ("bin2dec (b)");
+ if (nargin == 1 && ischar (h))
+ n = rows (h);
+ d = zeros (n, 1);
+ for i = 1:n
+ s = h(i,:);
+ s = s(! isspace (s));
+ d(i) = base2dec (s, 2);
+ endfor
else
- d = base2dec (h, 2);
+ print_usage ();
endif
endfunction
Index: scripts/strings/str2double.m
===================================================================
RCS file: /cvs/octave/scripts/strings/str2double.m,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- scripts/strings/str2double.m 26 Apr 2005 19:24:32 -0000 1.5
+++ scripts/strings/str2double.m 14 Aug 2006 16:46:33 -0000 1.6
@@ -195,7 +195,7 @@
ix = 1;
## while (ix < sl) & any(abs(s(ix))==[rdelim,cdelim]),
while (ix < sl && CD(ix))
- ix++
+ ix++;
endwhile
ta = ix;
te = [];
Index: src/ChangeLog
===================================================================
RCS file: /cvs/octave/src/ChangeLog,v
retrieving revision 1.1488
retrieving revision 1.1493
diff -u -r1.1488 -r1.1493
--- src/ChangeLog 28 Jul 2006 16:53:58 -0000 1.1488
+++ src/ChangeLog 14 Aug 2006 20:07:37 -0000 1.1493
@@ -1,3 +1,22 @@
+2006-08-14 John W. Eaton <jwe@octave.org>
+
+ * variables.cc (symbol_record_name_compare): Fix casts.
+
+ * ov-cell.cc (octave_cell::subsasgn): Call empty_conv for 0x0
+ objects, not just empty objects.
+
+ * oct-map.h (Octave_map::clear): Also clear key_list.
+
+ * load-path.cc (load_path::find_dir_info, load_path::do_add,
+ load_path::do_remove): Perform tilde expansion on directory here.
+
+2006-07-29 John W. Eaton <jwe@octave.org>
+
+ * matrix.h: Delete to avoid conflict with liboctave/Matrix.h on
+ case-insensitive filesystems.
+
+ * version.h (OCTAVE_VERSION): Now 2.9.7+.
+
2006-07-28 John W. Eaton <jwe@octave.org>
* version.h (OCTAVE_VERSION): Now 2.9.7.
Index: src/load-path.cc
===================================================================
RCS file: /cvs/octave/src/load-path.cc,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- src/load-path.cc 28 Jul 2006 16:31:00 -0000 1.6
+++ src/load-path.cc 14 Aug 2006 16:42:03 -0000 1.7
@@ -237,8 +237,10 @@
}
load_path::const_dir_info_list_iterator
-load_path::find_dir_info (const std::string& dir) const
+load_path::find_dir_info (const std::string& dir_arg) const
{
+ std::string dir = file_ops::tilde_expand (dir_arg);
+
const_dir_info_list_iterator retval = dir_info_list.begin ();
while (retval != dir_info_list.end ())
@@ -253,8 +255,10 @@
}
load_path::dir_info_list_iterator
-load_path::find_dir_info (const std::string& dir)
+load_path::find_dir_info (const std::string& dir_arg)
{
+ std::string dir = file_ops::tilde_expand (dir_arg);
+
dir_info_list_iterator retval = dir_info_list.begin ();
while (retval != dir_info_list.end ())
@@ -465,14 +469,16 @@
}
void
-load_path::do_add (const std::string& dir, bool at_end, bool warn)
+load_path::do_add (const std::string& dir_arg, bool at_end, bool warn)
{
- size_t len = dir.length ();
+ size_t len = dir_arg.length ();
- if (len > 1 && dir.substr (len-2) == "//")
+ if (len > 1 && dir_arg.substr (len-2) == "//")
warning_with_id ("Octave:recursive-path-search",
"trailing `//' is no longer special in search path elements");
+ std::string dir = file_ops::tilde_expand (dir_arg);
+
dir_info_list_iterator i = find_dir_info (dir);
if (i != dir_info_list.end ())
@@ -501,12 +507,12 @@
}
}
else if (warn)
- warning ("addpath: %s: not a directory", dir.c_str ());
+ warning ("addpath: %s: not a directory", dir_arg.c_str ());
}
else if (warn)
{
std::string msg = fs.error ();
- warning ("addpath: %s: %s", dir.c_str (), msg.c_str ());
+ warning ("addpath: %s: %s", dir_arg.c_str (), msg.c_str ());
}
}
@@ -521,13 +527,13 @@
}
bool
-load_path::do_remove (const std::string& dir)
+load_path::do_remove (const std::string& dir_arg)
{
bool retval = false;
- if (! dir.empty ())
+ if (! dir_arg.empty ())
{
- if (dir == ".")
+ if (dir_arg == ".")
{
warning ("rmpath: can't remove \".\" from path");
@@ -536,6 +542,8 @@
}
else
{
+ std::string dir = file_ops::tilde_expand (dir_arg);
+
dir_info_list_iterator i = find_dir_info (dir);
if (i != dir_info_list.end ())
Index: src/oct-map.h
===================================================================
RCS file: /cvs/octave/src/oct-map.h,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- src/oct-map.h 14 Jul 2006 05:30:40 -0000 1.48
+++ src/oct-map.h 14 Aug 2006 19:08:37 -0000 1.49
@@ -135,7 +135,11 @@
bool contains (const std::string& k) const
{ return (seek (k) != map.end ()); }
- void clear (void) { map.clear (); }
+ void clear (void)
+ {
+ map.clear ();
+ key_list.clear ();
+ }
string_vector keys (void) const;
@@ -183,10 +187,10 @@
mutable dim_vector dimensions;
void maybe_add_to_key_list (const std::string& k)
- {
- if (! contains (k))
- key_list.push_back (k);
- }
+ {
+ if (! contains (k))
+ key_list.push_back (k);
+ }
};
#endif
Index: src/ov-cell.cc
===================================================================
RCS file: /cvs/octave/src/ov-cell.cc,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -r1.69 -r1.70
--- src/ov-cell.cc 22 Jul 2006 08:31:17 -0000 1.69
+++ src/ov-cell.cc 14 Aug 2006 19:44:17 -0000 1.70
@@ -176,7 +176,7 @@
tmp.make_unique ();
- if (! tmp.is_defined () || tmp.is_empty ())
+ if (! tmp.is_defined () || tmp.is_zero_by_zero ())
tmp = octave_value::empty_conv (type.substr (1), rhs);
if (! error_state)
Index: src/variables.cc
===================================================================
RCS file: /cvs/octave/src/variables.cc,v
retrieving revision 1.291
retrieving revision 1.292
diff -u -r1.291 -r1.292
--- src/variables.cc 22 Jun 2006 00:57:28 -0000 1.291
+++ src/variables.cc 14 Aug 2006 20:07:37 -0000 1.292
@@ -1527,8 +1527,8 @@
static int
symbol_record_name_compare (const void *a_arg, const void *b_arg)
{
- const symbol_record *a = static_cast<const symbol_record *> (a_arg);
- const symbol_record *b = static_cast<const symbol_record *> (b_arg);
+ const symbol_record *a = *(static_cast<symbol_record *const*> (a_arg));
+ const symbol_record *b = *(static_cast<symbol_record *const*> (b_arg));
std::string a_nm = a->name ();
std::string b_nm = b->name ();

View File

@ -1,6 +1,6 @@
Name: octave Name: octave
Version: 2.9.7 Version: 2.9.7
Release: 1%{?dist} Release: 2%{?dist}
Summary: A high-level language for numerical computations Summary: A high-level language for numerical computations
Epoch: 6 Epoch: 6
@ -125,6 +125,9 @@ fi
%changelog %changelog
* Tue Aug 15 2006 Quentin Spencer <qspencer@users.sourceforge.net> 2.9.7-2
- Update patch to fix several small bug, including #201087.
* Fri Jul 28 2006 Quentin Spencer <qspencer@users.sourceforge.net> 2.9.7-1 * Fri Jul 28 2006 Quentin Spencer <qspencer@users.sourceforge.net> 2.9.7-1
- New release. Remove old patches and add one new one. - New release. Remove old patches and add one new one.