Fix incorrect use of BLI_assert with error strings

Some asserts were never raised because of invalid checks.
This commit is contained in:
Campbell Barton 2021-07-22 00:46:46 +10:00
parent 63da2c4082
commit 581a6da804
Notes: blender-bot 2023-02-14 09:34:18 +01:00
Referenced by issue #90155, Cleanup: Use BLI_assert_msg when using BLI_assert(..&&"")
5 changed files with 9 additions and 9 deletions

View File

@ -1947,7 +1947,7 @@ static void nlaevalchan_blendOrcombine(NlaEvalChannelSnapshot *lower_necs,
return;
}
default:
BLI_assert("Mix mode should've been handled");
BLI_assert_msg(0, "Mix mode should've been handled");
}
return;
}
@ -1960,7 +1960,7 @@ static void nlaevalchan_blendOrcombine(NlaEvalChannelSnapshot *lower_necs,
return;
}
default:
BLI_assert("Blend mode should've been handled");
BLI_assert_msg(0, "Blend mode should've been handled");
}
}
@ -2110,7 +2110,7 @@ static void nlaevalchan_blendOrcombine_get_inverted_upper_evalchan(
return;
}
default:
BLI_assert("Mix mode should've been handled");
BLI_assert_msg(0, "Mix mode should've been handled");
}
return;
}
@ -2123,7 +2123,7 @@ static void nlaevalchan_blendOrcombine_get_inverted_upper_evalchan(
return;
}
default:
BLI_assert("Blend mode should've been handled");
BLI_assert_msg(0, "Blend mode should've been handled");
}
}

View File

@ -532,7 +532,7 @@ bool BLI_task_pool_current_canceled(TaskPool *pool)
case TASK_POOL_BACKGROUND_SERIAL:
return background_task_pool_canceled(pool);
}
BLI_assert("BLI_task_pool_canceled: Control flow should not come here!");
BLI_assert_msg(0, "BLI_task_pool_canceled: Control flow should not come here!");
return false;
}

View File

@ -143,7 +143,7 @@ void RenderLayersNode::missingSocketLink(NodeConverter &converter, NodeOutput *o
break;
}
default: {
BLI_assert("!Unexpected data type");
BLI_assert_msg(0, "Unexpected data type");
return;
}
}

View File

@ -147,7 +147,7 @@ static bool drw_draw_show_annotation(void)
* the draw manager is only used to draw the background. */
return false;
default:
BLI_assert("");
BLI_assert(0);
return false;
}
}

View File

@ -62,7 +62,7 @@ Cell *FastGrid::getCell(const Vec3u &p)
<< " " << _cells_size << endl;
}
#endif
BLI_assert(_cells || ("_cells is a null pointer"));
BLI_assert_msg(_cells, "_cells is a null pointer");
BLI_assert((_cells_nb[0] * (p[2] * _cells_nb[1] + p[1]) + p[0]) < _cells_size);
BLI_assert(p[0] < _cells_nb[0]);
BLI_assert(p[1] < _cells_nb[1]);
@ -72,7 +72,7 @@ Cell *FastGrid::getCell(const Vec3u &p)
void FastGrid::fillCell(const Vec3u &p, Cell &cell)
{
BLI_assert(_cells || ("_cells is a null pointer"));
BLI_assert_msg(_cells, "_cells is a null pointer");
BLI_assert((_cells_nb[0] * (p[2] * _cells_nb[1] + p[1]) + p[0]) < _cells_size);
BLI_assert(p[0] < _cells_nb[0]);
BLI_assert(p[1] < _cells_nb[1]);