Skip to content

Commit daf8e77

Browse files
Fix miscellaneous compiler warnings
Reviewed by Darin Adler. * Source/JavaScriptCore/assembler/testmasm.cpp: (JSC::testExtractUnsignedBitfield32): fixed comparison of unsigned expression in ‘>= 0’ is always true * Source/WTF/wtf/text/StringCommon.h: (WTF::find): fixed comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ * Source/JavaScriptCore/runtime/ArrayBufferView.cpp: (JSC::ArrayBufferView::visitDerived): fixed control reaches end of non-void function Canonical link: https://commits.webkit.org/255360@main
1 parent 69059cf commit daf8e77

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎Source/JavaScriptCore/assembler/testmasm.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1302,7 +1302,7 @@ void testExtractUnsignedBitfield32()
13021302
Vector<uint32_t> imms = { 0, 1, 5, 7, 30, 31, 32, 42, 56, 62, 63, 64 };
13031303
for (auto lsb : imms) {
13041304
for (auto width : imms) {
1305-
if (lsb >= 0 && width > 0 && lsb + width < 32) {
1305+
if (width > 0 && lsb + width < 32) {
13061306
auto ubfx32 = compile([=] (CCallHelpers& jit) {
13071307
emitFunctionPrologue(jit);
13081308

‎Source/JavaScriptCore/runtime/ArrayBufferView.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ template<typename Visitor> constexpr decltype(auto) ArrayBufferView::visitDerive
5656
FOR_EACH_TYPED_ARRAY_TYPE_EXCLUDING_DATA_VIEW(DECLARE_TYPED_ARRAY_TYPE)
5757
#undef DECLARE_TYPED_ARRAY_TYPE
5858
}
59-
ASSERT_NOT_REACHED();
59+
RELEASE_ASSERT_NOT_REACHED();
6060
}
6161

6262
template<typename Visitor> constexpr decltype(auto) ArrayBufferView::visitDerived(Visitor&& visitor) const

‎Source/WTF/wtf/text/StringCommon.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ inline size_t find(const CharacterType* characters, unsigned length, CharacterTy
686686
if (index >= length)
687687
return notFound;
688688
auto* result = reinterpret_cast<const CharacterType*>(find8(bitwise_cast<const uint8_t*>(characters + index), matchCharacter, length - index));
689-
ASSERT(!result || (result - characters) >= index);
689+
ASSERT(!result || static_cast<unsigned>(result - characters) >= index);
690690
if (result)
691691
return result - characters;
692692
return notFound;
@@ -696,7 +696,7 @@ inline size_t find(const CharacterType* characters, unsigned length, CharacterTy
696696
if (index >= length)
697697
return notFound;
698698
auto* result = reinterpret_cast<const CharacterType*>(find16(bitwise_cast<const uint16_t*>(characters + index), matchCharacter, length - index));
699-
ASSERT(!result || (result - characters) >= index);
699+
ASSERT(!result || static_cast<unsigned>(result - characters) >= index);
700700
if (result)
701701
return result - characters;
702702
return notFound;

0 commit comments

Comments
 (0)