Revision: 69038
          http://sourceforge.net/p/brlcad/code/69038
Author:   brlcad
Date:     2016-10-13 03:41:47 +0000 (Thu, 13 Oct 2016)
Log Message:
-----------
see if we can get away with not using a temporary variable, casting instead.  
the prior is often a trick to quell stubborn type conversion warnings, but 
doesn't 'seem' necessary here, not does a quick test demonstrate need.

Modified Paths:
--------------
    brlcad/trunk/include/bu/magic.h

Modified: brlcad/trunk/include/bu/magic.h
===================================================================
--- brlcad/trunk/include/bu/magic.h     2016-10-13 03:14:45 UTC (rev 69037)
+++ brlcad/trunk/include/bu/magic.h     2016-10-13 03:41:47 UTC (rev 69038)
@@ -235,12 +235,11 @@
 #ifdef NO_BOMBING_MACROS
 #  define BU_CKMAG(_ptr, _magic, _str) (void)(_ptr)
 #else
-#  define BU_CKMAG(_ptr, _magic, _str) { \
-        const uintptr_t _ptrval = (const uintptr_t)(_ptr); \
-        if (UNLIKELY((_ptrval == 0) || (_ptrval & (sizeof(_ptrval)-1)) || 
*((const uint32_t *)(_ptr)) != (uint32_t)(_magic))) { \
-            bu_badmagic((const uint32_t *)(_ptr), (uint32_t)_magic, _str, 
__FILE__, __LINE__); \
+#  define BU_CKMAG(_ptr, _magic, _str) do { \
+        if (UNLIKELY(((const uintptr_t)(_ptr) == 0) || ((const 
uintptr_t)(_ptr) & (sizeof((const uintptr_t)(_ptr))-1)) || *((const uint32_t 
*)(_ptr)) != (uint32_t)(_magic))) { \
+            bu_badmagic((const uint32_t *)(_ptr), (uint32_t)(_magic), _str, 
__FILE__, __LINE__); \
         } \
-    }
+    } while (0)
 #endif
 
 

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
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to