[Lldb-commits] [lldb] r304796 - Fix assorted compiler warnings. NFC

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 6 07:06:22 PDT 2017


Author: labath
Date: Tue Jun  6 09:06:22 2017
New Revision: 304796

URL: http://llvm.org/viewvc/llvm-project?rev=304796&view=rev
Log:
Fix assorted compiler warnings. NFC

Modified:
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
    lldb/trunk/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp

Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp?rev=304796&r1=304795&r2=304796&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp Tue Jun  6 09:06:22 2017
@@ -171,6 +171,7 @@ UtilityFunction *AppleObjCRuntimeV1::Cre
                   "           \n",
                   name);
   assert(strformatsize < (int)sizeof(buf->contents));
+  (void)strformatsize;
 
   Status error;
   return GetTargetRef().GetUtilityFunctionForLanguage(

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp?rev=304796&r1=304795&r2=304796&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp Tue Jun  6 09:06:22 2017
@@ -3732,8 +3732,8 @@ static DWARFDIE GetContainingFunctionWit
       }
     }
   }
-  assert(!"Shouldn't call GetContainingFunctionWithAbstractOrigin on something "
-          "not in a function");
+  assert(0 && "Shouldn't call GetContainingFunctionWithAbstractOrigin on "
+              "something not in a function");
   return DWARFDIE();
 }
 

Modified: lldb/trunk/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp?rev=304796&r1=304795&r2=304796&view=diff
==============================================================================
--- lldb/trunk/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp (original)
+++ lldb/trunk/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp Tue Jun  6 09:06:22 2017
@@ -404,7 +404,7 @@ TEST_F(GDBRemoteCommunicationClientTest,
       R"( {"psb" : 1,"tracetech" : "intel-pt"},"threadid" : 35,"type" : 1})";
   HandlePacket(server, (expected_packet1 + expected_packet2), "1");
   ASSERT_TRUE(error.Success());
-  ASSERT_EQ(result.get(), 1);
+  ASSERT_EQ(result.get(), 1u);
 
   error.Clear();
   result = std::async(std::launch::async, [&] {
@@ -466,7 +466,7 @@ TEST_F(GDBRemoteCommunicationClientTest,
   std::string expected_packet2 = R"("traceid" : 3})";
   HandlePacket(server, expected_packet1+expected_packet2, "123456");
   ASSERT_TRUE(result.get().Success());
-  ASSERT_EQ(buffer.size(), 3);
+  ASSERT_EQ(buffer.size(), 3u);
   ASSERT_EQ(buf[0], 0x12);
   ASSERT_EQ(buf[1], 0x34);
   ASSERT_EQ(buf[2], 0x56);
@@ -478,7 +478,7 @@ TEST_F(GDBRemoteCommunicationClientTest,
 
   HandlePacket(server, expected_packet1+expected_packet2, "E23");
   ASSERT_FALSE(result.get().Success());
-  ASSERT_EQ(buffer2.size(), 0);
+  ASSERT_EQ(buffer2.size(), 0u);
 }
 
 TEST_F(GDBRemoteCommunicationClientTest, SendGetMetaDataPacket) {
@@ -504,7 +504,7 @@ TEST_F(GDBRemoteCommunicationClientTest,
   std::string expected_packet2 = R"("traceid" : 3})";
   HandlePacket(server, expected_packet1+expected_packet2, "123456");
   ASSERT_TRUE(result.get().Success());
-  ASSERT_EQ(buffer.size(), 3);
+  ASSERT_EQ(buffer.size(), 3u);
   ASSERT_EQ(buf[0], 0x12);
   ASSERT_EQ(buf[1], 0x34);
   ASSERT_EQ(buf[2], 0x56);
@@ -516,7 +516,7 @@ TEST_F(GDBRemoteCommunicationClientTest,
 
   HandlePacket(server, expected_packet1+expected_packet2, "E23");
   ASSERT_FALSE(result.get().Success());
-  ASSERT_EQ(buffer2.size(), 0);
+  ASSERT_EQ(buffer2.size(), 0u);
 }
 
 TEST_F(GDBRemoteCommunicationClientTest, SendGetTraceConfigPacket) {
@@ -543,8 +543,8 @@ TEST_F(GDBRemoteCommunicationClientTest,
       R"(],"metabuffersize" : 8192,"threadid" : 35,"type" : 1}])";
   HandlePacket(server, expected_packet, response1+response2);
   ASSERT_TRUE(result.get().Success());
-  ASSERT_EQ(options.getTraceBufferSize(), 8192);
-  ASSERT_EQ(options.getMetaDataBufferSize(), 8192);
+  ASSERT_EQ(options.getTraceBufferSize(), 8192u);
+  ASSERT_EQ(options.getMetaDataBufferSize(), 8192u);
   ASSERT_EQ(options.getType(), 1);
 
   auto custom_params = options.getTraceParams();
@@ -554,9 +554,8 @@ TEST_F(GDBRemoteCommunicationClientTest,
 
   ASSERT_TRUE(custom_params);
   ASSERT_EQ(custom_params->GetType(), eStructuredDataTypeDictionary);
-  ASSERT_TRUE(
-      custom_params->GetValueForKeyAsInteger<uint64_t>("psb", psb_value));
-  ASSERT_EQ(psb_value, 1);
+  ASSERT_TRUE(custom_params->GetValueForKeyAsInteger("psb", psb_value));
+  ASSERT_EQ(psb_value, 1u);
   ASSERT_TRUE(
       custom_params->GetValueForKeyAsString("tracetech", trace_tech_value));
   ASSERT_STREQ(trace_tech_value.data(), "intel-pt");




More information about the lldb-commits mailing list