Support reading 64 bit integers

Some sysfs *_input values may be bigger than 32 bits,
for example power values reported in microwatts.  As such,
read an int64_t value out of sysfs instead of just a uint32_t.
The D-Bus property that will hold the value is also the same
type, an int64_t.

Resolves openbmc/openbmc#2686

Change-Id: I4376de120825b73580d18d339fe76be454eeb18d
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/mainloop.cpp b/mainloop.cpp
index 61de673..2aa9e0f 100644
--- a/mainloop.cpp
+++ b/mainloop.cpp
@@ -154,7 +154,7 @@
     return true;
 }
 
-int adjustValue(const SensorSet::key_type& sensor, int value)
+int64_t adjustValue(const SensorSet::key_type& sensor, int64_t value)
 {
     const auto& it = sensorAdjusts.find(sensor);
     if (it != sensorAdjusts.end())
@@ -179,7 +179,7 @@
     auto& obj = std::get<Object>(info);
     auto& objPath = std::get<std::string>(info);
 
-    auto val = 0;
+    int64_t val = 0;
     try
     {
         // Retry for up to a second if device is busy
@@ -405,7 +405,7 @@
             if (attrs.find(hwmon::entry::input) != attrs.end())
             {
                 // Read value from sensor.
-                int value;
+                int64_t value;
                 try
                 {
                     // Retry for up to a second if device is busy
diff --git a/sysfs.cpp b/sysfs.cpp
index 8b7ee48..aeee859 100644
--- a/sysfs.cpp
+++ b/sysfs.cpp
@@ -254,14 +254,14 @@
 
 }
 
-uint32_t HwmonIO::read(
+int64_t HwmonIO::read(
         const std::string& type,
         const std::string& id,
         const std::string& sensor,
         size_t retries,
         std::chrono::milliseconds delay) const
 {
-    uint32_t val;
+    int64_t val;
     std::ifstream ifs;
     auto fullPath = sysfs::make_sysfs_path(
             p, type, id, sensor);
diff --git a/sysfs.hpp b/sysfs.hpp
index a203a8c..e3090c3 100644
--- a/sysfs.hpp
+++ b/sysfs.hpp
@@ -107,7 +107,7 @@
          *
          *  @return val - The read value.
          */
-        uint32_t read(
+        int64_t read(
                 const std::string& type,
                 const std::string& id,
                 const std::string& sensor,