From e17800c5ab21f95a7f3db1f58ec42a8c7338a137 Mon Sep 17 00:00:00 2001 From: Oleksiy Vyalov Date: Fri, 10 Apr 2015 03:59:52 +0000 Subject: [PATCH] Remove 'z' modifier from printf/sscanf operations in AdbClient - the modifier isn't supported by MS C++ compiler. llvm-svn: 234562 --- lldb/source/Plugins/Platform/Android/AdbClient.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lldb/source/Plugins/Platform/Android/AdbClient.cpp b/lldb/source/Plugins/Platform/Android/AdbClient.cpp index f9540650a6e5..36f8eadc2d0f 100644 --- a/lldb/source/Plugins/Platform/Android/AdbClient.cpp +++ b/lldb/source/Plugins/Platform/Android/AdbClient.cpp @@ -49,7 +49,7 @@ AdbClient::CreateByDeviceID (const char* device_id, AdbClient &adb) else { if (connect_devices.size () != 1) - return Error ("Expected a single connected device, got instead %zu", connect_devices.size ()); + return Error ("Expected a single connected device, got instead %" PRIu64, static_cast(connect_devices.size ())); adb.SetDeviceID (connect_devices.front ()); } @@ -142,7 +142,7 @@ AdbClient::SendMessage (const std::string &packet) return error; char length_buffer[5]; - snprintf (length_buffer, sizeof (length_buffer), "%04zx", packet.size ()); + snprintf (length_buffer, sizeof (length_buffer), "%04x", static_cast(packet.size ())); ConnectionStatus status; @@ -177,8 +177,8 @@ AdbClient::ReadMessage (std::string &message) if (error.Fail ()) return error; - size_t packet_len = 0; - sscanf (buffer, "%zx", &packet_len); + int packet_len = 0; + sscanf (buffer, "%x", &packet_len); std::string result (packet_len, 0); m_conn.Read (&result[0], packet_len, kConnTimeout, status, &error); if (error.Success ()) @@ -200,7 +200,7 @@ AdbClient::ReadResponseStatus() m_conn.Read (buffer, packet_len, kConnTimeout, status, &error); if (error.Fail ()) - return error; + return error; if (strncmp (buffer, kOKAY, packet_len) != 0) {