changeset 6328:a7a2f1596b4b

[project @ 2007-02-20 02:20:40 by jwe]
author jwe
date Tue, 20 Feb 2007 02:20:40 +0000
parents 4905c543b301
children 1d4b4312f782
files scripts/ChangeLog scripts/plot/__uiobject_alloc__.in scripts/plot/__uiobject_grow_list__.in
diffstat 3 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Mon Feb 19 19:59:26 2007 +0000
+++ b/scripts/ChangeLog	Tue Feb 20 02:20:40 2007 +0000
@@ -1,3 +1,10 @@
+2007-02-19  John W. Eaton  <jwe@octave.org>
+
+	* plot/__uiobject_alloc__.in: If next available element in
+	__uiobject_list__ is 0, grow list before doing anything else.
+	* plot/__uiobject_grow_list__.in: Only set __uiobject_head__ on
+	first call when size of __uiobject_list__ is 0.
+
 2007-02-16  John W. Eaton  <jwe@octave.org>
 
 	* miscellaneous/Makefile.in (SOURCES): Remove popen2.m from the list.
--- a/scripts/plot/__uiobject_alloc__.in	Mon Feb 19 19:59:26 2007 +0000
+++ b/scripts/plot/__uiobject_alloc__.in	Tue Feb 20 02:20:40 2007 +0000
@@ -30,7 +30,7 @@
   __uiobject_globals__;
 
   if (nargin == 0)
-    if (! __uiobject_head__)
+    if (! (__uiobject_head__ && __uiobject_list__(__uiobject_head__).next))
       __uiobject_grow_list__ ();
     endif
     idx = __uiobject_head__;
--- a/scripts/plot/__uiobject_grow_list__.in	Mon Feb 19 19:59:26 2007 +0000
+++ b/scripts/plot/__uiobject_grow_list__.in	Tue Feb 20 02:20:40 2007 +0000
@@ -36,7 +36,9 @@
     __uiobject_list__(new_size).in_use = false;
     __uiobject_list__(new_size).handle = NaN;
     __uiobject_list__(new_size).object = NaN;
-    if (curr_size)
+    if (curr_size == 0)
+      __uiobject_head__ = 1;
+    else
       __uiobject_list__(curr_size).next = curr_size+1;
       __uiobject_list__(curr_size).in_use = false;
       __uiobject_list__(curr_size).handle = NaN;
@@ -48,8 +50,8 @@
       __uiobject_list__(i).handle = NaN;
       __uiobject_list__(i).object = NaN;
     endfor
-    __uiobject_head__ = curr_size+1;
   else
     print_usage ();
   endif
+
 endfunction