Skip to content

Commit 9c09684

Browse files
committed
Merge pull request #691 from dduan/NULL_nullptr
replace NULL with nullptr
2 parents 375bef1 + ae601d2 commit 9c09684

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

lib/AST/Availability.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ AvailabilityInference::annotatedAvailableRange(const Decl *D, ASTContext &Ctx) {
127127

128128
for (auto Attr : D->getAttrs()) {
129129
auto *AvailAttr = dyn_cast<AvailableAttr>(Attr);
130-
if (AvailAttr == NULL || !AvailAttr->Introduced.hasValue() ||
130+
if (AvailAttr == nullptr || !AvailAttr->Introduced.hasValue() ||
131131
!AvailAttr->isActivePlatform(Ctx)) {
132132
continue;
133133
}

lib/IDE/Utils.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ ide::isSourceInputComplete(std::unique_ptr<llvm::MemoryBuffer> MemBuf) {
119119
const char *SourceStart = Buffer.data();
120120
const char *SourceEnd = Buffer.data() + Buffer.size();
121121
const char *LineStart = SourceStart;
122-
const char *LineSourceStart = NULL;
122+
const char *LineSourceStart = nullptr;
123123
uint32_t LineIndent = 0;
124124
struct IndentInfo {
125125
StringRef Prefix;
@@ -134,7 +134,7 @@ ide::isSourceInputComplete(std::unique_ptr<llvm::MemoryBuffer> MemBuf) {
134134
case '\r':
135135
case '\n':
136136
LineIndent = 0;
137-
LineSourceStart = NULL;
137+
LineSourceStart = nullptr;
138138
LineStart = p + 1;
139139
break;
140140

@@ -146,7 +146,7 @@ ide::isSourceInputComplete(std::unique_ptr<llvm::MemoryBuffer> MemBuf) {
146146
case '(':
147147
case '[':
148148
++LineIndent;
149-
if (LineSourceStart == NULL)
149+
if (LineSourceStart == nullptr)
150150
IndentInfos.push_back(IndentInfo(LineStart,
151151
p - LineStart,
152152
LineIndent));
@@ -166,7 +166,7 @@ ide::isSourceInputComplete(std::unique_ptr<llvm::MemoryBuffer> MemBuf) {
166166
break;
167167

168168
default:
169-
if (LineSourceStart == NULL && !isspace(*p))
169+
if (LineSourceStart == nullptr && !isspace(*p))
170170
LineSourceStart = p;
171171
break;
172172
}

lib/IRGen/IRGenSIL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1233,7 +1233,7 @@ static void emitEntryPointArgumentsCOrObjC(IRGenSILFunction &IGF,
12331233
// all the value parameters.
12341234
if (hasPolymorphicParameters(funcTy)) {
12351235
emitPolymorphicParameters(IGF, *IGF.CurSILFn, params,
1236-
NULL,
1236+
nullptr,
12371237
[&](unsigned paramIndex) -> llvm::Value* {
12381238
SILValue parameter = entry->getBBArgs()[paramIndex];
12391239
return IGF.getLoweredSingletonExplosion(parameter);

stdlib/public/runtime/Reflection.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ static void getEnumMirrorInfo(const OpaqueValue *value,
598598
const OpaqueValue *value,
599599
const Metadata *type) {
600600
if (!isEnumReflectable(type))
601-
return NULL;
601+
return nullptr;
602602

603603
const auto Enum = static_cast<const EnumMetadata *>(type);
604604
const auto &Description = Enum->Description->Enum;

stdlib/public/stubs/Stubs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ static const char *_swift_stdlib_strtoX_clocale_impl(
328328
*outResult = result;
329329
if (result == huge || result == -huge || result == 0.0 || result == -0.0) {
330330
if (errno == ERANGE)
331-
EndPtr = NULL;
331+
EndPtr = nullptr;
332332
}
333333
return EndPtr;
334334
}

0 commit comments

Comments
 (0)