[Xfce4-commits] [panel-plugins/xfce4-hardware-monitor-plugin] 01/01: Fiddle with '>>' use in container declarations for older compilers Turns out that '>>', e.g. in:

noreply at xfce.org noreply at xfce.org
Mon Jul 4 16:30:00 CEST 2016


This is an automated email from the git hooks/post-receive script.

omegaphil pushed a commit to branch omegaphil/graph-disk-io
in repository panel-plugins/xfce4-hardware-monitor-plugin.

commit 154cb0593d7d7711a4c945564848b3e4a3a4118f
Author: OmegaPhil <OmegaPhil at startmail.com>
Date:   Mon Jul 4 15:17:26 2016 +0100

    Fiddle with '>>' use in container declarations for older compilers
    Turns out that '>>', e.g. in:
    
      std::map<Glib::ustring, std::vector<unsigned long int>> disk_stats =
            parse_disk_stats();
    
    Is only allowed in C++11, due to '>>' being a separate operator.
    
    Discovered by Sal Tepedino
---
 src/monitor-impls.cpp | 14 +++++++-------
 src/monitor-impls.hpp |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/monitor-impls.cpp b/src/monitor-impls.cpp
index 5c4e286..54053b1 100644
--- a/src/monitor-impls.cpp
+++ b/src/monitor-impls.cpp
@@ -789,9 +789,9 @@ double DiskStatsMonitor::do_measure()
 
   /* Returning 0 if device is not available - this is not an error since the
    * device may be hotpluggable */
-  std::map<Glib::ustring, std::vector<unsigned long int>> disk_stats =
+  std::map<Glib::ustring, std::vector<unsigned long int> > disk_stats =
       parse_disk_stats();
-  std::map<Glib::ustring, std::vector<unsigned long int>>::iterator it =
+  std::map<Glib::ustring, std::vector<unsigned long int> >::iterator it =
       disk_stats.find(device_name);
   if (it == disk_stats.end())
   {
@@ -887,7 +887,7 @@ void DiskStatsMonitor::save(XfceRc *settings_w)
   xfce_rc_write_entry(settings_w, "tag", tag.c_str());
 }
 
-std::map<Glib::ustring, std::vector<unsigned long int>>
+std::map<Glib::ustring, std::vector<unsigned long int> >
 DiskStatsMonitor::parse_disk_stats()
 {
   Glib::ustring device_stats;
@@ -902,7 +902,7 @@ DiskStatsMonitor::parse_disk_stats()
     std::cerr << Glib::ustring::compose(_("Unable to parse disk stats from '%1' "
                                           "due to error '%2'\n"),
                                         "/proc/diskstats", e.what());
-    return std::map<Glib::ustring, std::vector<unsigned long int>>();
+    return std::map<Glib::ustring, std::vector<unsigned long int> >();
   }
 
   /* Preparing regex to use in splitting out stats
@@ -914,7 +914,7 @@ DiskStatsMonitor::parse_disk_stats()
         Glib::REGEX_OPTIMIZE);
 
   // Splitting out stats into devices
-  std::map<Glib::ustring, std::vector<unsigned long int>> parsed_stats;
+  std::map<Glib::ustring, std::vector<unsigned long int> > parsed_stats;
   std::stringstream device_stats_stream(device_stats);
   Glib::ustring device_name, single_dev_stats;
   Glib::MatchInfo match_info;
@@ -979,12 +979,12 @@ DiskStatsMonitor::parse_disk_stats()
 std::vector<Glib::ustring> DiskStatsMonitor::current_device_names()
 {
   // Fetching current disk stats
-  std::map<Glib::ustring, std::vector<unsigned long int>> parsed_stats =
+  std::map<Glib::ustring, std::vector<unsigned long int> > parsed_stats =
       parse_disk_stats();
 
   // Generating sorted list of available devices
   std::vector<Glib::ustring> devices_list;
-  for (std::map<Glib::ustring, std::vector<unsigned long int>>::iterator it
+  for (std::map<Glib::ustring, std::vector<unsigned long int> >::iterator it
        = parsed_stats.begin(); it != parsed_stats.end(); ++it)
   {
     devices_list.push_back(it->first);
diff --git a/src/monitor-impls.hpp b/src/monitor-impls.hpp
index c36fd70..386a958 100644
--- a/src/monitor-impls.hpp
+++ b/src/monitor-impls.hpp
@@ -205,7 +205,7 @@ private:
 
   /* Reads the diskstats file and returns a vector of each device, containing a
    * vector of reported stats. Note that unordered_map is C++11 */
-  static std::map<Glib::ustring, std::vector<unsigned long int>> parse_disk_stats();
+  static std::map<Glib::ustring, std::vector<unsigned long int> > parse_disk_stats();
 
   guint64 max_value;
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list