Changeset 261393 in webkit
- Timestamp:
- May 8, 2020 10:31:54 AM (4 years ago)
- Location:
- trunk/Source/WTF
- Files:
-
- 40 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r261386 r261393 1 2020-05-08 Don Olmstead <don.olmstead@sony.com> 2 3 [clang-tidy] Run modernize-use-nullptr over WTF 4 https://bugs.webkit.org/show_bug.cgi?id=211628 5 6 Reviewed by Yusuke Suzuki. 7 8 Use the fix option in clang-tidy to ensure nullptr is being used across WTF. 9 10 * wtf/Assertions.cpp: 11 * wtf/BumpPointerAllocator.h: 12 (WTF::BumpPointerPool::BumpPointerPool): 13 (WTF::BumpPointerPool::create): 14 (WTF::BumpPointerAllocator::BumpPointerAllocator): 15 * wtf/DataLog.cpp: 16 (WTF::setDataFile): 17 * wtf/DateMath.cpp: 18 (WTF::parseES5DatePortion): 19 (WTF::parseES5TimePortion): 20 * wtf/FastMalloc.cpp: 21 (WTF::fastZeroedMalloc): 22 (WTF::fastStrDup): 23 (WTF::tryFastZeroedMalloc): 24 (WTF::isFastMallocEnabled): 25 (WTF::fastMallocGoodSize): 26 (WTF::fastAlignedMalloc): 27 (WTF::tryFastAlignedMalloc): 28 (WTF::fastAlignedFree): 29 (WTF::tryFastMalloc): 30 (WTF::fastMalloc): 31 (WTF::tryFastCalloc): 32 (WTF::fastCalloc): 33 (WTF::fastFree): 34 (WTF::fastRealloc): 35 (WTF::tryFastRealloc): 36 (WTF::releaseFastMallocFreeMemory): 37 (WTF::releaseFastMallocFreeMemoryForThisThread): 38 (WTF::fastMallocStatistics): 39 (WTF::fastMallocSize): 40 (WTF::fastCommitAlignedMemory): 41 (WTF::fastDecommitAlignedMemory): 42 (WTF::fastEnableMiniMode): 43 (WTF::fastDisableScavenger): 44 (WTF::fastMallocDumpMallocStats): 45 (WTF::AvoidRecordingScope::avoidRecordingCount): 46 (WTF::AvoidRecordingScope::AvoidRecordingScope): 47 (WTF::AvoidRecordingScope::~AvoidRecordingScope): 48 (WTF::MallocCallTracker::MallocSiteData::MallocSiteData): 49 (WTF::MallocCallTracker::singleton): 50 (WTF::MallocCallTracker::MallocCallTracker): 51 (WTF::MallocCallTracker::recordMalloc): 52 (WTF::MallocCallTracker::recordRealloc): 53 (WTF::MallocCallTracker::recordFree): 54 (WTF::MallocCallTracker::dumpStats): 55 * wtf/HashTable.h: 56 (WTF::KeyTraits>::inlineLookup): 57 (WTF::KeyTraits>::lookupForWriting): 58 (WTF::KeyTraits>::fullLookupForWriting): 59 (WTF::KeyTraits>::add): 60 * wtf/MetaAllocator.cpp: 61 (WTF::MetaAllocator::findAndRemoveFreeSpace): 62 * wtf/ParallelJobsGeneric.cpp: 63 * wtf/RandomDevice.cpp: 64 (WTF::RandomDevice::cryptographicallyRandomValues): 65 * wtf/RawPointer.h: 66 (WTF::RawPointer::RawPointer): 67 * wtf/RedBlackTree.h: 68 * wtf/SHA1.cpp: 69 (WTF::SHA1::hexDigest): 70 * wtf/SchedulePair.h: 71 (WTF::SchedulePair::SchedulePair): 72 * wtf/StackTrace.cpp: 73 (WTFGetBacktrace): 74 (WTF::StackTrace::dump const): 75 * wtf/StringExtras.h: 76 (strnstr): 77 * wtf/Variant.h: 78 * wtf/Vector.h: 79 (WTF::VectorBufferBase::deallocateBuffer): 80 (WTF::VectorBufferBase::releaseBuffer): 81 (WTF::VectorBufferBase::VectorBufferBase): 82 * wtf/cf/CFURLExtras.cpp: 83 (WTF::createCFURLFromBuffer): 84 (WTF::getURLBytes): 85 * wtf/cf/CFURLExtras.h: 86 * wtf/cf/FileSystemCF.cpp: 87 (WTF::FileSystem::pathAsURL): 88 * wtf/dtoa/double-conversion.cc: 89 * wtf/dtoa/utils.h: 90 (WTF::double_conversion::BufferReference::BufferReference): 91 * wtf/text/CString.cpp: 92 (WTF::CString::mutableData): 93 * wtf/text/CString.h: 94 * wtf/text/StringBuffer.h: 95 (WTF::StringBuffer::release): 96 * wtf/text/StringImpl.cpp: 97 (WTF::StringImpl::createUninitializedInternal): 98 (WTF::StringImpl::reallocateInternal): 99 * wtf/text/StringImpl.h: 100 (WTF::StringImpl::constructInternal<LChar>): 101 (WTF::StringImpl::constructInternal<UChar>): 102 (WTF::StringImpl::characters<LChar> const): 103 (WTF::StringImpl::characters<UChar> const): 104 (WTF::find): 105 (WTF::reverseFindLineTerminator): 106 (WTF::reverseFind): 107 (WTF::equalIgnoringNullity): 108 (WTF::codePointCompare): 109 (WTF::isSpaceOrNewline): 110 (WTF::lengthOfNullTerminatedString): 111 (WTF::StringImplShape::StringImplShape): 112 (WTF::StringImpl::isolatedCopy const): 113 (WTF::StringImpl::isAllASCII const): 114 (WTF::StringImpl::isAllLatin1 const): 115 (WTF::isAllSpecialCharacters): 116 (WTF::isSpecialCharacter const): 117 (WTF::StringImpl::StringImpl): 118 (WTF::StringImpl::create8BitIfPossible): 119 (WTF::StringImpl::createSubstringSharingImpl): 120 (WTF::StringImpl::createFromLiteral): 121 (WTF::StringImpl::tryCreateUninitialized): 122 (WTF::StringImpl::adopt): 123 (WTF::StringImpl::cost const): 124 (WTF::StringImpl::costDuringGC): 125 (WTF::StringImpl::setIsAtom): 126 (WTF::StringImpl::setHash const): 127 (WTF::StringImpl::ref): 128 (WTF::StringImpl::deref): 129 (WTF::StringImpl::copyCharacters): 130 (WTF::StringImpl::at const): 131 (WTF::StringImpl::allocationSize): 132 (WTF::StringImpl::maxInternalLength): 133 (WTF::StringImpl::tailOffset): 134 (WTF::StringImpl::requiresCopy const): 135 (WTF::StringImpl::tailPointer const): 136 (WTF::StringImpl::tailPointer): 137 (WTF::StringImpl::substringBuffer const): 138 (WTF::StringImpl::substringBuffer): 139 (WTF::StringImpl::assertHashIsCorrect const): 140 (WTF::StringImpl::StaticStringImpl::StaticStringImpl): 141 (WTF::StringImpl::StaticStringImpl::operator StringImpl&): 142 (WTF::equalIgnoringASCIICase): 143 (WTF::startsWithLettersIgnoringASCIICase): 144 (WTF::equalLettersIgnoringASCIICase): 145 * wtf/text/TextBreakIterator.cpp: 146 (WTF::initializeIterator): 147 (WTF::setContextAwareTextForIterator): 148 (WTF::openLineBreakIterator): 149 * wtf/text/TextBreakIterator.h: 150 (WTF::LazyLineBreakIterator::get): 151 * wtf/text/WTFString.cpp: 152 (WTF::charactersToFloat): 153 * wtf/text/cf/StringImplCF.cpp: 154 (WTF::StringWrapperCFAllocator::allocate): 155 (WTF::StringWrapperCFAllocator::create): 156 (WTF::StringImpl::createCFString): 157 * wtf/text/icu/UTextProviderLatin1.cpp: 158 (WTF::uTextLatin1Clone): 159 (WTF::openLatin1ContextAwareUTextProvider): 160 * wtf/text/icu/UTextProviderUTF16.cpp: 161 (WTF::openUTF16ContextAwareUTextProvider): 162 * wtf/win/FileSystemWin.cpp: 163 (WTF::FileSystemImpl::makeAllDirectories): 164 (WTF::FileSystemImpl::storageDirectory): 165 (WTF::FileSystemImpl::openTemporaryFile): 166 (WTF::FileSystemImpl::openFile): 167 (WTF::FileSystemImpl::writeToFile): 168 (WTF::FileSystemImpl::readFromFile): 169 (WTF::FileSystemImpl::deleteNonEmptyDirectory): 170 * wtf/win/LanguageWin.cpp: 171 (WTF::localeInfo): 172 * wtf/win/MainThreadWin.cpp: 173 (WTF::initializeMainThreadPlatform): 174 * wtf/win/OSAllocatorWin.cpp: 175 (WTF::OSAllocator::reserveUncommitted): 176 (WTF::OSAllocator::reserveAndCommit): 177 * wtf/win/RunLoopWin.cpp: 178 (WTF::RunLoop::run): 179 (WTF::RunLoop::iterate): 180 (WTF::RunLoop::RunLoop): 181 (WTF::RunLoop::cycle): 182 (WTF::RunLoop::TimerBase::start): 183 * wtf/win/ThreadingWin.cpp: 184 (WTF::Thread::establishHandle): 185 1 186 2020-05-08 Darin Adler <darin@apple.com> 2 187 -
trunk/Source/WTF/wtf/Assertions.cpp
r258547 r261393 312 312 __builtin_trap(); 313 313 #else 314 ((void(*)()) 0)();314 ((void(*)())nullptr)(); 315 315 #endif // COMPILER(GCC_COMPATIBLE) 316 316 #endif // ASAN_ENABLED … … 517 517 } 518 518 519 return 0;519 return nullptr; 520 520 } 521 521 -
trunk/Source/WTF/wtf/BumpPointerAllocator.h
r253061 r261393 100 100 : m_current(allocation.base()) 101 101 , m_start(allocation.base()) 102 , m_next( 0)103 , m_previous( 0)102 , m_next(nullptr) 103 , m_previous(nullptr) 104 104 , m_allocation(allocation) 105 105 { … … 111 111 minimumCapacity += sizeof(BumpPointerPool); 112 112 if (minimumCapacity < sizeof(BumpPointerPool)) 113 return 0;113 return nullptr; 114 114 115 115 size_t poolSize = std::max(static_cast<size_t>(MINIMUM_BUMP_POOL_SIZE), WTF::pageSize()); … … 119 119 ASSERT(!(MINIMUM_BUMP_POOL_SIZE & (MINIMUM_BUMP_POOL_SIZE - 1))); 120 120 if (!poolSize) 121 return 0;121 return nullptr; 122 122 } 123 123 … … 125 125 if (!!allocation) 126 126 return new (allocation) BumpPointerPool(allocation); 127 return 0;127 return nullptr; 128 128 } 129 129 … … 223 223 public: 224 224 BumpPointerAllocator() 225 : m_head( 0)225 : m_head(nullptr) 226 226 { 227 227 } -
trunk/Source/WTF/wtf/DataLog.cpp
r259400 r261393 157 157 } 158 158 159 setvbuf(file->file(), 0, _IONBF, 0); // Prefer unbuffered output, so that we get a full log upon crash or deadlock.159 setvbuf(file->file(), nullptr, _IONBF, 0); // Prefer unbuffered output, so that we get a full log upon crash or deadlock. 160 160 161 161 if (s_file) -
trunk/Source/WTF/wtf/DateMath.cpp
r254939 r261393 491 491 // it accepts any integer value. Consider this an implementation fallback. 492 492 if (!parseInt(currentPosition, &postParsePosition, 10, &year)) 493 return 0;493 return nullptr; 494 494 495 495 // Check for presence of -MM portion. … … 499 499 500 500 if (!isASCIIDigit(*currentPosition)) 501 return 0;501 return nullptr; 502 502 if (!parseLong(currentPosition, &postParsePosition, 10, &month)) 503 return 0;503 return nullptr; 504 504 if ((postParsePosition - currentPosition) != 2) 505 return 0;505 return nullptr; 506 506 507 507 // Check for presence of -DD portion. … … 511 511 512 512 if (!isASCIIDigit(*currentPosition)) 513 return 0;513 return nullptr; 514 514 if (!parseLong(currentPosition, &postParsePosition, 10, &day)) 515 return 0;515 return nullptr; 516 516 if ((postParsePosition - currentPosition) != 2) 517 return 0;517 return nullptr; 518 518 return postParsePosition; 519 519 } … … 528 528 char* postParsePosition; 529 529 if (!isASCIIDigit(*currentPosition)) 530 return 0;530 return nullptr; 531 531 if (!parseLong(currentPosition, &postParsePosition, 10, &hours)) 532 return 0;532 return nullptr; 533 533 if (*postParsePosition != ':' || (postParsePosition - currentPosition) != 2) 534 return 0;534 return nullptr; 535 535 currentPosition = postParsePosition + 1; 536 536 537 537 if (!isASCIIDigit(*currentPosition)) 538 return 0;538 return nullptr; 539 539 if (!parseLong(currentPosition, &postParsePosition, 10, &minutes)) 540 return 0;540 return nullptr; 541 541 if ((postParsePosition - currentPosition) != 2) 542 return 0;542 return nullptr; 543 543 currentPosition = postParsePosition; 544 544 … … 549 549 long intSeconds; 550 550 if (!isASCIIDigit(*currentPosition)) 551 return 0;551 return nullptr; 552 552 if (!parseLong(currentPosition, &postParsePosition, 10, &intSeconds)) 553 return 0;553 return nullptr; 554 554 if ((postParsePosition - currentPosition) != 2) 555 return 0;555 return nullptr; 556 556 seconds = intSeconds; 557 557 if (*postParsePosition == '.') { … … 562 562 // We check the next character to avoid reading +/- timezone hours after an invalid decimal. 563 563 if (!isASCIIDigit(*currentPosition)) 564 return 0;564 return nullptr; 565 565 566 566 // We are more lenient than ES5 by accepting more or less than 3 fraction digits. 567 567 long fracSeconds; 568 568 if (!parseLong(currentPosition, &postParsePosition, 10, &fracSeconds)) 569 return 0;569 return nullptr; 570 570 571 571 long numFracDigits = postParsePosition - currentPosition; … … 595 595 596 596 if (!isASCIIDigit(*currentPosition)) 597 return 0;597 return nullptr; 598 598 if (!parseLong(currentPosition, &postParsePosition, 10, &tzHours)) 599 return 0;599 return nullptr; 600 600 if (*postParsePosition != ':') { 601 601 if ((postParsePosition - currentPosition) == 2) { … … 608 608 tzHoursAbs = tzHoursAbs / 100; 609 609 } else 610 return 0;610 return nullptr; 611 611 } else { 612 612 // "00:00" case. 613 613 if ((postParsePosition - currentPosition) != 2) 614 return 0;614 return nullptr; 615 615 tzHoursAbs = labs(tzHours); 616 616 currentPosition = postParsePosition + 1; // Skip ":". 617 617 618 618 if (!isASCIIDigit(*currentPosition)) 619 return 0;619 return nullptr; 620 620 if (!parseLong(currentPosition, &postParsePosition, 10, &tzMinutes)) 621 return 0;621 return nullptr; 622 622 if ((postParsePosition - currentPosition) != 2) 623 return 0;623 return nullptr; 624 624 } 625 625 currentPosition = postParsePosition; 626 626 627 627 if (tzHoursAbs > 24) 628 return 0;628 return nullptr; 629 629 if (tzMinutes < 0 || tzMinutes > 59) 630 return 0;630 return nullptr; 631 631 632 632 timeZoneSeconds = 60 * (tzMinutes + (60 * tzHoursAbs)); -
trunk/Source/WTF/wtf/FastMalloc.cpp
r260054 r261393 110 110 void* result; 111 111 if (!tryFastMalloc(n).getValue(result)) 112 return 0;112 return nullptr; 113 113 memset(result, 0, n); 114 114 return result; -
trunk/Source/WTF/wtf/HashTable.h
r257721 r261393 695 695 696 696 if (isEmptyBucket(*entry)) 697 return 0;697 return nullptr; 698 698 } else { 699 699 if (isEmptyBucket(*entry)) 700 return 0;700 return nullptr; 701 701 702 702 if (!isDeletedBucket(*entry) && HashTranslator::equal(Extractor::extract(*entry), key)) … … 740 740 #endif 741 741 742 ValueType* deletedEntry = 0;742 ValueType* deletedEntry = nullptr; 743 743 744 744 while (1) { … … 801 801 #endif 802 802 803 ValueType* deletedEntry = 0;803 ValueType* deletedEntry = nullptr; 804 804 805 805 while (1) { … … 948 948 #endif 949 949 950 ValueType* deletedEntry = 0;950 ValueType* deletedEntry = nullptr; 951 951 ValueType* entry; 952 952 while (1) { -
trunk/Source/WTF/wtf/MetaAllocator.cpp
r259582 r261393 214 214 215 215 if (!node) 216 return 0;216 return nullptr; 217 217 218 218 size_t nodeSizeInBytes = node->sizeInBytes(); -
trunk/Source/WTF/wtf/ParallelJobsGeneric.cpp
r245876 r261393 35 35 namespace WTF { 36 36 37 Vector< RefPtr<ParallelEnvironment::ThreadPrivate> >* ParallelEnvironment::s_threadPool = 0;37 Vector< RefPtr<ParallelEnvironment::ThreadPrivate> >* ParallelEnvironment::s_threadPool = nullptr; 38 38 39 39 ParallelEnvironment::ParallelEnvironment(ThreadFunction threadFunction, size_t sizeOfParameter, int requestedJobNumber) : -
trunk/Source/WTF/wtf/RandomDevice.cpp
r237721 r261393 109 109 // If it is safe, we can acquire context per RandomDevice. 110 110 HCRYPTPROV hCryptProv = 0; 111 if (!CryptAcquireContext(&hCryptProv, 0, MS_DEF_PROV, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT))111 if (!CryptAcquireContext(&hCryptProv, nullptr, MS_DEF_PROV, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) 112 112 CRASH(); 113 113 if (!CryptGenRandom(hCryptProv, length, buffer)) -
trunk/Source/WTF/wtf/RawPointer.h
r237099 r261393 31 31 public: 32 32 RawPointer() 33 : m_value( 0)33 : m_value(nullptr) 34 34 { 35 35 } -
trunk/Source/WTF/wtf/RedBlackTree.h
r259582 r261393 96 96 void reset() 97 97 { 98 m_left = 0;99 m_right = 0;98 m_left = nullptr; 99 m_right = nullptr; 100 100 m_parentAndRed = 1; // initialize to red 101 101 } … … 154 154 155 155 RedBlackTree() 156 : m_root( 0)156 : m_root(nullptr) 157 157 { 158 158 } … … 297 297 NodeType* findLeastGreaterThanOrEqual(const KeyType& key) const 298 298 { 299 NodeType* best = 0;299 NodeType* best = nullptr; 300 300 for (NodeType* current = m_root; current;) { 301 301 if (current->key() == key) … … 313 313 NodeType* findGreatestLessThanOrEqual(const KeyType& key) const 314 314 { 315 NodeType* best = 0;315 NodeType* best = nullptr; 316 316 for (NodeType* current = m_root; current;) { 317 317 if (current->key() == key) … … 350 350 { 351 351 if (!m_root) 352 return 0;352 return nullptr; 353 353 return treeMinimum(m_root); 354 354 } … … 414 414 ASSERT(z->color() == Red); 415 415 416 NodeType* y = 0;416 NodeType* y = nullptr; 417 417 NodeType* x = m_root; 418 418 while (x) { -
trunk/Source/WTF/wtf/SHA1.cpp
r237099 r261393 205 205 CString SHA1::hexDigest(const Digest& digest) 206 206 { 207 char* start = 0;207 char* start = nullptr; 208 208 CString result = CString::newUninitialized(40, start); 209 209 char* buffer = start; -
trunk/Source/WTF/wtf/SchedulePair.h
r250005 r261393 59 59 { 60 60 if (mode) 61 m_mode = adoptCF(CFStringCreateCopy( 0, mode));61 m_mode = adoptCF(CFStringCreateCopy(nullptr, mode)); 62 62 } 63 63 -
trunk/Source/WTF/wtf/StackTrace.cpp
r257298 r261393 50 50 *size = backtrace(stack, *size); 51 51 #elif OS(WINDOWS) 52 *size = RtlCaptureStackBackTrace(0, *size, stack, 0);52 *size = RtlCaptureStackBackTrace(0, *size, stack, nullptr); 53 53 #else 54 54 UNUSED_PARAM(stack); … … 132 132 mangledName = symbols[i]; 133 133 #elif OS(WINDOWS) 134 if (DbgHelper::SymFromAddress(hProc, reinterpret_cast<DWORD64>(stack[i]), 0, symbolInfo))134 if (DbgHelper::SymFromAddress(hProc, reinterpret_cast<DWORD64>(stack[i]), nullptr, symbolInfo)) 135 135 mangledName = symbolInfo->Name; 136 136 #endif -
trunk/Source/WTF/wtf/StringExtras.h
r225618 r261393 40 40 return const_cast<char*>(start); 41 41 } 42 return 0;42 return nullptr; 43 43 } 44 44 -
trunk/Source/WTF/wtf/Variant.h
r248546 r261393 1310 1310 template <typename _Type> struct __is_swappable { 1311 1311 static constexpr bool value = 1312 sizeof(__swap_test_detail::__test<_Type>( 0)) != 1;1312 sizeof(__swap_test_detail::__test<_Type>(nullptr)) != 1; 1313 1313 }; 1314 1314 -
trunk/Source/WTF/wtf/Vector.h
r261041 r261393 329 329 330 330 if (m_buffer == bufferToDeallocate) { 331 m_buffer = 0;331 m_buffer = nullptr; 332 332 m_capacity = 0; 333 333 } … … 344 344 { 345 345 T* buffer = m_buffer; 346 m_buffer = 0;346 m_buffer = nullptr; 347 347 m_capacity = 0; 348 348 return adoptMallocPtr<T, Malloc>(buffer); … … 351 351 protected: 352 352 VectorBufferBase() 353 : m_buffer( 0)353 : m_buffer(nullptr) 354 354 , m_capacity(0) 355 355 , m_size(0) -
trunk/Source/WTF/wtf/cf/CFURLExtras.cpp
r260707 r261393 38 38 // could either be a malformed string or bytes in a different encoding, like Shift-JIS, so we fall back 39 39 // onto using ISO Latin-1 in those cases. 40 RetainPtr<CFURLRef> result = adoptCF(CFURLCreateAbsoluteURLWithBytes( 0, reinterpret_cast<const UInt8*>(data), size, kCFStringEncodingUTF8, baseURL, true));40 RetainPtr<CFURLRef> result = adoptCF(CFURLCreateAbsoluteURLWithBytes(nullptr, reinterpret_cast<const UInt8*>(data), size, kCFStringEncodingUTF8, baseURL, true)); 41 41 if (!result) 42 result = adoptCF(CFURLCreateAbsoluteURLWithBytes( 0, reinterpret_cast<const UInt8*>(data), size, kCFStringEncodingISOLatin1, baseURL, true));42 result = adoptCF(CFURLCreateAbsoluteURLWithBytes(nullptr, reinterpret_cast<const UInt8*>(data), size, kCFStringEncodingISOLatin1, baseURL, true)); 43 43 return result; 44 44 } … … 46 46 void getURLBytes(CFURLRef url, URLCharBuffer& result) 47 47 { 48 CFIndex bytesLength = CFURLGetBytes(url, 0, 0);48 CFIndex bytesLength = CFURLGetBytes(url, nullptr, 0); 49 49 result.resize(bytesLength); 50 50 CFIndex finalLength = CFURLGetBytes(url, reinterpret_cast<UInt8*>(result.data()), bytesLength); … … 54 54 void getURLBytes(CFURLRef url, CString& result) 55 55 { 56 CFIndex bytesLength = CFURLGetBytes(url, 0, 0);56 CFIndex bytesLength = CFURLGetBytes(url, nullptr, 0); 57 57 char* bytes; 58 58 result = CString::newUninitialized(bytesLength, bytes); -
trunk/Source/WTF/wtf/cf/CFURLExtras.h
r239556 r261393 35 35 typedef Vector<char, 512> URLCharBuffer; 36 36 37 WTF_EXPORT_PRIVATE RetainPtr<CFURLRef> createCFURLFromBuffer(const char*, size_t, CFURLRef baseURL = 0);37 WTF_EXPORT_PRIVATE RetainPtr<CFURLRef> createCFURLFromBuffer(const char*, size_t, CFURLRef baseURL = nullptr); 38 38 WTF_EXPORT_PRIVATE void getURLBytes(CFURLRef, URLCharBuffer&); 39 39 WTF_EXPORT_PRIVATE void getURLBytes(CFURLRef, CString&); -
trunk/Source/WTF/wtf/cf/FileSystemCF.cpp
r240437 r261393 69 69 pathStyle = kCFURLPOSIXPathStyle; 70 70 #endif 71 return adoptCF(CFURLCreateWithFileSystemPath( 0, path.createCFString().get(), pathStyle, FALSE));71 return adoptCF(CFURLCreateWithFileSystemPath(nullptr, path.createCFString().get(), pathStyle, FALSE)); 72 72 } 73 73 -
trunk/Source/WTF/wtf/dtoa/double-conversion.cc
r250636 r261393 63 63 Double double_inspect(value); 64 64 if (double_inspect.IsInfinite()) { 65 if (infinity_symbol_ == NULL) return false;65 if (infinity_symbol_ == nullptr) return false; 66 66 if (value < 0) { 67 67 result_builder->AddCharacter('-'); … … 71 71 } 72 72 if (double_inspect.IsNan()) { 73 if (nan_symbol_ == NULL) return false;73 if (nan_symbol_ == nullptr) return false; 74 74 result_builder->AddString(nan_symbol_); 75 75 return true; -
trunk/Source/WTF/wtf/dtoa/utils.h
r250636 r261393 193 193 class BufferReference { 194 194 public: 195 BufferReference() : start_( NULL), length_(0) {}195 BufferReference() : start_(nullptr), length_(0) {} 196 196 BufferReference(T* data, int len) : start_(data), length_(len) { 197 197 ASSERT(len == 0 || (len > 0 && data != NULL)); -
trunk/Source/WTF/wtf/text/CString.cpp
r256910 r261393 77 77 copyBufferIfNeeded(); 78 78 if (!m_buffer) 79 return 0;79 return nullptr; 80 80 return m_buffer->mutableData(); 81 81 } -
trunk/Source/WTF/wtf/text/CString.h
r256910 r261393 68 68 const char* data() const 69 69 { 70 return m_buffer ? m_buffer->data() : 0;70 return m_buffer ? m_buffer->data() : nullptr; 71 71 } 72 72 WTF_EXPORT_PRIVATE char* mutableData(); -
trunk/Source/WTF/wtf/text/StringBuffer.h
r253987 r261393 80 80 { 81 81 CharType* data = m_data; 82 m_data = 0;82 m_data = nullptr; 83 83 return adoptMallocPtr<CharType, StringBufferMalloc>(data); 84 84 } -
trunk/Source/WTF/wtf/text/StringImpl.cpp
r260383 r261393 183 183 { 184 184 if (!length) { 185 data = 0;185 data = nullptr; 186 186 return *empty(); 187 187 } … … 219 219 220 220 if (!length) { 221 data = 0;221 data = nullptr; 222 222 return Ref<StringImpl>(*empty()); 223 223 } -
trunk/Source/WTF/wtf/text/StringImpl.h
r260383 r261393 391 391 WTF_EXPORT_PRIVATE UChar32 characterStartingAt(unsigned); 392 392 393 int toIntStrict(bool* ok = 0, int base = 10);394 unsigned toUIntStrict(bool* ok = 0, int base = 10);395 int64_t toInt64Strict(bool* ok = 0, int base = 10);396 uint64_t toUInt64Strict(bool* ok = 0, int base = 10);397 intptr_t toIntPtrStrict(bool* ok = 0, int base = 10);398 399 WTF_EXPORT_PRIVATE int toInt(bool* ok = 0); // ignores trailing garbage400 unsigned toUInt(bool* ok = 0); // ignores trailing garbage401 int64_t toInt64(bool* ok = 0); // ignores trailing garbage402 uint64_t toUInt64(bool* ok = 0); // ignores trailing garbage403 intptr_t toIntPtr(bool* ok = 0); // ignores trailing garbage393 int toIntStrict(bool* ok = nullptr, int base = 10); 394 unsigned toUIntStrict(bool* ok = nullptr, int base = 10); 395 int64_t toInt64Strict(bool* ok = nullptr, int base = 10); 396 uint64_t toUInt64Strict(bool* ok = nullptr, int base = 10); 397 intptr_t toIntPtrStrict(bool* ok = nullptr, int base = 10); 398 399 WTF_EXPORT_PRIVATE int toInt(bool* ok = nullptr); // ignores trailing garbage 400 unsigned toUInt(bool* ok = nullptr); // ignores trailing garbage 401 int64_t toInt64(bool* ok = nullptr); // ignores trailing garbage 402 uint64_t toUInt64(bool* ok = nullptr); // ignores trailing garbage 403 intptr_t toIntPtr(bool* ok = nullptr); // ignores trailing garbage 404 404 405 405 // FIXME: Like the strict functions above, these give false for "ok" when there is trailing garbage. 406 406 // Like the non-strict functions above, these return the value when there is trailing garbage. 407 407 // It would be better if these were more consistent with the above functions instead. 408 double toDouble(bool* ok = 0);409 float toFloat(bool* ok = 0);408 double toDouble(bool* ok = nullptr); 409 float toFloat(bool* ok = nullptr); 410 410 411 411 WTF_EXPORT_PRIVATE Ref<StringImpl> convertToASCIILowercase(); -
trunk/Source/WTF/wtf/text/TextBreakIterator.cpp
r246490 r261393 65 65 { 66 66 UErrorCode openStatus = U_ZERO_ERROR; 67 UBreakIterator* iterator = ubrk_open(type, locale, 0, 0, &openStatus);67 UBreakIterator* iterator = ubrk_open(type, locale, nullptr, 0, &openStatus); 68 68 ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), "ICU could not open a break iterator: %s (%d)", u_errorName(openStatus), openStatus); 69 69 return iterator; … … 135 135 if (U_FAILURE(openStatus)) { 136 136 LOG_ERROR("openUTF16ContextAwareUTextProvider failed with status %d", openStatus); 137 return 0;137 return nullptr; 138 138 } 139 139 … … 192 192 bool localeIsEmpty = locale.isEmpty(); 193 193 UErrorCode openStatus = U_ZERO_ERROR; 194 UBreakIterator* ubrkIter = ubrk_open(UBRK_LINE, localeIsEmpty ? currentTextBreakLocaleID() : locale.string().utf8().data(), 0, 0, &openStatus);194 UBreakIterator* ubrkIter = ubrk_open(UBRK_LINE, localeIsEmpty ? currentTextBreakLocaleID() : locale.string().utf8().data(), nullptr, 0, &openStatus); 195 195 // locale comes from a web page and it can be invalid, leading ICU 196 196 // to fail, in which case we fall back to the default locale. 197 197 if (!localeIsEmpty && U_FAILURE(openStatus)) { 198 198 openStatus = U_ZERO_ERROR; 199 ubrkIter = ubrk_open(UBRK_LINE, currentTextBreakLocaleID(), 0, 0, &openStatus);199 ubrkIter = ubrk_open(UBRK_LINE, currentTextBreakLocaleID(), nullptr, 0, &openStatus); 200 200 } 201 201 -
trunk/Source/WTF/wtf/text/TextBreakIterator.h
r256420 r261393 286 286 { 287 287 ASSERT(priorContextLength <= priorContextCapacity); 288 const UChar* priorContext = priorContextLength ? &m_priorContext[priorContextCapacity - priorContextLength] : 0;288 const UChar* priorContext = priorContextLength ? &m_priorContext[priorContextCapacity - priorContextLength] : nullptr; 289 289 if (!m_iterator) { 290 290 m_iterator = acquireLineBreakIterator(m_stringView, m_locale, priorContext, priorContextLength, m_mode); -
trunk/Source/WTF/wtf/text/WTFString.cpp
r260707 r261393 1074 1074 { 1075 1075 // FIXME: This will return ok even when the string fits into a double but not a float. 1076 return static_cast<float>(toDoubleType<LChar, AllowTrailingJunk>(data, length, 0, parsedLength));1076 return static_cast<float>(toDoubleType<LChar, AllowTrailingJunk>(data, length, nullptr, parsedLength)); 1077 1077 } 1078 1078 … … 1080 1080 { 1081 1081 // FIXME: This will return ok even when the string fits into a double but not a float. 1082 return static_cast<float>(toDoubleType<UChar, AllowTrailingJunk>(data, length, 0, parsedLength));1082 return static_cast<float>(toDoubleType<UChar, AllowTrailingJunk>(data, length, nullptr, parsedLength)); 1083 1083 } 1084 1084 -
trunk/Source/WTF/wtf/text/cf/StringImplCF.cpp
r253987 r261393 58 58 static void* allocate(CFIndex size, CFOptionFlags, void*) 59 59 { 60 StringImpl* underlyingString = 0;60 StringImpl* underlyingString = nullptr; 61 61 if (isMainThread()) { 62 62 underlyingString = currentString; 63 63 if (underlyingString) { 64 currentString = 0;64 currentString = nullptr; 65 65 underlyingString->ref(); // Balanced by call to deref in deallocate below. 66 66 } … … 114 114 static CFAllocatorRef create() 115 115 { 116 CFAllocatorContext context = { 0, 0, retain, release, copyDescription, allocate, reallocate, deallocate, preferredSize };117 return CFAllocatorCreate( 0, &context);116 CFAllocatorContext context = { 0, nullptr, retain, release, copyDescription, allocate, reallocate, deallocate, preferredSize }; 117 return CFAllocatorCreate(nullptr, &context); 118 118 } 119 119 … … 130 130 if (!m_length || !isMainThread()) { 131 131 if (is8Bit()) 132 return adoptCF(CFStringCreateWithBytes( 0, reinterpret_cast<const UInt8*>(characters8()), m_length, kCFStringEncodingISOLatin1, false));133 return adoptCF(CFStringCreateWithCharacters( 0, reinterpret_cast<const UniChar*>(characters16()), m_length));132 return adoptCF(CFStringCreateWithBytes(nullptr, reinterpret_cast<const UInt8*>(characters8()), m_length, kCFStringEncodingISOLatin1, false)); 133 return adoptCF(CFStringCreateWithCharacters(nullptr, reinterpret_cast<const UniChar*>(characters16()), m_length)); 134 134 } 135 135 CFAllocatorRef allocator = StringWrapperCFAllocator::allocator(); … … 145 145 string = CFStringCreateWithCharactersNoCopy(allocator, reinterpret_cast<const UniChar*>(characters16()), m_length, kCFAllocatorNull); 146 146 // CoreFoundation might not have to allocate anything, we clear currentString in case we did not execute allocate(). 147 StringWrapperCFAllocator::currentString = 0;147 StringWrapperCFAllocator::currentString = nullptr; 148 148 149 149 return adoptCF(string); -
trunk/Source/WTF/wtf/text/icu/UTextProviderLatin1.cpp
r250380 r261393 66 66 67 67 if (U_FAILURE(*status)) 68 return 0;68 return nullptr; 69 69 70 70 UText* result = utext_setup(destination, sizeof(UChar) * UTextWithBufferInlineCapacity, status); … … 378 378 { 379 379 if (U_FAILURE(*status)) 380 return 0;380 return nullptr; 381 381 if (!string || length > static_cast<unsigned>(std::numeric_limits<int32_t>::max())) { 382 382 *status = U_ILLEGAL_ARGUMENT_ERROR; 383 return 0;383 return nullptr; 384 384 } 385 385 UText* text = utext_setup(&utWithBuffer->text, sizeof(utWithBuffer->buffer), status); 386 386 if (U_FAILURE(*status)) { 387 387 ASSERT(!text); 388 return 0;388 return nullptr; 389 389 } 390 390 -
trunk/Source/WTF/wtf/text/icu/UTextProviderUTF16.cpp
r237099 r261393 167 167 { 168 168 if (U_FAILURE(*status)) 169 return 0;169 return nullptr; 170 170 if (!string || length > static_cast<unsigned>(std::numeric_limits<int32_t>::max())) { 171 171 *status = U_ILLEGAL_ARGUMENT_ERROR; 172 return 0;172 return nullptr; 173 173 } 174 174 text = utext_setup(text, 0, status); 175 175 if (U_FAILURE(*status)) { 176 176 ASSERT(!text); 177 return 0;177 return nullptr; 178 178 } 179 179 -
trunk/Source/WTF/wtf/win/FileSystemWin.cpp
r257518 r261393 295 295 { 296 296 String fullPath = path; 297 if (SHCreateDirectoryEx( 0, fullPath.wideCharacters().data(), 0) != ERROR_SUCCESS) {297 if (SHCreateDirectoryEx(nullptr, fullPath.wideCharacters().data(), nullptr) != ERROR_SUCCESS) { 298 298 DWORD error = GetLastError(); 299 299 if (error != ERROR_FILE_EXISTS && error != ERROR_ALREADY_EXISTS) { … … 349 349 { 350 350 Vector<UChar> buffer(MAX_PATH); 351 if (FAILED(SHGetFolderPathW( 0, pathIdentifier | CSIDL_FLAG_CREATE, 0, 0, wcharFrom(buffer.data()))))351 if (FAILED(SHGetFolderPathW(nullptr, pathIdentifier | CSIDL_FLAG_CREATE, nullptr, 0, wcharFrom(buffer.data())))) 352 352 return String(); 353 353 … … 411 411 String proposedPath = generateTemporaryPath([&handle](const String& proposedPath) { 412 412 // use CREATE_NEW to avoid overwriting an existing file with the same name 413 handle = ::CreateFileW(proposedPath.wideCharacters().data(), GENERIC_READ | GENERIC_WRITE, 0, 0, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, 0);413 handle = ::CreateFileW(proposedPath.wideCharacters().data(), GENERIC_READ | GENERIC_WRITE, 0, nullptr, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, nullptr); 414 414 415 415 return isHandleValid(handle) || GetLastError() == ERROR_ALREADY_EXISTS; … … 447 447 448 448 String destination = path; 449 return CreateFile(destination.wideCharacters().data(), desiredAccess, shareMode, 0, creationDisposition, FILE_ATTRIBUTE_NORMAL, 0);449 return CreateFile(destination.wideCharacters().data(), desiredAccess, shareMode, nullptr, creationDisposition, FILE_ATTRIBUTE_NORMAL, nullptr); 450 450 } 451 451 … … 492 492 493 493 DWORD bytesWritten; 494 bool success = WriteFile(handle, data, length, &bytesWritten, 0);494 bool success = WriteFile(handle, data, length, &bytesWritten, nullptr); 495 495 496 496 if (!success) … … 505 505 506 506 DWORD bytesRead; 507 bool success = ::ReadFile(handle, data, length, &bytesRead, 0);507 bool success = ::ReadFile(handle, data, length, &bytesRead, nullptr); 508 508 509 509 if (!success) … … 603 603 FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_SILENT, 604 604 false, 605 0,605 nullptr, 606 606 L"" 607 607 }; -
trunk/Source/WTF/wtf/win/LanguageWin.cpp
r257688 r261393 41 41 { 42 42 LANGID langID = GetUserDefaultUILanguage(); 43 int localeChars = GetLocaleInfo(langID, localeType, 0, 0);43 int localeChars = GetLocaleInfo(langID, localeType, nullptr, 0); 44 44 if (!localeChars) 45 45 return fallback; -
trunk/Source/WTF/wtf/win/MainThreadWin.cpp
r251164 r261393 63 63 RegisterClassW(&wcex); 64 64 65 threadingWindowHandle = CreateWindowW(kThreadingWindowClassName, 0, 0,66 CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, HWND_MESSAGE, 0, 0, 0);65 threadingWindowHandle = CreateWindowW(kThreadingWindowClassName, nullptr, 0, 66 CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, HWND_MESSAGE, nullptr, nullptr, nullptr); 67 67 threadingFiredMessage = RegisterWindowMessageW(L"com.apple.WebKit.MainThreadFired"); 68 68 -
trunk/Source/WTF/wtf/win/OSAllocatorWin.cpp
r240636 r261393 41 41 void* OSAllocator::reserveUncommitted(size_t bytes, Usage, bool writable, bool executable, bool) 42 42 { 43 void* result = VirtualAlloc( 0, bytes, MEM_RESERVE, protection(writable, executable));43 void* result = VirtualAlloc(nullptr, bytes, MEM_RESERVE, protection(writable, executable)); 44 44 if (!result) 45 45 CRASH(); … … 49 49 void* OSAllocator::reserveAndCommit(size_t bytes, Usage, bool writable, bool executable, bool) 50 50 { 51 void* result = VirtualAlloc( 0, bytes, MEM_RESERVE | MEM_COMMIT, protection(writable, executable));51 void* result = VirtualAlloc(nullptr, bytes, MEM_RESERVE | MEM_COMMIT, protection(writable, executable)); 52 52 if (!result) 53 53 CRASH(); -
trunk/Source/WTF/wtf/win/RunLoopWin.cpp
r260477 r261393 67 67 { 68 68 MSG message; 69 while (BOOL result = ::GetMessage(&message, 0, 0, 0)) {69 while (BOOL result = ::GetMessage(&message, nullptr, 0, 0)) { 70 70 if (result == -1) 71 71 break; … … 78 78 { 79 79 MSG message; 80 while (::PeekMessage(&message, 0, 0, 0, PM_REMOVE)) {80 while (::PeekMessage(&message, nullptr, 0, 0, PM_REMOVE)) { 81 81 ::TranslateMessage(&message); 82 82 ::DispatchMessage(&message); … … 110 110 RunLoop::RunLoop() 111 111 { 112 m_runLoopMessageWindow = ::CreateWindow(kRunLoopMessageWindowClassName, 0, 0,113 CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, HWND_MESSAGE, 0, 0, this);112 m_runLoopMessageWindow = ::CreateWindow(kRunLoopMessageWindowClassName, nullptr, 0, 113 CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, HWND_MESSAGE, nullptr, nullptr, this); 114 114 ASSERT(::IsWindow(m_runLoopMessageWindow)); 115 115 } … … 132 132 { 133 133 MSG message; 134 if (!::GetMessage(&message, 0, 0, 0))134 if (!::GetMessage(&message, nullptr, 0, 0)) 135 135 return CycleResult::Stop; 136 136 … … 188 188 m_interval = nextFireInterval; 189 189 m_nextFireDate = MonotonicTime::now() + m_interval; 190 ::SetTimer(m_runLoop->m_runLoopMessageWindow, bitwise_cast<uintptr_t>(this), nextFireInterval.millisecondsAs<UINT>(), 0);190 ::SetTimer(m_runLoop->m_runLoopMessageWindow, bitwise_cast<uintptr_t>(this), nextFireInterval.millisecondsAs<UINT>(), nullptr); 191 191 } 192 192 -
trunk/Source/WTF/wtf/win/ThreadingWin.cpp
r260911 r261393 158 158 unsigned threadIdentifier = 0; 159 159 unsigned initFlag = stackSize ? STACK_SIZE_PARAM_IS_A_RESERVATION : 0; 160 HANDLE threadHandle = reinterpret_cast<HANDLE>(_beginthreadex( 0, stackSize.valueOr(0), wtfThreadEntryPoint, data, initFlag, &threadIdentifier));160 HANDLE threadHandle = reinterpret_cast<HANDLE>(_beginthreadex(nullptr, stackSize.valueOr(0), wtfThreadEntryPoint, data, initFlag, &threadIdentifier)); 161 161 if (!threadHandle) { 162 162 LOG_ERROR("Failed to create thread at entry point %p with data %p: %ld", wtfThreadEntryPoint, data, errno);
Note: See TracChangeset
for help on using the changeset viewer.