Mercurial > hg > octave-shane
changeset 11584:cda4aa780d58
Another round of initialising members in the constructor initialisation list
author | Pascal Dupuis <Pascal.Dupuis@uclouvain.be> |
---|---|
date | Thu, 20 Jan 2011 17:07:26 -0500 |
parents | c4c2cd67c440 |
children | 1473d0cf86d2 |
files | src/ChangeLog src/debug.h src/dynamic-ld.cc src/gl-render.cc src/gl-render.h src/gl2ps-renderer.h src/lex.h src/ls-hdf5.h src/oct-stream.h src/oct-strstrm.h src/ov-base-diag.h src/ov-base-mat.h src/ov-base-scalar.h src/ov-base-sparse.h src/ov-cell.h src/ov-class.h src/ov-dld-fcn.h src/ov-fcn-handle.h src/ov-lazy-idx.h src/ov-perm.h src/ov-range.h src/ov-struct.h src/procstream.h src/pt-assign.h src/symtab.h |
diffstat | 25 files changed, 88 insertions(+), 45 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2011-01-20 Pascal Dupuis <Pascal.Dupuis@worldonline.be>. + + * debug.h, dynamic-ld.cc, gl-render.cc, gl-render.h, + gl2ps-renderer.h, lex.h, ls-hdf5.h, oct-stream.h, oct-strstrm.h, + ov-base-diag.h, ov-base-mat.h, ov-base-scalar.h, ov-base-sparse.h, + ov-cell.h, ov-class.h, ov-dld-fcn.h, ov-fcn-handle.h, + ov-lazy-idx.h, ov-perm.h, ov-range.h, ov-struct.h, procstream.h, + pt-assign.h, symtab.h, unwind-prot.h: Initialize + all data members in initialization list. + 2011-01-20 Kai Habel <kai.habel@gmx.de> * DLD-FUNCTIONS/__init_fltk__.cc (__fltk_uigetfile__): Append file
--- a/src/debug.h +++ b/src/debug.h @@ -39,7 +39,7 @@ { private: - bp_table (void) { } + bp_table (void) : bp_set () { } ~bp_table (void) { }
--- a/src/dynamic-ld.cc +++ b/src/dynamic-ld.cc @@ -64,7 +64,7 @@ private: - octave_shlib_list (void) { } + octave_shlib_list (void) : lib_list () { } ~octave_shlib_list (void) { } @@ -203,7 +203,7 @@ private: - octave_mex_file_list (void) { } + octave_mex_file_list (void) : file_list () { } ~octave_mex_file_list (void) { }
--- a/src/gl-render.cc +++ b/src/gl-render.cc @@ -63,7 +63,10 @@ class texture_rep { public: - texture_rep (void) : valid (false), count (1) { } + texture_rep (void) + : id (), w (), h (), tw (), th (), tx (), ty (), + valid (false), count (1) + { } texture_rep (GLuint id_arg, int w_arg, int h_arg, int tw_arg, int th_arg) : id (id_arg), w (w_arg), h (h_arg), tw (tw_arg), th (th_arg), @@ -239,7 +242,7 @@ public: - opengl_tesselator (void) : glu_tess (0) { init (); } + opengl_tesselator (void) : glu_tess (0), fill() { init (); } virtual ~opengl_tesselator (void) { if (glu_tess) gluDeleteTess (glu_tess); } @@ -343,7 +346,9 @@ // reference counter int count; - vertex_data_rep (void) : count (1) { } + vertex_data_rep (void) + : coords (), color (), normal (), alpha (), + ambient (), diffuse (), specular (), specular_exp (),count (1) { } vertex_data_rep (const Matrix& c, const Matrix& col, const Matrix& n, double a, float as, float ds, float ss, float se)
--- a/src/gl-render.h +++ b/src/gl-render.h @@ -48,7 +48,14 @@ opengl_renderer { public: - opengl_renderer (void) { } + opengl_renderer (void) + : toolkit (), xform (), xmin (), xmax (), ymin (), ymax (), + zmin (), zmax (), xZ1 (), xZ2 (), marker_id (), filled_marker_id (), + camera_pos (), camera_dir () +#if HAVE_FREETYPE + , text_renderer () +#endif + { } virtual ~opengl_renderer (void) { } @@ -111,7 +118,14 @@ GLenum type, const GLvoid *data); private: - opengl_renderer (const opengl_renderer&) { } + opengl_renderer (const opengl_renderer&) + : toolkit (), xform (), xmin (), xmax (), ymin (), ymax (), + zmin (), zmax (), xZ1 (), xZ2 (), marker_id (), filled_marker_id (), + camera_pos (), camera_dir () +#if HAVE_FREETYPE + , text_renderer () +#endif + { } opengl_renderer& operator = (const opengl_renderer&) { return *this; }
--- a/src/gl2ps-renderer.h +++ b/src/gl2ps-renderer.h @@ -32,7 +32,8 @@ { public: glps_renderer (const int _fid, const std::string& _term) - : opengl_renderer () , fid (_fid), term (_term) { } + : opengl_renderer () , fid (_fid), term (_term), + fontsize (), fontname () { } ~glps_renderer (void) { }
--- a/src/lex.h +++ b/src/lex.h @@ -57,16 +57,19 @@ public: 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 () + looking_for_object_index (false), do_comma_insert (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 (); }
--- a/src/ls-hdf5.h +++ b/src/ls-hdf5.h @@ -43,11 +43,12 @@ // keep track of current item index in the file int current_item; - hdf5_fstreambase () { file_id = -1; } + hdf5_fstreambase () : file_id (-1), current_item () { } ~hdf5_fstreambase () { close (); } hdf5_fstreambase (const char *name, int mode, int /* prot */ = 0) + : file_id (-1), current_item (-1) { if (mode & std::ios::in) file_id = H5Fopen (name, H5F_ACC_RDONLY, H5P_DEFAULT);
--- a/src/oct-stream.h +++ b/src/oct-stream.h @@ -333,7 +333,8 @@ octave_base_stream (std::ios::openmode arg_md = std::ios::in|std::ios::out, oct_mach_info::float_format ff = oct_mach_info::native_float_format ()) - : count (0), md (arg_md), flt_fmt (ff), fail (false), open_state (true) + : count (0), md (arg_md), flt_fmt (ff), fail (false), open_state (true), + errmsg () { } virtual ~octave_base_stream (void) { }
--- a/src/oct-strstrm.h +++ b/src/oct-strstrm.h @@ -135,7 +135,7 @@ octave_ostrstream (std::ios::openmode arg_md = std::ios::out, oct_mach_info::float_format ff = oct_mach_info::native_float_format ()) - : octave_base_strstream (arg_md, ff) { } + : octave_base_strstream (arg_md, ff), os () { } static octave_stream create (std::ios::openmode arg_md = std::ios::out,
--- a/src/ov-base-diag.h +++ b/src/ov-base-diag.h @@ -47,14 +47,14 @@ public: octave_base_diag (void) - : octave_base_value () { } + : octave_base_value (), matrix (), dense_cache () { } octave_base_diag (const DMT& m) - : octave_base_value (), matrix (m) + : octave_base_value (), matrix (m), dense_cache () { } octave_base_diag (const octave_base_diag& m) - : octave_base_value (), matrix (m.matrix) { } + : octave_base_value (), matrix (m.matrix), dense_cache () { } ~octave_base_diag (void) { }
--- a/src/ov-base-mat.h +++ b/src/ov-base-mat.h @@ -49,7 +49,7 @@ public: octave_base_matrix (void) - : octave_base_value (), typ (), idx_cache () { } + : octave_base_value (), matrix (), typ (), idx_cache () { } octave_base_matrix (const MT& m, const MatrixType& t = MatrixType ()) : octave_base_value (), matrix (m),
--- a/src/ov-base-scalar.h +++ b/src/ov-base-scalar.h @@ -46,7 +46,7 @@ public: octave_base_scalar (void) - : octave_base_value () { } + : octave_base_value (), scalar () { } octave_base_scalar (const ST& s) : octave_base_value (), scalar (s) { }
--- a/src/ov-base-sparse.h +++ b/src/ov-base-sparse.h @@ -49,7 +49,9 @@ { public: - octave_base_sparse (void) : octave_base_value (), typ (MatrixType ()) { } + octave_base_sparse (void) + : octave_base_value (), matrix (), typ (MatrixType ()) + { } octave_base_sparse (const T& a) : octave_base_value (), matrix (a), typ (MatrixType ())
--- a/src/ov-cell.h +++ b/src/ov-cell.h @@ -51,16 +51,16 @@ public: octave_cell (void) - : octave_base_matrix<Cell> () { } + : octave_base_matrix<Cell> (), cellstr_cache () { } octave_cell (const Cell& c) - : octave_base_matrix<Cell> (c) { } + : octave_base_matrix<Cell> (c), cellstr_cache () { } octave_cell (const Array<std::string>& str) : octave_base_matrix<Cell> (Cell (str)), cellstr_cache (new Array<std::string> (str)) { } octave_cell (const octave_cell& c) - : octave_base_matrix<Cell> (c) { } + : octave_base_matrix<Cell> (c), cellstr_cache () { } ~octave_cell (void) { }
--- a/src/ov-class.h +++ b/src/ov-class.h @@ -50,10 +50,14 @@ public: octave_class (void) - : octave_base_value (), obsolete_copies (0) { } + : octave_base_value (), map (), c_name (), + parent_list (), obsolete_copies (0) + { } octave_class (const octave_map& m, const std::string& id) - : octave_base_value (), map (m), c_name (id), obsolete_copies (0) { } + : octave_base_value (), map (m), c_name (id), + parent_list (), obsolete_copies (0) + { } octave_class (const octave_class& s) : octave_base_value (s), map (s.map), c_name (s.c_name),
--- a/src/ov-dld-fcn.h +++ b/src/ov-dld-fcn.h @@ -44,7 +44,9 @@ { public: - octave_dld_function (void) { } + octave_dld_function (void) + : sh_lib (), t_checked (), system_fcn_file () + { } octave_dld_function (octave_builtin::fcn ff, const octave_shlib& shl, const std::string& nm = std::string (),
--- a/src/ov-fcn-handle.h +++ b/src/ov-fcn-handle.h @@ -50,16 +50,16 @@ static const std::string anonymous; octave_fcn_handle (void) - : fcn (), nm (), has_overloads (false) { } + : fcn (), nm (), has_overloads (false), overloads () { } octave_fcn_handle (const std::string& n) - : fcn (), nm (n), has_overloads (false) { } + : fcn (), nm (n), has_overloads (false), overloads () { } octave_fcn_handle (const octave_value& f, const std::string& n = anonymous); octave_fcn_handle (const octave_fcn_handle& fh) : octave_base_value (fh), fcn (fh.fcn), nm (fh.nm), - has_overloads (fh.has_overloads) + has_overloads (fh.has_overloads), overloads () { for (int i = 0; i < btyp_num_types; i++) builtin_overloads[i] = fh.builtin_overloads[i];
--- a/src/ov-lazy-idx.h +++ b/src/ov-lazy-idx.h @@ -35,10 +35,10 @@ public: octave_lazy_index (void) - : octave_base_value () { } + : octave_base_value (), index (), value () { } octave_lazy_index (const idx_vector& idx) - : octave_base_value (), index (idx) { } + : octave_base_value (), index (idx), value () { } octave_lazy_index (const octave_lazy_index& i) : octave_base_value (), index (i.index), value (i.value) { }
--- a/src/ov-perm.h +++ b/src/ov-perm.h @@ -35,9 +35,9 @@ octave_perm_matrix : public octave_base_value { public: - octave_perm_matrix (void) : matrix () { } + octave_perm_matrix (void) : matrix (), dense_cache () { } - octave_perm_matrix (const PermMatrix& p) : matrix (p) { } + octave_perm_matrix (const PermMatrix& p) : matrix (p), dense_cache () { } octave_base_value *clone (void) const { return new octave_perm_matrix (*this); } octave_base_value *empty_clone (void) const { return new octave_perm_matrix (); }
--- a/src/ov-range.h +++ b/src/ov-range.h @@ -54,7 +54,7 @@ public: octave_range (void) - : octave_base_value (), idx_cache () { } + : octave_base_value (), range (), idx_cache () { } octave_range (double base, double limit, double inc) : octave_base_value (), range (base, limit, inc), idx_cache ()
--- a/src/ov-struct.h +++ b/src/ov-struct.h @@ -49,7 +49,7 @@ public: octave_struct (void) - : octave_base_value () { } + : octave_base_value (), map () { } octave_struct (const octave_map& m) : octave_base_value (), map (m) { } @@ -173,7 +173,7 @@ public: octave_scalar_struct (void) - : octave_base_value () { } + : octave_base_value (), map () { } octave_scalar_struct (const octave_scalar_map& m) : octave_base_value (), map (m) { }
--- a/src/procstream.h +++ b/src/procstream.h @@ -36,7 +36,7 @@ { public: - procstreambase (void) { pb_init (); } + procstreambase (void) : pb () { pb_init (); } procstreambase (const std::string& name, int mode);
--- a/src/pt-assign.h +++ b/src/pt-assign.h @@ -46,8 +46,8 @@ tree_simple_assignment (bool plhs = false, int l = -1, int c = -1, octave_value::assign_op t = octave_value::op_asn_eq) - : tree_expression (l, c), lhs (0), rhs (0), preserve (plhs), etype (t), - first_execution (true) { } + : tree_expression (l, c), lhs (0), rhs (0), preserve (plhs), ans_ass (), + etype (t), first_execution (true) { } tree_simple_assignment (tree_expression *le, tree_expression *re, bool plhs = false, int l = -1, int c = -1,
--- a/src/symtab.h +++ b/src/symtab.h @@ -529,9 +529,9 @@ fcn_info_rep (const std::string& nm) : name (nm), subfunctions (), private_functions (), - class_constructors (), class_methods (), cmdline_function (), - autoload_function (), function_on_path (), built_in_function (), - count (1) { } + class_constructors (), class_methods (), dispatch_map (), + cmdline_function (), autoload_function (), function_on_path (), + built_in_function (), count (1) { } octave_value load_private_function (const std::string& dir_name); @@ -1947,7 +1947,7 @@ static context_id xcurrent_context; symbol_table (void) - : table_name (), table (), curr_fcn (0) { } + : table_name (), table (), curr_fcn (0), persistent_table () { } ~symbol_table (void) { }