require semi at the end of SkASSERT and friends

R=bungeman@google.com
TBR=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2185063002

Review-Url: https://codereview.chromium.org/2185063002
This commit is contained in:
caryclark 2016-07-27 12:02:07 -07:00 committed by Commit bot
parent 7d10b9f6e6
commit d6562000ef
13 changed files with 28 additions and 23 deletions

View File

@ -139,14 +139,19 @@ inline void operator delete(void* p) {
SK_API void SkDebugf(const char format[], ...);
#endif
#define SkASSERT_RELEASE(cond) if (!(cond)) { SK_ABORT(#cond); }
#define SkREQUIRE_SEMICOLON_AFTER(code) do { code } while (false)
#define SkASSERT_RELEASE(cond) \
SkREQUIRE_SEMICOLON_AFTER(if (!(cond)) { SK_ABORT(#cond); } )
#ifdef SK_DEBUG
#define SkASSERT(cond) if (!(cond)) { SK_ABORT("assert(" #cond ")"); }
#define SkASSERTF(cond, fmt, ...) if (!(cond)) { \
SkDebugf(fmt"\n", __VA_ARGS__); \
SK_ABORT("assert(" #cond ")"); \
}
#define SkASSERT(cond) \
SkREQUIRE_SEMICOLON_AFTER(if (!(cond)) { SK_ABORT("assert(" #cond ")"); })
#define SkASSERTF(cond, fmt, ...) \
SkREQUIRE_SEMICOLON_AFTER(if (!(cond)) { \
SkDebugf(fmt"\n", __VA_ARGS__); \
SK_ABORT("assert(" #cond ")"); \
})
#define SkDEBUGFAIL(message) SK_ABORT(message)
#define SkDEBUGFAILF(fmt, ...) SkASSERTF(false, fmt, ##__VA_ARGS__)
#define SkDEBUGCODE(code) code

View File

@ -44,7 +44,7 @@ public:
fHasStencilClip = true;
if (deviceBounds) {
fDeviceBounds = *deviceBounds;
SkASSERT(scissor.contains(*deviceBounds))
SkASSERT(scissor.contains(*deviceBounds));
} else {
fDeviceBounds = SkRect::Make(scissor);
}
@ -75,7 +75,7 @@ public:
fHasStencilClip = false;
if (deviceBounds) {
fDeviceBounds = *deviceBounds;
SkASSERT(scissor.contains(*deviceBounds))
SkASSERT(scissor.contains(*deviceBounds));
} else {
fDeviceBounds = SkRect::Make(scissor);
}

View File

@ -445,7 +445,7 @@ private:
// on the interval [0, vMax].
// Note: vMax is not width or height, but width-1 or height-1 because it is the largest valid pixel.
static inline int adjust_edge(SkShader::TileMode edgeType, int vs, int vMax) {
SkASSERT(-1 <= vs && vs <= vMax + 1)
SkASSERT(-1 <= vs && vs <= vMax + 1);
switch (edgeType) {
case SkShader::kClamp_TileMode:
case SkShader::kMirror_TileMode:

View File

@ -280,7 +280,7 @@ void NormalMapSourceImpl::Provider::fillScanLine(int x, int y, SkPoint3 output[]
output[i].normalize();
}
SkASSERT(SkScalarNearlyEqual(output[i].length(), 1.0f))
SkASSERT(SkScalarNearlyEqual(output[i].length(), 1.0f));
}
output += n;

View File

@ -196,7 +196,7 @@ public:
SkASSERT(fDrawContext);
SkASSERT(fViewMatrix);
SkASSERT(fShape);
SkASSERT(fShape->style().isSimpleFill())
SkASSERT(fShape->style().isSimpleFill());
SkPath path;
fShape->asPath(&path);
SkASSERT(!path.isInverseFillType());

View File

@ -130,7 +130,7 @@ bool GrSoftwarePathRenderer::onDrawPath(const DrawPathArgs& args) {
// We really need to know if the shape will be inverse filled or not
bool inverseFilled = false;
SkTLazy<GrShape> tmpShape;
SkASSERT(!args.fShape->style().applies())
SkASSERT(!args.fShape->style().applies());
inverseFilled = args.fShape->inverseFilled();
SkIRect devShapeBounds, devClipBounds;

View File

@ -104,7 +104,7 @@ void GrStyle::WriteKey(uint32_t *key, const GrStyle &style, Apply apply, SkScala
}
void GrStyle::initPathEffect(SkPathEffect* pe) {
SkASSERT(!fPathEffect)
SkASSERT(!fPathEffect);
SkASSERT(SkPathEffect::kNone_DashType == fDashInfo.fType);
SkASSERT(0 == fDashInfo.fIntervals.count());
if (!pe) {

View File

@ -124,8 +124,8 @@ public:
const SkRect& devOutside, const SkRect& devInside)
: INHERITED(ClassID())
, fViewMatrix(viewMatrix) {
SkASSERT(!devOutside.isEmpty())
SkASSERT(!devInside.isEmpty())
SkASSERT(!devOutside.isEmpty());
SkASSERT(!devInside.isEmpty());
fGeoData.emplace_back(Geometry{color, devOutside, devOutside, devInside, false});
this->setBounds(devOutside, HasAABloat::kYes, IsZeroArea::kNo);

View File

@ -942,7 +942,7 @@ private:
SkDEBUGCODE(bool inPLSDraw = false;)
bool GrPLSPathRenderer::onDrawPath(const DrawPathArgs& args) {
SkASSERT(!args.fShape->isEmpty())
SkASSERT(!args.fShape->isEmpty());
SkASSERT(!inPLSDraw);
SkDEBUGCODE(inPLSDraw = true;)
SkPath path;

View File

@ -2769,7 +2769,7 @@ void GrGLGpu::draw(const GrPipeline& pipeline,
}
void GrGLGpu::stampPLSSetupRect(const SkRect& bounds) {
SkASSERT(this->glCaps().glslCaps()->plsPathRenderingSupport())
SkASSERT(this->glCaps().glslCaps()->plsPathRenderingSupport());
if (!fPLSSetupProgram.fProgram) {
if (!this->createPLSSetupProgram()) {

View File

@ -297,7 +297,7 @@ bool GrVkFreeListAlloc::alloc(VkDeviceSize requestedSize,
}
iter.next();
}
SkASSERT(largestSize == fLargestBlockSize)
SkASSERT(largestSize == fLargestBlockSize);
#endif
} else {
SkASSERT(bestFit->fSize == alignedSize);

View File

@ -72,7 +72,7 @@ public:
SkDEBUGPARAMS(int id));
void setCoinPtTEnd(const SkOpPtT* ptT) {
SkOPASSERT(ptT == ptT->span()->ptT())
SkOPASSERT(ptT == ptT->span()->ptT());
SkASSERT(!fCoinPtTStart || ptT->fT != fCoinPtTStart->fT);
SkASSERT(!fCoinPtTStart || fCoinPtTStart->segment() == ptT->segment());
fCoinPtTEnd = ptT;
@ -80,7 +80,7 @@ public:
}
void setCoinPtTStart(const SkOpPtT* ptT) {
SkASSERT(ptT == ptT->span()->ptT())
SkASSERT(ptT == ptT->span()->ptT());
SkASSERT(!fCoinPtTEnd || ptT->fT != fCoinPtTEnd->fT);
SkASSERT(!fCoinPtTEnd || fCoinPtTEnd->segment() == ptT->segment());
fCoinPtTStart = ptT;
@ -93,7 +93,7 @@ public:
}
void setOppPtTEnd(const SkOpPtT* ptT) {
SkOPASSERT(ptT == ptT->span()->ptT())
SkOPASSERT(ptT == ptT->span()->ptT());
SkASSERT(!fOppPtTStart || ptT->fT != fOppPtTStart->fT);
SkASSERT(!fOppPtTStart || fOppPtTStart->segment() == ptT->segment());
fOppPtTEnd = ptT;
@ -101,7 +101,7 @@ public:
}
void setOppPtTStart(const SkOpPtT* ptT) {
SkASSERT(ptT == ptT->span()->ptT())
SkASSERT(ptT == ptT->span()->ptT());
SkASSERT(!fOppPtTEnd || ptT->fT != fOppPtTEnd->fT);
SkASSERT(!fOppPtTEnd || fOppPtTEnd->segment() == ptT->segment());
fOppPtTStart = ptT;

View File

@ -822,7 +822,7 @@ void SkOpSegment::debugMissingCoincidence(const char* id, SkPathOpsDebug::Glitch
// coincidences->add(rootPriorPtT, rootPtT, rootOppStart, rootOppEnd);
// }
#if DEBUG_COINCIDENCE
// SkASSERT(coincidences->contains(rootPriorPtT, rootPtT, rootOppStart, rootOppEnd)
// SkASSERT(coincidences->contains(rootPriorPtT, rootPtT, rootOppStart, rootOppEnd);
#endif
// result = true;
}