# HG changeset patch # User John W. Eaton # Date 1272052652 14400 # Node ID f88e3d5d88e22aecf5e7032de6263cad0e2d1207 # Parent 394a83606f03765d7b7aa6783bc4f23d0c6671a3 avoid GCC warnings diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2010-04-23 John W. Eaton + + * gethelp.cc (extract_help_text): Use C++ static_cast instead of + C-style cast. + 2010-04-23 Rik * scripts/*.m: Untabify scripts diff --git a/scripts/gethelp.cc b/scripts/gethelp.cc --- a/scripts/gethelp.cc +++ b/scripts/gethelp.cc @@ -73,7 +73,7 @@ if (! have_help_text) { first_comments_seen = true; - help_txt += (char) c; + help_txt += static_cast (c); } if (c == '\n') diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,16 @@ +2010-04-23 John W. Eaton + + * txt-eng-ft.cc (ft_render::visit): Declare loop counter size_t, + not int. + + * graphics.h.in (graphics_xform::untransform): Likewise. + * graphics.cc (text::properties::update_text_extent): Likewise. + * DLD-FUNCTIONS/fltk_backend.cc (plot_window::set_axes_currentpoint): + Avoid GCC shadow variable warning. + + * DLD-FUNCTIONS (plot_window::plot_window): Explicitly + initialize all data members in the order they are declared.. + 2010-04-23 John W. Eaton * DLD-FUNCTIONS/gcd.cc (Fgcd): Use two-argument dim_vector constructor. diff --git a/src/DLD-FUNCTIONS/fltk_backend.cc b/src/DLD-FUNCTIONS/fltk_backend.cc --- a/src/DLD-FUNCTIONS/fltk_backend.cc +++ b/src/DLD-FUNCTIONS/fltk_backend.cc @@ -218,7 +218,9 @@ { public: plot_window (int _x, int _y, int _w, int _h, figure::properties& _fp) - : Fl_Window (_x, _y, _w, _h, "octave"), fp (_fp), shift (0) + : Fl_Window (_x, _y, _w, _h, "octave"), window_label (), shift (0), + fp (_fp), canvas (0), autoscale (0), togglegrid (0), help (0), + status (0) { callback (window_close, static_cast (this)); @@ -465,14 +467,14 @@ axes::properties& ap = dynamic_cast (ax.get_properties ()); - double x, y; - pixel2pos (ax, px, py, x, y); + double xx, yy; + pixel2pos (ax, px, py, xx, yy); Matrix pos (2,3,0); - pos(0,0) = x; - pos(1,0) = y; - pos(0,1) = x; - pos(1,1) = y; + pos(0,0) = xx; + pos(1,0) = yy; + pos(0,1) = xx; + pos(1,1) = yy; ap.set_currentpoint (pos); } diff --git a/src/graphics.cc b/src/graphics.cc --- a/src/graphics.cc +++ b/src/graphics.cc @@ -4250,15 +4250,15 @@ #endif box = text_renderer.get_extent (elt, get_rotation ()); - Matrix extent (1, 4, 0.0); + Matrix ext (1, 4, 0.0); // FIXME: also handle left and bottom components - extent(0) = extent(1) = 1; - extent(2) = box(0); - extent(3) = box(1); - - set_extent (extent); + ext(0) = ext(1) = 1; + ext(2) = box(0); + ext(3) = box(1); + + set_extent (ext); #endif } diff --git a/src/graphics.h.in b/src/graphics.h.in --- a/src/graphics.h.in +++ b/src/graphics.h.in @@ -2743,13 +2743,13 @@ static Matrix xform_eye (void); ColumnVector transform (double x, double y, double z, - bool scale = true) const; + bool use_scale = true) const; ColumnVector untransform (double x, double y, double z, - bool scale = true) const; + bool use_scale = true) const; - ColumnVector untransform (double x, double y, bool scale = true) const - { return untransform (x, y, (zlim(0)+zlim(1))/2, scale); } + ColumnVector untransform (double x, double y, bool use_scale = true) const + { return untransform (x, y, (zlim(0)+zlim(1))/2, use_scale); } Matrix xscale (const Matrix& m) const { return sx.scale (m); } Matrix yscale (const Matrix& m) const { return sy.scale (m); } diff --git a/src/txt-eng-ft.cc b/src/txt-eng-ft.cc --- a/src/txt-eng-ft.cc +++ b/src/txt-eng-ft.cc @@ -266,7 +266,7 @@ std::string str = e.string_value (); FT_UInt glyph_index, previous = 0; - for (int i = 0; i < str.length (); i++) + for (size_t i = 0; i < str.length (); i++) { glyph_index = FT_Get_Char_Index (face, str[i]);