Bug 1220544 - Fix -Wunreachable-code warnings in xpcom. r=mccr8

xpcom/glue/PLDHashTable.cpp:471:10 [-Wunreachable-code-return] 'return' will never be executed
xpcom/tests/TestAutoPtr.cpp:324:9 [-Wunreachable-code] code will never be executed
xpcom/tests/TestBlockingProcess.cpp:6:11 [-Wunreachable-code-return] 'return' will never be executed
This commit is contained in:
Chris Peterson 2015-11-02 21:03:03 -08:00
parent d30d4ac16e
commit 5854131a01
3 changed files with 5 additions and 8 deletions

View File

@ -468,7 +468,6 @@ PLDHashTable::FindFreeEntry(PLDHashNumber aKeyHash)
}
// NOTREACHED
return nullptr;
}
bool
@ -846,4 +845,3 @@ PLDHashTable::MarkImmutable()
mChecker.SetNonWritable();
}
#endif

View File

@ -319,8 +319,10 @@ int main()
printf("\nTesting casts and equality tests.\n");
if ((void*)(TestObject*)0x1000 ==
(void*)(TestObjectBaseB*)(TestObject*)0x1000)
// This comparison is always false, as it should be. The extra parens
// suppress a -Wunreachable-code warning about printf being unreachable.
if (((void*)(TestObject*)0x1000) ==
((void*)(TestObjectBaseB*)(TestObject*)0x1000))
printf("\n\nAll these tests are meaningless!\n\n\n");
{
@ -395,7 +397,6 @@ int main()
printf("Should destroy one |TestRefObject|:\n");
}
printf("\nTesting construction.\n");
{

View File

@ -1,8 +1,6 @@
#include <prthread.h>
int main()
{
while(1) PR_Sleep(PR_SecondsToInterval(10));
return 0;
}