Replace assert with static_assert here applicable.
Replaces assert() with static_assert() if the condition is can be evaluated at compile time. llvm-svn: 360753
This commit is contained in:
@@ -1972,8 +1972,8 @@ bool RenderScriptRuntime::JITTypePacked(AllocationDetails *alloc,
|
||||
|
||||
// We want 4 elements from packed data
|
||||
const uint32_t num_exprs = 4;
|
||||
assert(num_exprs == (eExprTypeElemPtr - eExprTypeDimX + 1) &&
|
||||
"Invalid number of expressions");
|
||||
static_assert(num_exprs == (eExprTypeElemPtr - eExprTypeDimX + 1),
|
||||
"Invalid number of expressions");
|
||||
|
||||
char expr_bufs[num_exprs][jit_max_expr_size];
|
||||
uint64_t results[num_exprs];
|
||||
@@ -2031,8 +2031,8 @@ bool RenderScriptRuntime::JITElementPacked(Element &elem,
|
||||
|
||||
// We want 4 elements from packed data
|
||||
const uint32_t num_exprs = 4;
|
||||
assert(num_exprs == (eExprElementFieldCount - eExprElementType + 1) &&
|
||||
"Invalid number of expressions");
|
||||
static_assert(num_exprs == (eExprElementFieldCount - eExprElementType + 1),
|
||||
"Invalid number of expressions");
|
||||
|
||||
char expr_bufs[num_exprs][jit_max_expr_size];
|
||||
uint64_t results[num_exprs];
|
||||
@@ -2090,8 +2090,8 @@ bool RenderScriptRuntime::JITSubelements(Element &elem,
|
||||
}
|
||||
|
||||
const short num_exprs = 3;
|
||||
assert(num_exprs == (eExprSubelementsArrSize - eExprSubelementsId + 1) &&
|
||||
"Invalid number of expressions");
|
||||
static_assert(num_exprs == (eExprSubelementsArrSize - eExprSubelementsId + 1),
|
||||
"Invalid number of expressions");
|
||||
|
||||
char expr_buffer[jit_max_expr_size];
|
||||
uint64_t results;
|
||||
|
||||
Reference in New Issue
Block a user