Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80905 - in sandbox/SOC/2007/visualization/boost/svg_plot: . detail impl
From: pbristow_at_[hidden]
Date: 2012-10-08 07:36:41


Author: pbristow
Date: 2012-10-08 07:36:40 EDT (Mon, 08 Oct 2012)
New Revision: 80905
URL: http://svn.boost.org/trac/boost/changeset/80905

Log:
Reduced warnings - OK gcc 3.4.4 and MSVC 2010
Text files modified:
   sandbox/SOC/2007/visualization/boost/svg_plot/detail/auto_axes.hpp | 33 +++++++++++++++++----------------
   sandbox/SOC/2007/visualization/boost/svg_plot/detail/axis_plot_frame.hpp | 15 +++++++--------
   sandbox/SOC/2007/visualization/boost/svg_plot/impl/axis_plot_frame.ipp | 16 ++++++++--------
   sandbox/SOC/2007/visualization/boost/svg_plot/show_1d_settings.hpp | 14 +++++++-------
   sandbox/SOC/2007/visualization/boost/svg_plot/show_2d_settings.hpp | 2 +-
   5 files changed, 40 insertions(+), 40 deletions(-)

Modified: sandbox/SOC/2007/visualization/boost/svg_plot/detail/auto_axes.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/detail/auto_axes.hpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/detail/auto_axes.hpp 2012-10-08 07:36:40 EDT (Mon, 08 Oct 2012)
@@ -189,7 +189,7 @@
   //! allowing values just 1 pixel over the tick to be shown.
   int x_min_ticks = 6, //!< Minimum number of major ticks.
   int x_steps = 0, //!< 0, or 2 for 2, 4, 6, 8, 10, 5 for 1, 5, 10, or 10 (2, 5, 10).
- bool y_origin = false, //!< do not include the origin un../sandbox/SOC/2007/visualization/boost/svg_plot/detail/auto_axes.hpp:398:5: error: need ‘typename’ before ‘T:: const_iterator’ because ‘T’ is a dependent scopeless the range min_value <= 0 <= max_value.
+ bool y_origin = false, //!< do not include the origin un../sandbox/SOC/2007/visualization/boost/svg_plot/detail/auto_axes.hpp:398:5: error: need ‘typename’ before ‘T:: const_iterator’ because ‘T’ is a dependent scopeless the range min_value <= 0 <= max_value.
   double y_tight = 0., //!< tightest - fraction of 'overrun' allowed before another tick used.
   // for visual effect up to about 0.001 might suit a 1000 pixel wide image,
   // allowing values just 1 pixel over the tick to be shown.
@@ -309,7 +309,7 @@
   detail::scale_axis_impl(min_value, max_value,
     axis_min_value, axis_max_value, axis_tick_increment, auto_ticks, // All 4 updated.
     origin, tight, min_ticks, steps); // Display range.
