Revision: 69014
http://sourceforge.net/p/brlcad/code/69014
Author: brlcad
Date: 2016-10-11 03:39:03 +0000 (Tue, 11 Oct 2016)
Log Message:
-----------
this is better since uintptr_t will hold the whole address and size_t will not
necessarily, but still doubting the utility/correctness of the alignment check
Modified Paths:
--------------
brlcad/trunk/src/libbu/badmagic.c
Modified: brlcad/trunk/src/libbu/badmagic.c
===================================================================
--- brlcad/trunk/src/libbu/badmagic.c 2016-10-11 03:37:24 UTC (rev 69013)
+++ brlcad/trunk/src/libbu/badmagic.c 2016-10-11 03:39:03 UTC (rev 69014)
@@ -35,7 +35,7 @@
if (UNLIKELY(!(ptr))) {
snprintf(buf, MAGICBUFSIZ, "ERROR: NULL %s pointer, file %s, line %d\n",
str, file, line);
- } else if (UNLIKELY(((size_t)(ptr)) & (sizeof(size_t)-1))) {
+ } else if (UNLIKELY((ptr) & (sizeof(uintptr_t)-1))) {
snprintf(buf, MAGICBUFSIZ, "ERROR: %p mis-aligned %s pointer, file %s,
line %d\n",
(void *)ptr, str, file, line);
} else if (UNLIKELY(*(ptr) != (uint32_t)(magic))) {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits