Revision: 76808
http://sourceforge.net/p/brlcad/code/76808
Author: brlcad
Date: 2020-08-16 18:53:14 +0000 (Sun, 16 Aug 2020)
Log Message:
-----------
try the same trick, casting NULL through to a uintptr_t. if the platform has a
non-zero null representation, it should trigger.
Modified Paths:
--------------
brlcad/trunk/include/bu/magic.h
Modified: brlcad/trunk/include/bu/magic.h
===================================================================
--- brlcad/trunk/include/bu/magic.h 2020-08-16 18:38:22 UTC (rev 76807)
+++ brlcad/trunk/include/bu/magic.h 2020-08-16 18:53:14 UTC (rev 76808)
@@ -241,7 +241,8 @@
# define BU_CKMAG(_ptr, _magic, _str) (void)(_ptr)
#else
# define BU_CKMAG(_ptr, _magic, _str) do { \
- if (UNLIKELY(( ((uintptr_t)(_ptr) == 0) /* non-zero pointer */ \
+ if (UNLIKELY(( ((uintptr_t)(_ptr) == (uintptr_t)NULL) /* non-NULL pointer
*/ \
+ || ((uintptr_t)(_ptr) == 0) /* non-zero pointer */ \
|| ((uintptr_t)(_ptr) & (sizeof((uintptr_t)(_ptr))-1)) /*
aligned ptr */ \
|| (*((const uint32_t *)(_ptr)) != (uint32_t)(_magic)) /*
matches value */ \
))) { \
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits