[glom/glom-1-28] C++98: Replace uses of auto.



commit e635c1565416e340099ee26afd9453b7c575dc65
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Apr 8 10:22:29 2016 +0200

    C++98: Replace uses of auto.
    
    This code was git cherry-picked from master, which uses C++11.

 glom/libglom/data_structure/glomconversions.cc |    2 +-
 glom/utils_ui.cc                               |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/glom/libglom/data_structure/glomconversions.cc b/glom/libglom/data_structure/glomconversions.cc
index 7a5bb97..48ca0fc 100644
--- a/glom/libglom/data_structure/glomconversions.cc
+++ b/glom/libglom/data_structure/glomconversions.cc
@@ -499,7 +499,7 @@ Glib::ustring Conversions::get_text_for_gda_value(Field::glom_field_type glom_ty
     std::stringstream another_stream;
     another_stream.imbue(locale); //Tell it to parse stuff as per this locale.
 
-    constexpr auto precision = std::numeric_limits<decltype(number)>::max_digits10;
+    const int precision = 10; //arbitrary default until we can use C++11: 
std::numeric_limits<decltype(number)>::max_digits10;
     another_stream << std::setprecision(precision);
 
     //Numeric formatting:
diff --git a/glom/utils_ui.cc b/glom/utils_ui.cc
index 024dd4c..e46c87d 100644
--- a/glom/utils_ui.cc
+++ b/glom/utils_ui.cc
@@ -108,7 +108,7 @@ void UiUtils::show_help(Gtk::Window* parent_window, const Glib::ustring& id)
   }
   catch(const std::exception& ex)
   {
-    const auto message = Glib::ustring::compose(_("Could not display help: %1"), Glib::ustring(ex.what()));
+    const Glib::ustring message = Glib::ustring::compose(_("Could not display help: %1"), 
Glib::ustring(ex.what()));
     Gtk::MessageDialog dialog(message, false, Gtk::MESSAGE_ERROR);
     dialog.run();
   }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]