Revision: 54119
          http://brlcad.svn.sourceforge.net/brlcad/?rev=54119&view=rev
Author:   caen23
Date:     2012-12-27 18:46:09 +0000 (Thu, 27 Dec 2012)
Log Message:
-----------
Enable compilation with LLVM 3.1/Clang 4.1

Modified Paths:
--------------
    brlcad/trunk/include/bu.h
    brlcad/trunk/misc/CMake/CompilerFlags.cmake
    brlcad/trunk/src/liboptical/sh_light.c

Modified: brlcad/trunk/include/bu.h
===================================================================
--- brlcad/trunk/include/bu.h   2012-12-26 19:17:26 UTC (rev 54118)
+++ brlcad/trunk/include/bu.h   2012-12-27 18:46:09 UTC (rev 54119)
@@ -1162,7 +1162,7 @@
  * Files using BU_LIST_MAIN_PTR will need to include stddef.h
  */
 #define BU_LIST_MAIN_PTR(_type, _ptr2, _name2) \
-    ((struct _type *)(((char *)(_ptr2)) - offsetof(struct _type, 
_name2.magic)))
+    ((struct _type *)(((char *)(_ptr2)) - (offsetof(struct _type, _name2) + 
offsetof(struct bu_list, magic))))
 /** @} */
 
 
@@ -2090,13 +2090,8 @@
 /* FIXME - this is a temporary cast. The bu_structparse sp_offset member
  *         should be a size_t.
  */
-#ifndef offsetof
 #  define bu_offsetof(_t, _m) (size_t)(&(((_t *)0)->_m))
 #  define bu_offsetofarray(_t, _m) (size_t)((((_t *)0)->_m))
-#else
-#  define bu_offsetof(_t, _m) (long)offsetof(_t, _m)
-#  define bu_offsetofarray(_t, _m) (long)offsetof(_t, _m[0])
-#endif
 
 
 /**

Modified: brlcad/trunk/misc/CMake/CompilerFlags.cmake
===================================================================
--- brlcad/trunk/misc/CMake/CompilerFlags.cmake 2012-12-26 19:17:26 UTC (rev 
54118)
+++ brlcad/trunk/misc/CMake/CompilerFlags.cmake 2012-12-27 18:46:09 UTC (rev 
54119)
@@ -257,7 +257,7 @@
 # and use gnu99 here - c99 has problems on Linux.
 # BRLCAD_CHECK_C_FLAG("std=gnu1x")
 BRLCAD_CHECK_C_FLAG("std=gnu99" BUILD_TYPES Release VARS C99_FLAG)
-BRLCAD_CHECK_C_FLAG("std=gnu89" BUILD_TYPES Debug)
+BRLCAD_CHECK_C_FLAG("std=gnu99" BUILD_TYPES Debug VARS C99_FLAG)
 
 # Silence check for unused arguments (used to silence clang warnings about
 # unused options on the command line). By default clang generates a lot of

Modified: brlcad/trunk/src/liboptical/sh_light.c
===================================================================
--- brlcad/trunk/src/liboptical/sh_light.c      2012-12-26 19:17:26 UTC (rev 
54118)
+++ brlcad/trunk/src/liboptical/sh_light.c      2012-12-27 18:46:09 UTC (rev 
54119)
@@ -176,13 +176,10 @@
               LIGHT_O(lt_visible),
               LIGHT_O(lt_invisible));
     }
-    switch (sdp->sp_offset) {
-       case LIGHT_O(lt_invisible):
-           lsp->lt_visible = !lsp->lt_invisible;
-           break;
-       case LIGHT_O(lt_visible):
-           lsp->lt_invisible = !lsp->lt_visible;
-           break;
+    if(sdp->sp_offset == LIGHT_O(lt_invisible)) {
+        lsp->lt_visible = !lsp->lt_invisible;
+    } else if(sdp->sp_offset == LIGHT_O(lt_visible)) {
+        lsp->lt_invisible = !lsp->lt_visible;
     }
 }
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to