# HG changeset patch # User jwe # Date 1036447385 0 # Node ID 0d411821682cca9c59794ff851f0240b5ffe8ad0 # Parent 5d9f4688590acfb6389d84761859b026de6d6e26 [project @ 2002-11-04 22:03:05 by jwe] diff -r 5d9f4688590a -r 0d411821682c scripts/ChangeLog --- a/scripts/ChangeLog Sat Nov 02 04:35:28 2002 +0000 +++ b/scripts/ChangeLog Mon Nov 04 22:03:05 2002 +0000 @@ -1,3 +1,11 @@ +2002-11-04 Nicholas Piper + + * control/base/lsim.m: Correct doc string. + +2002-11-04 A S Hodel + + * control/system/syssub.m: Call tf2sys with Gnum-Hnum, not Gnum+Hnum. + 2002-11-01 John W. Eaton * plot/contour.m: Handle x and y as matrices too. diff -r 5d9f4688590a -r 0d411821682c scripts/control/base/lsim.m --- a/scripts/control/base/lsim.m Sat Nov 02 04:35:28 2002 +0000 +++ b/scripts/control/base/lsim.m Mon Nov 04 22:03:05 2002 +0000 @@ -22,8 +22,8 @@ ## ## Produces a plot for the output of the system, sys. ## -## U is an array that contains the system's inputs. Each column in u -## corresponds to a different time step. Each row in u corresponds to a +## U is an array that contains the system's inputs. Each row in u +## corresponds to a different time step. Each column in u corresponds to a ## different input. T is an array that contains the time index of the ## system. T should be regularly spaced. If initial conditions are required ## on the system, the x0 vector should be added to the argument list. diff -r 5d9f4688590a -r 0d411821682c scripts/control/system/syssub.m --- a/scripts/control/system/syssub.m Sat Nov 02 04:35:28 2002 +0000 +++ b/scripts/control/system/syssub.m Mon Nov 04 22:03:05 2002 +0000 @@ -80,7 +80,7 @@ [Hnum,Hden,HT,Hin,Hout] = sys2tf(Hsys); if(length(Hden) == length(Gden) ) if( (Hden == Gden) & (HT == GT) ) - sys = tf2sys(Gnum+Hnum,Gden,GT,Gin,Gout); + sys = tf2sys(Gnum-Hnum,Gden,GT,Gin,Gout); return endif ## if not, we go on and do the usual thing... diff -r 5d9f4688590a -r 0d411821682c src/ChangeLog --- a/src/ChangeLog Sat Nov 02 04:35:28 2002 +0000 +++ b/src/ChangeLog Mon Nov 04 22:03:05 2002 +0000 @@ -1,3 +1,11 @@ +2002-11-04 John W. Eaton + + * cutils.c (octave_vsnprintf): Handle C99 snprintf semantics. + + * oct-obj.h (octave_value_list::operator =): Copy names too. + (octave_value_list::octave_value_list (const octave_value_list&)): + Likewise. + 2002-11-01 John W. Eaton * version.h (OCTAVE_VERSION): Now 2.1.39. diff -r 5d9f4688590a -r 0d411821682c src/cutils.c --- a/src/cutils.c Sat Nov 02 04:35:28 2002 +0000 +++ b/src/cutils.c Mon Nov 04 22:03:05 2002 +0000 @@ -122,6 +122,10 @@ // We manage storage. User should not free it, and its contents are // only valid until next call to vsnprintf. +#if defined __GNUC__ && __GNUC__ >= 3 +#define HAVE_C99_VSNPRINTF 1 +#endif + char * octave_vsnprintf (const char *fmt, va_list args) { @@ -130,21 +134,47 @@ static char *buf = 0; + int nchars; + if (! buf) buf = malloc (size); +#if defined (HAVE_C99_VSNPRINTF) + + nchars = vsnprintf (buf, size, fmt, args); + + if (nchars >= size) + { + size = nchars + 1; + buf = realloc (buf, size); + + if (buf) + vsnprintf (buf, size, fmt, args); + + return buf; + } + +#else + while (1) { - int nchars = vsnprintf (buf, size, fmt, args); + nchars = vsnprintf (buf, size, fmt, args); if (nchars > -1) return buf; else { size *= 2; + buf = realloc (buf, size); + + if (! buf) + return 0; } } + +#endif + #else return 0; #endif diff -r 5d9f4688590a -r 0d411821682c src/oct-obj.h --- a/src/oct-obj.h Sat Nov 02 04:35:28 2002 +0000 +++ b/src/oct-obj.h Mon Nov 04 22:03:05 2002 +0000 @@ -95,7 +95,7 @@ : data (1, octave_value (r)) { } octave_value_list (const octave_value_list& obj) - : data (obj.data) { } + : data (obj.data), names (obj.names) { } void *operator new (size_t size) { return allocator.alloc (size); } @@ -106,7 +106,10 @@ octave_value_list& operator = (const octave_value_list& obj) { if (this != &obj) - data = obj.data; + { + data = obj.data; + names = obj.names; + } return *this; }