Replace NULL macros with nullptr literals. Change-Id: I918c40879aa547438f77e7d1a95fa2aa33bec398
diff --git a/cpp/ScriptIntrinsics.cpp b/cpp/ScriptIntrinsics.cpp index ba1e5f4..42903ce 100644 --- a/cpp/ScriptIntrinsics.cpp +++ b/cpp/ScriptIntrinsics.cpp
@@ -23,7 +23,7 @@ using namespace RSC; ScriptIntrinsic::ScriptIntrinsic(sp<RS> rs, int id, sp<const Element> e) - : Script(NULL, rs) { + : Script(nullptr, rs) { mID = createDispatch(rs, RS::dispatch->ScriptIntrinsicCreate(rs->getContext(), id, e->getID())); mElement = e; } @@ -35,7 +35,7 @@ sp<ScriptIntrinsic3DLUT> ScriptIntrinsic3DLUT::create(sp<RS> rs, sp<const Element> e) { if (e->isCompatible(Element::U8_4(rs)) == false) { rs->throwError(RS_ERROR_INVALID_ELEMENT, "Element not supported for intrinsic"); - return NULL; + return nullptr; } return new ScriptIntrinsic3DLUT(rs, e); } @@ -50,7 +50,7 @@ mRS->throwError(RS_ERROR_INVALID_ELEMENT, "3DLUT forEach element mismatch"); return; } - Script::forEach(0, ain, aout, NULL, 0); + Script::forEach(0, ain, aout, nullptr, 0); } void ScriptIntrinsic3DLUT::setLUT(sp<Allocation> lut) { sp<const Type> t = lut->getType(); @@ -69,7 +69,7 @@ sp<ScriptIntrinsicBlend> ScriptIntrinsicBlend::create(sp<RS> rs, sp<const Element> e) { if (e->isCompatible(Element::U8_4(rs)) == false) { rs->throwError(RS_ERROR_INVALID_ELEMENT, "Element not supported for intrinsic"); - return NULL; + return nullptr; } return new ScriptIntrinsicBlend(rs, e); } @@ -83,7 +83,7 @@ out->getType()->getElement()->isCompatible(mElement) == false) { mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blend"); } - Script::forEach(0, in, out, NULL, 0); + Script::forEach(0, in, out, nullptr, 0); } void ScriptIntrinsicBlend::forEachSrc(sp<Allocation> in, sp<Allocation> out) { @@ -91,7 +91,7 @@ out->getType()->getElement()->isCompatible(mElement) == false) { mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blend"); } - Script::forEach(1, in, out, NULL, 0); + Script::forEach(1, in, out, nullptr, 0); } void ScriptIntrinsicBlend::forEachDst(sp<Allocation> in, sp<Allocation> out) { @@ -99,7 +99,7 @@ out->getType()->getElement()->isCompatible(mElement) == false) { mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blend"); } - Script::forEach(2, in, out, NULL, 0); + Script::forEach(2, in, out, nullptr, 0); } void ScriptIntrinsicBlend::forEachSrcOver(sp<Allocation> in, sp<Allocation> out) { @@ -107,7 +107,7 @@ out->getType()->getElement()->isCompatible(mElement) == false) { mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blend"); } - Script::forEach(3, in, out, NULL, 0); + Script::forEach(3, in, out, nullptr, 0); } void ScriptIntrinsicBlend::forEachDstOver(sp<Allocation> in, sp<Allocation> out) { @@ -115,7 +115,7 @@ out->getType()->getElement()->isCompatible(mElement) == false) { mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blend"); } - Script::forEach(4, in, out, NULL, 0); + Script::forEach(4, in, out, nullptr, 0); } void ScriptIntrinsicBlend::forEachSrcIn(sp<Allocation> in, sp<Allocation> out) { @@ -123,7 +123,7 @@ out->getType()->getElement()->isCompatible(mElement) == false) { mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blend"); } - Script::forEach(5, in, out, NULL, 0); + Script::forEach(5, in, out, nullptr, 0); } void ScriptIntrinsicBlend::forEachDstIn(sp<Allocation> in, sp<Allocation> out) { @@ -131,7 +131,7 @@ out->getType()->getElement()->isCompatible(mElement) == false) { mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blend"); } - Script::forEach(6, in, out, NULL, 0); + Script::forEach(6, in, out, nullptr, 0); } void ScriptIntrinsicBlend::forEachSrcOut(sp<Allocation> in, sp<Allocation> out) { @@ -139,7 +139,7 @@ out->getType()->getElement()->isCompatible(mElement) == false) { mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blend"); } - Script::forEach(7, in, out, NULL, 0); + Script::forEach(7, in, out, nullptr, 0); } void ScriptIntrinsicBlend::forEachDstOut(sp<Allocation> in, sp<Allocation> out) { @@ -147,7 +147,7 @@ out->getType()->getElement()->isCompatible(mElement) == false) { mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blend"); } - Script::forEach(8, in, out, NULL, 0); + Script::forEach(8, in, out, nullptr, 0); } void ScriptIntrinsicBlend::forEachSrcAtop(sp<Allocation> in, sp<Allocation> out) { @@ -155,7 +155,7 @@ out->getType()->getElement()->isCompatible(mElement) == false) { mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blend"); } - Script::forEach(9, in, out, NULL, 0); + Script::forEach(9, in, out, nullptr, 0); } void ScriptIntrinsicBlend::forEachDstAtop(sp<Allocation> in, sp<Allocation> out) { @@ -163,7 +163,7 @@ out->getType()->getElement()->isCompatible(mElement) == false) { mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blend"); } - Script::forEach(10, in, out, NULL, 0); + Script::forEach(10, in, out, nullptr, 0); } void ScriptIntrinsicBlend::forEachXor(sp<Allocation> in, sp<Allocation> out) { @@ -171,7 +171,7 @@ out->getType()->getElement()->isCompatible(mElement) == false) { mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blend"); } - Script::forEach(11, in, out, NULL, 0); + Script::forEach(11, in, out, nullptr, 0); } // Numbering jumps here @@ -180,7 +180,7 @@ out->getType()->getElement()->isCompatible(mElement) == false) { mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blend"); } - Script::forEach(14, in, out, NULL, 0); + Script::forEach(14, in, out, nullptr, 0); } // Numbering jumps here @@ -189,7 +189,7 @@ out->getType()->getElement()->isCompatible(mElement) == false) { mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blend"); } - Script::forEach(34, in, out, NULL, 0); + Script::forEach(34, in, out, nullptr, 0); } void ScriptIntrinsicBlend::forEachSubtract(sp<Allocation> in, sp<Allocation> out) { @@ -197,7 +197,7 @@ out->getType()->getElement()->isCompatible(mElement) == false) { mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blend"); } - Script::forEach(35, in, out, NULL, 0); + Script::forEach(35, in, out, nullptr, 0); } @@ -207,7 +207,7 @@ if ((e->isCompatible(Element::U8_4(rs)) == false) && (e->isCompatible(Element::U8(rs)) == false)) { rs->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blur"); - return NULL; + return nullptr; } return new ScriptIntrinsicBlur(rs, e); } @@ -230,7 +230,7 @@ mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element in blur output"); return; } - Script::forEach(0, NULL, out, NULL, 0); + Script::forEach(0, nullptr, out, nullptr, 0); } void ScriptIntrinsicBlur::setRadius(float radius) { @@ -279,7 +279,7 @@ return; } - Script::forEach(0, in, out, NULL, 0); + Script::forEach(0, in, out, nullptr, 0); } void ScriptIntrinsicColorMatrix::setAdd(float* add) { @@ -346,7 +346,7 @@ !(e->isCompatible(Element::F32_3(rs))) && !(e->isCompatible(Element::F32_4(rs)))) { rs->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element for Convolve3x3"); - return NULL; + return nullptr; } return new ScriptIntrinsicConvolve3x3(rs, e); @@ -370,7 +370,7 @@ mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Element mismatch in Convolve3x3"); return; } - Script::forEach(0, NULL, out, NULL, 0); + Script::forEach(0, nullptr, out, nullptr, 0); } void ScriptIntrinsicConvolve3x3::setCoefficients(float* v) { @@ -387,7 +387,7 @@ !(e->isCompatible(Element::F32_3(rs))) && !(e->isCompatible(Element::F32_4(rs)))) { rs->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element for Convolve5x5"); - return NULL; + return nullptr; } return new ScriptIntrinsicConvolve5x5(rs, e); @@ -412,7 +412,7 @@ return; } - Script::forEach(0, NULL, out, NULL, 0); + Script::forEach(0, nullptr, out, nullptr, 0); } void ScriptIntrinsicConvolve5x5::setCoefficients(float* v) { @@ -420,7 +420,7 @@ } sp<ScriptIntrinsicHistogram> ScriptIntrinsicHistogram::create(sp<RS> rs) { - return new ScriptIntrinsicHistogram(rs, NULL); + return new ScriptIntrinsicHistogram(rs, nullptr); } ScriptIntrinsicHistogram::ScriptIntrinsicHistogram(sp<RS> rs, sp<const Element> e) @@ -483,7 +483,7 @@ return; } - Script::forEach(0, ain, NULL, NULL, 0); + Script::forEach(0, ain, nullptr, nullptr, 0); } @@ -501,13 +501,13 @@ return; } - Script::forEach(1, ain, NULL, NULL, 0); + Script::forEach(1, ain, nullptr, nullptr, 0); } sp<ScriptIntrinsicLUT> ScriptIntrinsicLUT::create(sp<RS> rs, sp<const Element> e) { if (!(e->isCompatible(Element::U8_4(rs)))) { rs->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element for LUT"); - return NULL; + return nullptr; } return new ScriptIntrinsicLUT(rs, e); } @@ -534,7 +534,7 @@ mRS->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element for LUT"); return; } - Script::forEach(0, ain, aout, NULL, 0); + Script::forEach(0, ain, aout, nullptr, 0); } @@ -572,7 +572,7 @@ sp<ScriptIntrinsicYuvToRGB> ScriptIntrinsicYuvToRGB::create(sp<RS> rs, sp<const Element> e) { if (!(e->isCompatible(Element::U8_4(rs)))) { rs->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element for YuvToRGB"); - return NULL; + return nullptr; } return new ScriptIntrinsicYuvToRGB(rs, e); } @@ -596,13 +596,13 @@ return; } - Script::forEach(0, NULL, out, NULL, 0); + Script::forEach(0, nullptr, out, nullptr, 0); } sp<ScriptIntrinsicVP9LoopFilter> ScriptIntrinsicVP9LoopFilter::create(sp<RS> rs, sp<const Element> e) { if (!(e->isCompatible(Element::U8(rs)))) { rs->throwError(RS_ERROR_INVALID_ELEMENT, "Invalid element for Vp9LoopFilter"); - return NULL; + return nullptr; } return new ScriptIntrinsicVP9LoopFilter(rs, e); } @@ -610,7 +610,8 @@ ScriptIntrinsicVP9LoopFilter::ScriptIntrinsicVP9LoopFilter(sp<RS> rs, sp<const Element> e) : ScriptIntrinsic(rs, RS_SCRIPT_INTRINSIC_ID_LOOP_FILTER, e) { sp<const Type> t_pad = Type::create(rs, e, 1, 0, 0); - mPadAlloc = Allocation::createTyped(rs, t_pad, RS_ALLOCATION_MIPMAP_NONE, RS_ALLOCATION_USAGE_SCRIPT, NULL); + mPadAlloc = Allocation::createTyped(rs, t_pad, RS_ALLOCATION_MIPMAP_NONE, + RS_ALLOCATION_USAGE_SCRIPT, nullptr); } void ScriptIntrinsicVP9LoopFilter::setLoopFilterDomain(int start, int stop, int numPlanes, int miRows, int miCols) { @@ -641,5 +642,5 @@ return; } Script::setVar(4, frameBuffer); - Script::forEach(0, mPadAlloc, NULL, NULL, 0); + Script::forEach(0, mPadAlloc, nullptr, nullptr, 0); }