-} //
+} //
 
 //! Scale axis function to define axis marker ticks based on min & max parameters values.
 void scale_axis(
@@ -410,7 +410,7 @@
   if (!check_limits)
   {
     //std::pair<T::iterator, T::iterator> result = boost::minmax_element(container.begin(), container.end());
- std::pair<T::const_iterator, T::const_iterator> result = boost::minmax_element(container.begin(), container.end());
+ std::pair<typename T::const_iterator, typename T::const_iterator> result = boost::minmax_element(container.begin(), container.end());
     // minmax_element is efficient because can use knowledge of being sorted,
     // BUT only if it can be assumed that no values are 'at limits',
     // infinity, NaN, max_value, min_value, denorm_min.
@@ -438,7 +438,7 @@
 } // template <class T> int scale_axis T an STL container: array, vector ...
 
 
-
+
 //! Scale X and Y axis using T a 2D STL container: array of pairs, vector of pairs, ...
 //! \tparam T STL container of 2D pairs of X and Y.
 template <class T>
@@ -460,7 +460,7 @@
   //! allowing values just 1 pixel over the tick to be shown.
   int x_min_ticks, // = 6, //!< Minimum number of major ticks.
   int x_steps, // = 0, //!< 0, or 2 for 2, 4, 6, 8, 10, 5 for 1, 5, 10, or 10 (2, 5, 10).
- bool y_origin, // = false, //!< do not include the origin un../sandbox/SOC/2007/visualization/boost/svg_plot/detail/auto_axes.hpp:398:5: error: need ‘typename’ before ‘T:: const_iterator’ because ‘T’ is a dependent scopeless the range min_value <= 0 <= max_value.
+ bool y_origin, // = false, //!< do not include the origin unless the range min_value <= 0 <= max_value.
   double y_tight, // = 0., //!< tightest - fraction of 'overrun' allowed before another tick used.
   // for visual effect up to about 0.001 might suit a 1000 pixel wide image,
   // allowing values just 1 pixel over the tick to be shown.
@@ -480,7 +480,8 @@
     // minmax_element is efficient for maps because it can use knowledge of all maps being sorted,
     // And also sadly it doesn't work right - Y minimum is wrong! // TODO ??
 
- std::pair<T::const_iterator, T::const_iterator> result = boost::minmax_element(container.begin(), container.end());
+ std::pair<typename T::const_iterator, typename T::const_iterator> result
+ = boost::minmax_element(container.begin(), container.end());
     std::pair<double, double> px = values_of(*result.first); // X min & X max.
     std::pair<double, double> py = values_of(*result.second); // Y min & Y max.
     x_min = px.first;
@@ -599,7 +600,7 @@
   detail::scale_axis_impl(y_min, y_max,
     y_axis_min_value, y_axis_max_value, y_axis_tick_increment, y_auto_ticks,
     y_origin, y_tight, y_min_ticks, y_steps);
-
+
 } // template <class T> int scale_axis T an STL container: array, vector ...
 
 // Above versions all use the scale_axis_impl implementation below that does the real scaling work.
@@ -706,7 +707,7 @@
   else
   { // Range is reasonably large, so
     // compute candidate for increment - must be smaller than range, so divide by 10.
- test_increment = std::pow(10., ceil(log10(abs(range)/10.)));
+ test_increment = std::pow(10., ceil(log10(std::abs<double>(range)/10.)));
     // Must be a decimal multiple or decimal fraction,
     // but is not necessarily exactly representable in floating-point format.
     // Establish maximum axis scale value, using this increment.
@@ -732,7 +733,7 @@
     // then the calculated scale is 1.0408E17 TO 0.05 BY 0.01,
     // rather than 0, 0.05, 0.01.
     // I suspect 1.e-10 is bigger than necessary? related to std::numeric_limits<>::epsilon?
- if(abs(test_min) < 1.E-14)
+ if(std::abs(test_min) < 1.E-14)
     { // test_min is very near zero,
       test_min = 0.; // so treat as exact zero to avoid risk of a switch to e format.
     }
@@ -742,7 +743,7 @@
       // (divide by two should not cause trouble by being inexact).
       ticks = static_cast<int>((test_max - test_min) / test_increment) +1;
       if (steps == 0)
- { // Remove any superflous ticks above max and below min.
+ { // Remove any superfluous ticks above max and below min.
         while((test_min + test_increment) <= min_value)
         { // min_value is > 2nd from bottom tick,
           test_min += test_increment;
@@ -876,7 +877,7 @@
     return 0.; // Just return zero.
   }
   bool is_neg = (value >= 0) ? false : true;
- value = abs(value);
+ value = std::abs(value);
 
   int order = int(floor(log10(value))); // 0 to 9.999, gives 0, 10 to 99.9 gives 2 ...
   double scaled = value * pow(10., -order); // 0 to 9.99 is unchanged, 10 to 9.99 scaled down to 1. to 9.99
@@ -907,7 +908,7 @@
     return 0.; // Just return zero.
   }
   bool is_neg = (value >= 0) ? false : true;
- value = abs(value);
+ value = std::abs(value);
   int order = int(floor(log10(value))); // 0 to 9.999, gives 0, 10 to 99.9 gives 2 ...
   double scaled = value * pow(10., -order); // 0 to 9.99 is unchanged, 10 to 9.99 scaled down to 1. to 9.99
   double pow10order = is_neg ? -pow(10., order) : pow(10., order); // power of ten, signed.
@@ -938,7 +939,7 @@
     return 0.; // Just return zero.
   }
   bool is_neg = (value >= 0) ? false : true;
- value = abs(value);
+ value = std::abs(value);
   int order = int(floor(log10(value))); // 0 to 9.999, gives 0, 10 to 99.9 gives 2 ...
   double scaled = value * pow(10., -order); // 0 to 9.99 is unchanged, 10 to 9.99 scaled down to 1. to 9.99
   double pow10order = is_neg ? -pow(10., order) : pow(10., order); // power of ten, signed.
@@ -965,7 +966,7 @@
     return 0.; // Just return zero.
   }
   bool is_neg = (value >= 0) ? false : true;
