Mercurial > hg > octave-thorsten
changeset 11068:b0eec300d3fc
avoid SID in octave_fields
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Thu, 30 Sep 2010 21:50:35 +0200 |
parents | d7f0d115c10c |
children | e40e19761d06 |
files | src/ChangeLog src/oct-map.cc src/oct-map.h |
diffstat | 3 files changed, 11 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-09-30 Jaroslav Hajek <highegg@gmail.com> + + * 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 <jwe@octave.org> * toplev.cc (octave_config_info): Use Octave_scalar_map instead
--- a/src/oct-map.cc +++ b/src/oct-map.cc @@ -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) {
--- a/src/oct-map.h +++ b/src/oct-map.h @@ -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 *);