Skip to content

Commit 4387e3a

Browse files
committed
Use DBUG_ASSERT(ptr != NULL) to ease merging to 10.3
In 10.3, DBUG_ASSERT() may expand to something that includes __builtin_expect(), which expects integer arguments, not pointers. To avoid any compiler warnings, let us use an explicit rather than implicit comparison to the null pointer.
1 parent 5a4ae14 commit 4387e3a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/ilist.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ template <class T, class Tag= void> class ilist
7171
typedef T *pointer;
7272
typedef T &reference;
7373

74-
Iterator(ListNode *node) : node_(node) { DBUG_ASSERT(node_); }
74+
Iterator(ListNode *node) : node_(node) { DBUG_ASSERT(node_ != NULL); }
7575

7676
Iterator &operator++()
7777
{
7878
node_= node_->next;
79-
DBUG_ASSERT(node_);
79+
DBUG_ASSERT(node_ != NULL);
8080
return *this;
8181
}
8282
Iterator operator++(int)

0 commit comments

Comments
 (0)