- value = abs(value);
+ value = std::abs(value);
   // Decimal scaling, so value is 0.1, 0.5, 1., 5. or 10., 10., 100. ...
   int order = int(floor(log10(value))); // 0 to 9.999, gives 0, 10 to 99.9 gives 2 ...
   double scaled = value * pow(10., -order); // 0 to 9.99 is unchanged, 10 to 9.99 scaled down to 1. to 9.99
@@ -993,7 +994,7 @@
     return 0.; // Just return zero.
   }
   bool is_neg = (value >= 0) ? false : true;
- value = abs(value);
+ value = std::abs(value);
   int order = int(floor(log10(value))); // 0 to 9.999, gives 0, 10 to 99.9 gives 2 ...
   double scaled = value * pow(10., -order); // 0 to 9.99 is unchanged, 10 to 9.99 scaled down to 1. to 9.99
   double pow10order = is_neg ? -pow(10., order) : pow(10., order); // power of ten, signed.
@@ -1028,7 +1029,7 @@
     return 0.; // Just return zero.
   }
   bool is_neg = (value >= 0) ? false : true;
- value = abs(value);
+ value = std::abs(value);
   int order = int(floor(log10(value))); // 0 to 9.999, gives 0, 10 to 99.9 gives 2 ...
   double scaled = value * pow(10., -order); // 0 to 9.99 is unchanged, 10 to 9.99 scaled down to 1. to 9.99
   double pow10order = is_neg ? -pow(10., order) : pow(10., order); // power of ten, signed.

Modified: sandbox/SOC/2007/visualization/boost/svg_plot/detail/axis_plot_frame.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/detail/axis_plot_frame.hpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/detail/axis_plot_frame.hpp 2012-10-08 07:36:40 EDT (Mon, 08 Oct 2012)
@@ -212,14 +212,14 @@
               If the range of labels is very small, then more digits will be essential.
             */
           int x_value_precision(); //!< \return precision of X tick label values in decimal digits
- Derived& x_value_ioflags(int flags); /*!< Set iostream std::ios::fmtflags for X value label (default decimal == 0X201).
+ Derived& x_value_ioflags(std::ios_base::fmtflags flags); /*!< Set iostream std::ios::fmtflags for X value label (default decimal == 0X201).
               Mainly useful for changing to scientific, fixed or hexadecimal format.
               For example:
               \code
                  myplot.x_value_ioflags(std::ios::dec | std::ios::scientific)
               \endcode
             */
- int x_value_ioflags(); //!< \return stream std::ios::fmtflags for control of format of X value labels.
+ std::ios_base::fmtflags x_value_ioflags(); //!< \return stream std::ios::fmtflags for control of format of X value labels.
           Derived& x_labels_strip_e0s(bool cmd); //!< Set if to strip redundant zeros, signs and exponents, for example, reducing "1.2e+000" to "1.2"
             //! This markedly reduces visual clutter, and is the default.
           bool y_labels_strip_e0s(); //!< \return if to strip redundant zeros, signs and exponents, for example, reducing "1.2e+000" to "1.2"
@@ -609,7 +609,7 @@
 
         // class axis_plot_frame Member function Definitions (for .ipp file):
 
