fix some complier warnings and add -Wundef to CMake's default GCC warnings.

This commit is contained in:
Campbell Barton 2011-09-05 23:40:52 +00:00
parent 0c992c73a1
commit 0991bed413
7 changed files with 17 additions and 5 deletions

@ -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")

@ -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

@ -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;

@ -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 */

@ -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);

@ -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)
{

@ -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