# HG changeset patch # User John W. Eaton # Date 1254927586 14400 # Node ID 9ecd35a606e38959f58177bbf069cb3271e2f376 # Parent 531280b07625a9cdd5632b5985289a4c42170009 avoid some warnings from g++ diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog --- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,7 @@ +2009-10-07 John W. Eaton + + * mx-inlines.cc (mx_inline_diff): Avoid uninitialized variable warning. + 2009-10-06 Jaroslav Hajek * dDiagMatrix.cc (operator *(const DiagMatrix&, const DiagMatrix&)): diff --git a/liboctave/mx-inlines.cc b/liboctave/mx-inlines.cc --- a/liboctave/mx-inlines.cc +++ b/liboctave/mx-inlines.cc @@ -951,10 +951,9 @@ r[i] = v[i+1] - v[i]; break; case 2: - { - T lst; - if (n > 1) - lst = v[1] - v[0]; + if (n > 1) + { + T lst = v[1] - v[0]; for (octave_idx_type i = 0; i < n-2; i++) { T dif = v[i+2] - v[i+1]; diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2009-10-07 John W. Eaton + + * pt-arg-list.cc (tree_argument_list::convert_to_const_vector): + Avoid uninitialized variable warning. + * pt-cbinop.cc (simplify_ldiv_op): Avoid unused parameter warning. + * ov-flt-re-mat.cc (convert_to_str_internal): + Update for octave_value constructor changes. + 2009-10-07 Jaroslav Hajek * oct-stream.cc (octave_base_stream::skipl, diff --git a/src/ov-flt-re-mat.cc b/src/ov-flt-re-mat.cc --- a/src/ov-flt-re-mat.cc +++ b/src/ov-flt-re-mat.cc @@ -307,7 +307,7 @@ } } - retval = octave_value (chm, true, type); + retval = octave_value (chm, type); return retval; } diff --git a/src/pt-arg-list.cc b/src/pt-arg-list.cc --- a/src/pt-arg-list.cc +++ b/src/pt-arg-list.cc @@ -163,12 +163,10 @@ && ! (object->is_function () || object->is_function_handle ())); - unwind_protect::frame_id_t uwp_frame; + unwind_protect::frame_id_t uwp_frame = unwind_protect::begin_frame (); if (stash_object) { - uwp_frame = unwind_protect::begin_frame (); - unwind_protect::protect_var (indexed_object); indexed_object = object; @@ -217,8 +215,7 @@ } } - if (stash_object) - unwind_protect::run_frame (uwp_frame); + unwind_protect::run_frame (uwp_frame); return args; } diff --git a/src/pt-cbinop.cc b/src/pt-cbinop.cc --- a/src/pt-cbinop.cc +++ b/src/pt-cbinop.cc @@ -109,7 +109,7 @@ // Possibly convert left division to trans_ldiv or herm_ldiv. static octave_value::compound_binary_op -simplify_ldiv_op (tree_expression *&a, tree_expression *&b) +simplify_ldiv_op (tree_expression *&a, tree_expression *&) { octave_value::compound_binary_op retop; octave_value::unary_op opa = strip_trans_herm (a);