-
+
           template <class Derived>/*! \tparam Derived plot class, svg_1d_plot or svg_2d_plot or svg_boxplot. */
           template <class T> /*! \tparam T an STL container: array, vector, list, map ... */
           Derived& axis_plot_frame<Derived>::x_autoscale(const T& begin, const T& end);
@@ -661,7 +661,7 @@
           double axis_plot_frame<Derived>::background_border_width();
           template <class Derived>
           Derived& axis_plot_frame<Derived>::description(const std::string d);
-
+
           template <class Derived>
           const std::string& axis_plot_frame<Derived>::description();
           template <class Derived>
@@ -710,10 +710,9 @@
           int axis_plot_frame<Derived>::x_value_precision();
 
           template <class Derived>
- Derived& axis_plot_frame<Derived>::x_value_ioflags(int flags);
-
+ Derived& axis_plot_frame<Derived>::x_value_ioflags(std::ios_base::fmtflags flags);
           template <class Derived>
- int axis_plot_frame<Derived>::x_value_ioflags();
+ std::ios_base::fmtflags axis_plot_frame<Derived>::x_value_ioflags();
 
           template <class Derived>
           Derived& axis_plot_frame<Derived>::x_labels_strip_e0s(bool cmd);
@@ -1061,7 +1060,7 @@
           bool axis_plot_frame<Derived>::x_values_on();
           template <class Derived>
           Derived& axis_plot_frame<Derived>::x_values_font_size(unsigned int i);
-
+
           template <class Derived>
           Derived& axis_plot_frame<Derived>::x_values_font_family(const std::string& family);
           template <class Derived>

Modified: sandbox/SOC/2007/visualization/boost/svg_plot/impl/axis_plot_frame.ipp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/impl/axis_plot_frame.ipp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/impl/axis_plot_frame.ipp 2012-10-08 07:36:40 EDT (Mon, 08 Oct 2012)
@@ -46,7 +46,7 @@
           }
 
           std::string sv(double v, const value_style& sty, bool);
-
+
           template <class Derived>
           void axis_plot_frame<Derived>::clear_background()
           { //! Clear the whole image background layer of the SVG plot.
@@ -1131,7 +1131,7 @@
                   xu += ux.std_dev();
                 }
                 transform_x(xu); // To SVG coordinates.
- double x_radius = abs(xu - x);
+ double x_radius = std::abs<double>(xu - x);
                 if (x_radius <= 0.)
                 { // Make sure something is visible.
                   x_radius = 1.; // Or size?
@@ -1144,7 +1144,7 @@
                 }
 
                 transform_y(yu);
- double y_radius = abs(yu - y);
+ double y_radius = std::abs<double>(yu - y);
                 if (y_radius <= 0.)
                 { // Make sure something is visible.
                   y_radius = 1.;
@@ -2122,7 +2122,7 @@
           }
 
           template <class Derived>
- Derived& axis_plot_frame<Derived>::x_value_ioflags(int flags)
+ Derived& axis_plot_frame<Derived>::x_value_ioflags(std::ios_base::fmtflags flags)
           { /*! Set iostream std::ios::fmtflags for X value label (default decimal == 0X201).
               Mainly useful for changing to scientific, fixed or hexadecimal format.
               For example: .x_value_ioflags(std::ios::dec | std::ios::scientific)
@@ -2132,7 +2132,7 @@
           }
 
           template <class Derived>
- int axis_plot_frame<Derived>::x_value_ioflags()
+ std::ios_base::fmtflags axis_plot_frame<Derived>::x_value_ioflags()
           { //! \return stream ioflags for control of format of X value labels.
             return derived().x_ticks_.value_ioflags_;
           }
@@ -2162,7 +2162,7 @@
               Unicode symbols are at http://unicode.org/charts/symbols.html .
             */
             // Plot title. TODO
- // new text parent code pushback
+ // new text parent code push_back
             // effectively concatenates with any existing title.
             // So clear the existing string first but doesn't work,
             // so need to clear the whole g_element.
@@ -3755,8 +3755,8 @@
               throw std::runtime_error(message.str());
               //throw std::runtime_error("X range: max <= min!");
             }
