Bug 1931877, part 3 - Add a "nothing" comment for all empty do loops in Assertions.h. r=glandium

My initial version of my patch for part 1 didn't have a "nothing" comment
because I copied the empty loop from somewhere that didn't have it. If
the comment is appropriate, let's make things consistent while I'm
touching this file anyways.

Differential Revision: https://phabricator.services.mozilla.com/D229500
This commit is contained in:
Andrew McCreight 2024-11-20 16:37:50 +00:00
parent 67817a936e
commit 221b1aac47

View File

@ -500,7 +500,7 @@ struct AssertionConditionType {
("MOZ_ASSERT", __VA_ARGS__))
#else
# define MOZ_ASSERT(...) \
do { \
do { /* nothing */ \
} while (false)
#endif /* DEBUG */
@ -511,7 +511,7 @@ struct AssertionConditionType {
("MOZ_DIAGNOSTIC_ASSERT", __VA_ARGS__))
#else
# define MOZ_DIAGNOSTIC_ASSERT(...) \
do { \
do { /* nothing */ \
} while (false)
#endif
@ -548,7 +548,7 @@ struct AssertionConditionType {
} while (false)
#else
# define MOZ_ASSERT_IF(cond, expr) \
do { \
do { /* nothing */ \
} while (false)
#endif
@ -568,7 +568,7 @@ struct AssertionConditionType {
} while (false)
#else
# define MOZ_DIAGNOSTIC_ASSERT_IF(cond, expr) \
do { \
do { /* nothing */ \
} while (false)
#endif
@ -690,10 +690,10 @@ struct AssertionConditionType {
*/
#ifdef FUZZING
# define MOZ_CRASH_UNLESS_FUZZING(...) \
do { \
do { /* nothing */ \
} while (0)
# define MOZ_ASSERT_UNLESS_FUZZING(...) \
do { \
do { /* nothing */ \
} while (0)
#else
# define MOZ_CRASH_UNLESS_FUZZING(...) MOZ_CRASH(__VA_ARGS__)