fix some complier warnings and add -Wundef to CMake's default GCC warnings.
authorCampbell Barton <ideasman42@gmail.com>
Mon, 5 Sep 2011 23:40:52 +0000 (23:40 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 5 Sep 2011 23:40:52 +0000 (23:40 +0000)
CMakeLists.txt
intern/opennl/CMakeLists.txt
source/blender/blenkernel/intern/node.c
source/blender/editors/space_node/node_draw.c
source/blender/editors/space_node/node_edit.c
source/gameengine/Converter/BL_SkinDeformer.cpp
source/gameengine/Converter/KX_BlenderSceneConverter.cpp

index 38ce868..b54b18a 100644 (file)
@@ -1267,6 +1267,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
        ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_POINTER_ARITH -Wpointer-arith)
        ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNUSED_PARAMETER -Wunused-parameter)
        ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_WRITE_STRINGS -Wwrite-strings)
+       ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNDEFINED -Wundef)
        # disable because it gives warnings for printf() & friends.
        # ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_DOUBLE_PROMOTION -Wdouble-promotion -Wno-error=double-promotion)
        ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_ERROR_UNUSED_BUT_SET_VARIABLE -Wno-error=unused-but-set-variable)
@@ -1274,6 +1275,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
        ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ALL -Wall)
        ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_INVALID_OFFSETOF -Wno-invalid-offsetof)
        ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_SIGN_COMPARE -Wno-sign-compare)
+       ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNDEFINED -Wundef)
 
 elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
 
index 55b0bc5..7d6a579 100644 (file)
@@ -31,6 +31,13 @@ remove_strict_flags()
 # and debug gives a lot of prints on UV unwrapping. developers can enable if they need to.
 remove_flag("-DDEBUG")
 
+
+# quiet compiler warnings about undefined defines
+add_definitions(
+       -DDEBUGlevel=0
+       -DPRNTlevel=0
+)
+
 set(INC
        extern
        superlu
index 6f34383..481893b 100644 (file)
@@ -158,7 +158,7 @@ void ntreeInitTypes(bNodeTree *ntree)
        ntree->init |= NTREE_TYPE_INIT;
 }
 
-static bNodeSocket *make_socket(bNodeTree *ntree, int in_out, const char *name, int type)
+static bNodeSocket *make_socket(bNodeTree *UNUSED(ntree), int in_out, const char *name, int type)
 {
        bNodeSocketType *stype= ntreeGetSocketType(type);
        bNodeSocket *sock;
index ec118bb..6be8978 100644 (file)
@@ -549,7 +549,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
        bNodeSocket *sock;
        rctf *rct= &node->totr;
        float iconofs;
-       float socket_size= NODE_SOCKSIZE*U.dpi/72;
+       /* float socket_size= NODE_SOCKSIZE*U.dpi/72; */ /* UNUSED */
        float iconbutw= 0.8f*UI_UNIT_X;
        int color_id= node_get_colorid(node);
        char showname[128]; /* 128 used below */
index 214f375..b5633d5 100644 (file)
@@ -2175,7 +2175,6 @@ static int node_duplicate_exec(bContext *C, wmOperator *op)
        bNode *node, *newnode, *lastnode;
        bNodeLink *link, *newlink, *lastlink;
        int keep_inputs = RNA_boolean_get(op->ptr, "keep_inputs");
-       bNodeSocket *sock;
        
        ED_preview_kill_jobs(C);
        
index 3a379e8..98afcf8 100644 (file)
@@ -243,7 +243,6 @@ void BL_SkinDeformer::BGEDeformVerts()
        for (int i=0; i<m_bmesh->totvert; ++i)
        {
                float contrib = 0.f, weight, max_weight=0.f;
-               Bone *bone;
                bPoseChannel *pchan=NULL;
                MDeformVert *dvert;
                Eigen::Map<Eigen::Vector3f> norm(m_transnors[i]);
@@ -266,7 +265,6 @@ void BL_SkinDeformer::BGEDeformVerts()
                        if (index < numGroups && (pchan=m_dfnrToPC[index]))
                        {
                                weight = dvert->dw[j].weight;
-                               bone = pchan->bone;
 
                                if (weight)
                                {
index 7191730..656dcfa 100644 (file)
@@ -385,6 +385,12 @@ void KX_BlenderSceneConverter::ConvertScene(class KX_Scene* destinationscene,
        //This cache mecanism is buggy so I leave it disable and the memory leak
        //that would result from this is fixed in RemoveScene()
        m_map_mesh_to_gamemesh.clear();
+
+#ifndef USE_BULLET
+       /* quiet compiler warning */
+       (void)useDbvtCulling;
+#endif
+
 }
 
 // This function removes all entities stored in the converter for that scene