- if( (abs(max_x - min_x) < std::numeric_limits<double>::epsilon() * 1000 * abs(max_x))
- || (abs(max_x - min_x) < std::numeric_limits<double>::epsilon() * 1000 * abs(min_x))
+ if( (std::abs<double>(max_x - min_x) < std::numeric_limits<double>::epsilon() * 1000 * std::abs<double>(max_x))
+ || (std::abs<double>(max_x - min_x) < std::numeric_limits<double>::epsilon() * 1000 * std::abs<double>(min_x))
               )
             { // Range too small to display.
               throw std::runtime_error("X range too small!" );

Modified: sandbox/SOC/2007/visualization/boost/svg_plot/show_1d_settings.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/show_1d_settings.hpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/show_1d_settings.hpp 2012-10-08 07:36:40 EDT (Mon, 08 Oct 2012)
@@ -71,9 +71,9 @@
      Default parameter values are: @c void outFmtFlags(fmtflags fmtFlags = cout.flags(), ostream& os = cerr, const char* term = ".\n");
    */
   const int up = 16; // Words across page.
- const int count = 16; // because using unsigned short int.
- int const flags = os.flags(); // save to restore.
- fmtFlags &= 0x7FFF; // _Fmtmask // clear un-used bits.
+ const int count = 16; // 16 because using unsigned short int (must be at least 16 bits).
+ std::ios_base::fmtflags flags = os.flags(); // Save to restore.
+ fmtFlags &= static_cast<std::ios_base::fmtflags>(0x7FFF); // _Fmtmask // clear un-used bits.
   os << "IOS format flags (" << std::showbase << std::hex << fmtFlags << std::dec << ")" ; // hex value.
   if (fmtFlags != 0)
   {
@@ -96,7 +96,7 @@
     }
   }
   os << term; // eg "\n" or ". "
- os.flags(flags); // Restore.
+ os.setf(flags); // Restore.
 } // outFmtFlags
 
 //namespace detail
@@ -169,7 +169,7 @@
   // std::ostream& operator<< (std::ostream&, const std::pair<double, double>&);
   // defined above.
 
- int iostate = cout.flags(); // Save to restore one exit.
+ std::ios_base::fmtflags flags = cout.flags(); // Save format flags to restore on exit.
   cout << dec << std::boolalpha << endl;
   cout << endl;
 
@@ -212,7 +212,7 @@
   cout << "license_reproduction " << plot.license_reproduction() << endl;
   cout << "license_distribution " << plot.license_distribution() << endl;
   cout << "license_attribution " << plot.license_attribution() << endl;
- cout << "license_commercialuse " << plot.license_commercialuse() << endl;
+ cout << "license_commercial_use " << plot.license_commercialuse() << endl;
   cout << "plot_background_color " << plot.plot_background_color() << endl;
   cout << "plot_border_color " << plot.plot_border_color() << endl;
   cout << "plot_border_width " << plot.plot_border_width() << endl;
@@ -310,7 +310,7 @@
   cout << "x_autoscale_check_limits " << plot.autoscale_check_limits() << endl;
   cout << "confidence alpha " << plot.confidence() << endl;
   cout << "data lines width " << plot.data_lines_width() << endl;
- cout.flags(iostate); // Restore.
+ cout.flags(flags); // Restore.
 } // void show_plot_settings(svg_1d_plot& plot)
 
 } // namespace svg

Modified: sandbox/SOC/2007/visualization/boost/svg_plot/show_2d_settings.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/show_2d_settings.hpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/show_2d_settings.hpp 2012-10-08 07:36:40 EDT (Mon, 08 Oct 2012)
@@ -323,7 +323,7 @@
 
   std::cout << "data lines width " << plot.data_lines_width() << std::endl;
 
- std::cout.flags(iostate); // Restore saved iostate.
+ std::cout.flags(iostate); // Restore saved format flags.
 } // void show_plot_settings(svg_2d_plot& plot)
 
 } // svg


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk