Skip to content

replace NULL with nullptr #691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 20, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/AST/Availability.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ AvailabilityInference::annotatedAvailableRange(const Decl *D, ASTContext &Ctx) {

for (auto Attr : D->getAttrs()) {
auto *AvailAttr = dyn_cast<AvailableAttr>(Attr);
if (AvailAttr == NULL || !AvailAttr->Introduced.hasValue() ||
if (AvailAttr == nullptr || !AvailAttr->Introduced.hasValue() ||
!AvailAttr->isActivePlatform(Ctx)) {
continue;
}
Expand Down
8 changes: 4 additions & 4 deletions lib/IDE/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ ide::isSourceInputComplete(std::unique_ptr<llvm::MemoryBuffer> MemBuf) {
const char *SourceStart = Buffer.data();
const char *SourceEnd = Buffer.data() + Buffer.size();
const char *LineStart = SourceStart;
const char *LineSourceStart = NULL;
const char *LineSourceStart = nullptr;
uint32_t LineIndent = 0;
struct IndentInfo {
StringRef Prefix;
Expand All @@ -134,7 +134,7 @@ ide::isSourceInputComplete(std::unique_ptr<llvm::MemoryBuffer> MemBuf) {
case '\r':
case '\n':
LineIndent = 0;
LineSourceStart = NULL;
LineSourceStart = nullptr;
LineStart = p + 1;
break;

Expand All @@ -146,7 +146,7 @@ ide::isSourceInputComplete(std::unique_ptr<llvm::MemoryBuffer> MemBuf) {
case '(':
case '[':
++LineIndent;
if (LineSourceStart == NULL)
if (LineSourceStart == nullptr)
IndentInfos.push_back(IndentInfo(LineStart,
p - LineStart,
LineIndent));
Expand All @@ -166,7 +166,7 @@ ide::isSourceInputComplete(std::unique_ptr<llvm::MemoryBuffer> MemBuf) {
break;

default:
if (LineSourceStart == NULL && !isspace(*p))
if (LineSourceStart == nullptr && !isspace(*p))
LineSourceStart = p;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/IRGen/IRGenSIL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1233,7 +1233,7 @@ static void emitEntryPointArgumentsCOrObjC(IRGenSILFunction &IGF,
// all the value parameters.
if (hasPolymorphicParameters(funcTy)) {
emitPolymorphicParameters(IGF, *IGF.CurSILFn, params,
NULL,
nullptr,
[&](unsigned paramIndex) -> llvm::Value* {
SILValue parameter = entry->getBBArgs()[paramIndex];
return IGF.getLoweredSingletonExplosion(parameter);
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/runtime/Reflection.mm
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ static void getEnumMirrorInfo(const OpaqueValue *value,
const OpaqueValue *value,
const Metadata *type) {
if (!isEnumReflectable(type))
return NULL;
return nullptr;

const auto Enum = static_cast<const EnumMetadata *>(type);
const auto &Description = Enum->Description->Enum;
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/stubs/Stubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ static const char *_swift_stdlib_strtoX_clocale_impl(
*outResult = result;
if (result == huge || result == -huge || result == 0.0 || result == -0.0) {
if (errno == ERANGE)
EndPtr = NULL;
EndPtr = nullptr;
}
return EndPtr;
}
Expand Down