# HG changeset patch # User Jaroslav Hajek # Date 1285876235 -7200 # Node ID b0eec300d3fc7975af826434f0db3a5de4f1c31b # Parent d7f0d115c10c509a9d17f7210c6932362d9f5430 avoid SID in octave_fields diff -r d7f0d115c10c -r b0eec300d3fc src/ChangeLog --- a/src/ChangeLog Thu Sep 30 12:53:23 2010 -0400 +++ b/src/ChangeLog Thu Sep 30 21:50:35 2010 +0200 @@ -1,3 +1,8 @@ +2010-09-30 Jaroslav Hajek + + * oct-map.h (octave_fields::nil_rep): Make a static function. + (octave_fields::octave_fields (void)): Use it here. + 2010-09-30 John W. Eaton * toplev.cc (octave_config_info): Use Octave_scalar_map instead diff -r d7f0d115c10c -r b0eec300d3fc src/oct-map.cc --- a/src/oct-map.cc Thu Sep 30 12:53:23 2010 -0400 +++ b/src/oct-map.cc Thu Sep 30 21:50:35 2010 +0200 @@ -32,8 +32,6 @@ #include "oct-map.h" #include "utils.h" -octave_fields::fields_rep octave_fields::nil_rep; - octave_fields::octave_fields (const string_vector& fields) : rep (new fields_rep) { diff -r d7f0d115c10c -r b0eec300d3fc src/oct-map.h --- a/src/oct-map.h Thu Sep 30 12:53:23 2010 -0400 +++ b/src/oct-map.h Thu Sep 30 21:50:35 2010 +0200 @@ -52,11 +52,15 @@ fields_rep *rep; - static fields_rep nil_rep; + static fields_rep *nil_rep (void) + { + static fields_rep *nr = new fields_rep (); + return nr; + } public: - octave_fields (void) : rep (&nil_rep) { rep->count++; } + octave_fields (void) : rep (nil_rep ()) { rep->count++; } octave_fields (const string_vector&); octave_fields (const char * const *);