Mercurial > hg > octave-nkf
changeset 11515:6dbf9bcce90e
more data member initialization fixes
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 13 Jan 2011 10:00:13 -0500 |
parents | a1386fab2a02 |
children | 53edbf95fbb6 |
files | src/ChangeLog src/base-list.h src/lex.h src/load-path.h |
diffstat | 4 files changed, 71 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2011-01-13 John W. Eaton <jwe@octave.org> + + * base-list.h (class octave_base_list): Provide explicit + default and copy construtors, assignment operator, and destructor. + * load-path.h (load_path::dir_info::class_info): Likewise. + + * load-path.h (load_path::dir_info::dir_info): Initialize all + members in initializaition list. + * lex.h (lexical_feedback::lexical_feedback): Likewise. + 2011-01-13 John W. Eaton <jwe@octave.org> * cutils.h: New file.
--- a/src/base-list.h +++ b/src/base-list.h @@ -86,6 +86,23 @@ // For backward compatibility. void append (const elt_type& s) { lst.push_back (s); } +protected: + + octave_base_list (void) : lst () { } + + octave_base_list (const octave_base_list& bl) : lst (bl.lst) { } + + octave_base_list& operator = (const octave_base_list& bl) + { + if (this != &bl) + { + lst = bl.lst; + } + return *this; + } + + ~octave_base_list (void) { } + private: std::list<elt_type> lst;
--- a/src/lex.h +++ b/src/lex.h @@ -57,7 +57,20 @@ { public: - lexical_feedback (void) { init (); } + lexical_feedback (void) + : bracketflag (0), braceflag (0), looping (0), + convert_spaces_to_comma (true), at_beginning_of_statement (true), + defining_func (0), looking_at_function_handle (false), + looking_at_return_list (false), looking_at_parameter_list (false), + looking_at_decl_list (false), looking_at_initializer_expression (false), + looking_at_matrix_or_assign_lhs (false), looking_at_object_index (), + looking_for_object_index (false), looking_at_indirect_ref (false), + parsed_function_name (), parsing_class_method (false), + maybe_classdef_get_set_method (false), parsing_classdef (false), + quote_is_transpose (false), pending_local_variables () + { + init (); + } ~lexical_feedback (void) { }
--- a/src/load-path.h +++ b/src/load-path.h @@ -261,6 +261,24 @@ struct class_info { + class_info (void) : method_file_map (), private_file_map () { } + + class_info (const class_info& ci) + : method_file_map (ci.method_file_map), + private_file_map (ci.private_file_map) { } + + class_info& operator = (const class_info& ci) + { + if (this != &ci) + { + method_file_map = ci.method_file_map; + private_file_map = ci.private_file_map; + } + return *this; + } + + ~class_info (void) { } + fcn_file_map_type method_file_map; fcn_file_map_type private_file_map; }; @@ -274,9 +292,19 @@ // This default constructor is only provided so we can create a // std::map of dir_info objects. You should not use this // constructor for any other purpose. - dir_info (void) { } + dir_info (void) + : dir_name (), abs_dir_name (), is_relative (false), + dir_mtime (), dir_time_last_checked (), all_files (), + fcn_files (), private_file_map (), method_file_map () + { } - dir_info (const std::string& d) : dir_name (d) { initialize (); } + dir_info (const std::string& d) + : dir_name (d), abs_dir_name (), is_relative (false), + dir_mtime (), dir_time_last_checked (), all_files (), + fcn_files (), private_file_map (), method_file_map () + { + initialize (); + } dir_info (const dir_info& di) : dir_name (di.dir_name), abs_dir_name (di.abs_dir_name),