add std namespace prefix to common methods

Standard clib methods should be explicitly grabbed from the standard
namespace.

Change-Id: I8bcfcb260a99180d535ec8102c1a24c318cbc209
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/sensorhandler.cpp b/sensorhandler.cpp
index 369a1a7..9792299 100644
--- a/sensorhandler.cpp
+++ b/sensorhandler.cpp
@@ -11,6 +11,7 @@
 
 #include <bitset>
 #include <cmath>
+#include <cstring>
 #include <phosphor-logging/elog-errors.hpp>
 #include <phosphor-logging/log.hpp>
 #include <set>
@@ -99,8 +100,8 @@
     rc = get_bus_for_path(info.sensorPath.c_str(), &busname);
     if (rc < 0)
     {
-        fprintf(stderr, "Failed to get %s busname: %s\n",
-                info.sensorPath.c_str(), busname);
+        std::fprintf(stderr, "Failed to get %s busname: %s\n",
+                     info.sensorPath.c_str(), busname);
         goto final;
     }
 
@@ -134,16 +135,16 @@
     sd_bus_error error = SD_BUS_ERROR_NULL;
     sd_bus_message* m = NULL;
 
-    fprintf(ipmidbus,
-            "Attempting to set a dbus Variant Sensor 0x%02x via %s with a "
-            "value of %s\n",
-            number, method, value);
+    std::fprintf(ipmidbus,
+                 "Attempting to set a dbus Variant Sensor 0x%02x via %s with a "
+                 "value of %s\n",
+                 number, method, value);
 
     r = find_openbmc_path(number, &a);
 
     if (r < 0)
     {
-        fprintf(stderr, "Failed to find Sensor 0x%02x\n", number);
+        std::fprintf(stderr, "Failed to find Sensor 0x%02x\n", number);
         return 0;
     }
 
@@ -151,21 +152,23 @@
                                        method);
     if (r < 0)
     {
-        fprintf(stderr, "Failed to create a method call: %s", strerror(-r));
+        std::fprintf(stderr, "Failed to create a method call: %s",
+                     strerror(-r));
         goto final;
     }
 
     r = sd_bus_message_append(m, "v", "s", value);
     if (r < 0)
     {
-        fprintf(stderr, "Failed to create a input parameter: %s", strerror(-r));
+        std::fprintf(stderr, "Failed to create a input parameter: %s",
+                     strerror(-r));
         goto final;
     }
 
     r = sd_bus_call(bus, m, 0, &error, NULL);
     if (r < 0)
     {
-        fprintf(stderr, "Failed to call the method: %s", strerror(-r));
+        std::fprintf(stderr, "Failed to call the method: %s", strerror(-r));
     }
 
 final:
@@ -183,16 +186,16 @@
     sd_bus_error error = SD_BUS_ERROR_NULL;
     sd_bus_message* m = NULL;
 
-    fprintf(ipmidbus,
-            "Attempting to set a dbus Variant Sensor 0x%02x via %s with a "
-            "value of 0x%02x\n",
-            number, method, value);
+    std::fprintf(ipmidbus,
+                 "Attempting to set a dbus Variant Sensor 0x%02x via %s with a "
+                 "value of 0x%02x\n",
+                 number, method, value);
 
     r = find_openbmc_path(number, &a);
 
     if (r < 0)
     {
-        fprintf(stderr, "Failed to find Sensor 0x%02x\n", number);
+        std::fprintf(stderr, "Failed to find Sensor 0x%02x\n", number);
         return 0;
     }
 
@@ -200,21 +203,23 @@
                                        method);
     if (r < 0)
     {
-        fprintf(stderr, "Failed to create a method call: %s", strerror(-r));
+        std::fprintf(stderr, "Failed to create a method call: %s",
+                     strerror(-r));
         goto final;
     }
 
     r = sd_bus_message_append(m, "v", "i", value);
     if (r < 0)
     {
-        fprintf(stderr, "Failed to create a input parameter: %s", strerror(-r));
+        std::fprintf(stderr, "Failed to create a input parameter: %s",
+                     strerror(-r));
         goto final;
     }
 
     r = sd_bus_call(bus, m, 0, &error, NULL);
     if (r < 0)
     {
-        fprintf(stderr, "12 Failed to call the method: %s", strerror(-r));
+        std::fprintf(stderr, "12 Failed to call the method: %s", strerror(-r));
     }
 
 final:
@@ -282,7 +287,7 @@
     r = find_openbmc_path(num, &dbus_if);
     if (r < 0)
     {
-        fprintf(stderr, "Could not find sensor %d\n", num);
+        std::fprintf(stderr, "Could not find sensor %d\n", num);
         return 0;
     }
     return get_type_from_interface(dbus_if);
@@ -312,7 +317,7 @@
     }
 
     *data_len = sizeof(buf);
-    memcpy(response, &buf, *data_len);
+    std::memcpy(response, &buf, *data_len);
 
     return rc;
 }
@@ -416,14 +421,14 @@
     {
         getResponse = iter->second.getFunc(iter->second);
         *data_len = getResponse.size();
-        memcpy(resp, getResponse.data(), *data_len);
+        std::memcpy(resp, getResponse.data(), *data_len);
         resp->operation = 1 << scanningEnabledBit;
         return IPMI_CC_OK;
     }
     catch (const std::exception& e)
     {
         *data_len = getResponse.size();
-        memcpy(resp, getResponse.data(), *data_len);
+        std::memcpy(resp, getResponse.data(), *data_len);
         return IPMI_CC_OK;
     }
 }
@@ -639,8 +644,8 @@
                 break;
             default:
                 // Cannot be hit.
-                fprintf(stderr, "Unknown value unit type: = %s\n",
-                        info->unit.c_str());
+                std::fprintf(stderr, "Unknown value unit type: = %s\n",
+                             info->unit.c_str());
         }
     }
     catch (sdbusplus::exception::InvalidEnumString e)
@@ -766,8 +771,9 @@
         return IPMI_CC_REQ_DATA_LEN_INVALID;
     }
 
-    memcpy(resp->record_data, reinterpret_cast<uint8_t*>(&record) + req->offset,
-           (dataLength));
+    std::memcpy(resp->record_data,
+                reinterpret_cast<uint8_t*>(&record) + req->offset,
+                (dataLength));
 
     *data_len = dataLength;
     *data_len += 2; // additional 2 bytes for next record ID
@@ -848,8 +854,8 @@
         }
 
         *data_len = sizeof(get_sdr::GetSdrResp) - req->offset;
-        memcpy(resp->record_data, (char*)&record + req->offset,
-               sizeof(get_sdr::SensorDataFullRecord) - req->offset);
+        std::memcpy(resp->record_data, (char*)&record + req->offset,
+                    sizeof(get_sdr::SensorDataFullRecord) - req->offset);
     }
 
     return ret;