diff --git a/dtool/src/cppparser/cppFunctionType.cxx b/dtool/src/cppparser/cppFunctionType.cxx index 38eb3d98ba..497c46d4b9 100644 --- a/dtool/src/cppparser/cppFunctionType.cxx +++ b/dtool/src/cppparser/cppFunctionType.cxx @@ -71,17 +71,19 @@ operator = (const CPPFunctionType ©) { */ bool CPPFunctionType:: accepts_num_parameters(int num_parameters) { + assert(num_parameters >= 0); if (_parameters == NULL) { return (num_parameters == 0); } + size_t actual_num_parameters = _parameters->_parameters.size(); // If we passed too many parameters, it must have an ellipsis. - if (num_parameters > actual_num_parameters) { + if ((size_t)num_parameters > actual_num_parameters) { return _parameters->_includes_ellipsis; } // Make sure all superfluous parameters have a default value. - for (size_t i = num_parameters; i < actual_num_parameters; ++i) { + for (size_t i = (size_t)num_parameters; i < actual_num_parameters; ++i) { CPPInstance *param = _parameters->_parameters[i]; if (param->_initializer == NULL) { return false; diff --git a/dtool/src/cppparser/cppPreprocessor.cxx b/dtool/src/cppparser/cppPreprocessor.cxx index ecaecb98b6..899d1f076f 100644 --- a/dtool/src/cppparser/cppPreprocessor.cxx +++ b/dtool/src/cppparser/cppPreprocessor.cxx @@ -1579,7 +1579,6 @@ handle_if_directive(const string &args, const YYLTYPE &loc) { */ void CPPPreprocessor:: handle_include_directive(const string &args, const YYLTYPE &loc) { - bool okflag = false; Filename filename; Filename filename_as_referenced; bool angle_quotes = false; @@ -1599,7 +1598,6 @@ handle_include_directive(const string &args, const YYLTYPE &loc) { if (!expr.empty()) { if (expr[0] == '"' && expr[expr.size() - 1] == '"') { filename = expr.substr(1, expr.size() - 2); - okflag = true; if (_files.size() == 1) { // If we're currently processing a top-level file, record the include @@ -1614,7 +1612,6 @@ handle_include_directive(const string &args, const YYLTYPE &loc) { // same, as if they used quote marks. angle_quotes = true; } - okflag = true; if (_files.size() == 1) { // If we're currently processing a top-level file, record the include @@ -2552,7 +2549,7 @@ get_number(int c) { loc.last_column = get_col_number(); YYSTYPE result; - result.u.real = pstrtod(num.c_str(), (char **)NULL); + result.u.real = (long double)pstrtod(num.c_str(), (char **)NULL); return get_literal(REAL, loc, num, result); } diff --git a/dtool/src/dconfig/dconfig.I b/dtool/src/dconfig/dconfig.I index a49d57cd2c..0497ffc067 100644 --- a/dtool/src/dconfig/dconfig.I +++ b/dtool/src/dconfig/dconfig.I @@ -25,7 +25,7 @@ GetInt(const string &sym, int def) { float DConfig:: GetFloat(const string &sym, float def) { - ConfigVariableDouble var(sym, def, "DConfig", ConfigFlags::F_dconfig); + ConfigVariableDouble var(sym, (double)def, "DConfig", ConfigFlags::F_dconfig); return (float)var.get_value(); } diff --git a/dtool/src/dtoolutil/executionEnvironment.cxx b/dtool/src/dtoolutil/executionEnvironment.cxx index 9a2921efd2..2ede3b7253 100644 --- a/dtool/src/dtoolutil/executionEnvironment.cxx +++ b/dtool/src/dtoolutil/executionEnvironment.cxx @@ -755,10 +755,10 @@ read_args() { if (_binary_name.empty()) { _binary_name = buffer; } - int idx = strlen(buffer) + 1; + size_t idx = strlen(buffer) + 1; while (idx < bufsize) { _args.push_back((char*)(buffer + idx)); - int newidx = strlen(buffer + idx); + size_t newidx = strlen(buffer + idx); idx += newidx + 1; } } diff --git a/dtool/src/dtoolutil/string_utils.I b/dtool/src/dtoolutil/string_utils.I index e4e71766f8..f7878c3ba8 100644 --- a/dtool/src/dtoolutil/string_utils.I +++ b/dtool/src/dtoolutil/string_utils.I @@ -32,7 +32,7 @@ format_string(bool value) { INLINE string format_string(float value) { char buffer[32]; - pdtoa(value, buffer); + pdtoa((double)value, buffer); return string(buffer); } diff --git a/dtool/src/interrogate/functionRemap.cxx b/dtool/src/interrogate/functionRemap.cxx index 42a420644f..7299d9b5f8 100644 --- a/dtool/src/interrogate/functionRemap.cxx +++ b/dtool/src/interrogate/functionRemap.cxx @@ -767,12 +767,12 @@ setup_properties(const InterrogateFunction &ifunc, InterfaceMaker *interface_mak } // Check for a special meaning by name and signature. - int first_param = 0; + size_t first_param = 0; if (_has_this) { first_param = 1; } - if (_parameters.size() > (size_t)first_param && _parameters[first_param]._name == "self" && + if (_parameters.size() > first_param && _parameters[first_param]._name == "self" && TypeManager::is_pointer_to_PyObject(_parameters[first_param]._remap->get_orig_type())) { // Here's a special case. If the first parameter of a nonstatic method // is a PyObject * called "self", then we will automatically fill it in @@ -782,9 +782,9 @@ setup_properties(const InterrogateFunction &ifunc, InterfaceMaker *interface_mak _flags |= F_explicit_self; } - if ((int)_parameters.size() == first_param) { + if (_parameters.size() == first_param) { _args_type = InterfaceMaker::AT_no_args; - } else if ((int)_parameters.size() == first_param + 1 && + } else if (_parameters.size() == first_param + 1 && _parameters[first_param]._remap->get_default_value() == NULL) { _args_type = InterfaceMaker::AT_single_arg; } else { @@ -833,7 +833,7 @@ setup_properties(const InterrogateFunction &ifunc, InterfaceMaker *interface_mak } } else if (fname == "size" || fname == "__len__") { - if ((int)_parameters.size() == first_param && + if (_parameters.size() == first_param && TypeManager::is_integer(_return_type->get_new_type())) { // It receives no parameters, and returns an integer. _flags |= F_size; @@ -847,7 +847,7 @@ setup_properties(const InterrogateFunction &ifunc, InterfaceMaker *interface_mak } } else if (fname == "__iter__") { - if ((int)_parameters.size() == first_param && + if (_parameters.size() == first_param && TypeManager::is_pointer(_return_type->get_new_type())) { // It receives no parameters, and returns a pointer. _flags |= F_iter; @@ -870,7 +870,7 @@ setup_properties(const InterrogateFunction &ifunc, InterfaceMaker *interface_mak if (_args_type == InterfaceMaker::AT_varargs) { // Of course methods named "make" can still take kwargs, if they are // named. - for (int i = first_param; i < _parameters.size(); ++i) { + for (size_t i = first_param; i < _parameters.size(); ++i) { if (_parameters[i]._has_name) { _args_type = InterfaceMaker::AT_keyword_args; break; @@ -904,7 +904,7 @@ setup_properties(const InterrogateFunction &ifunc, InterfaceMaker *interface_mak if (_args_type == InterfaceMaker::AT_varargs) { // Every other method can take keyword arguments, if they take more // than one argument, and the arguments are named. - for (int i = first_param; i < _parameters.size(); ++i) { + for (size_t i = first_param; i < _parameters.size(); ++i) { if (_parameters[i]._has_name) { _args_type |= InterfaceMaker::AT_keyword_args; break; @@ -960,7 +960,7 @@ setup_properties(const InterrogateFunction &ifunc, InterfaceMaker *interface_mak // Constructors always take varargs, and possibly keyword args. _args_type = InterfaceMaker::AT_varargs; - for (int i = first_param; i < _parameters.size(); ++i) { + for (size_t i = first_param; i < _parameters.size(); ++i) { if (_parameters[i]._has_name) { _args_type = InterfaceMaker::AT_keyword_args; break; diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index 3fd5d0245a..5d202167d4 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -3610,8 +3610,8 @@ write_function_for_name(ostream &out, Object *obj, std::set::iterator sii; for (sii = mii->second.begin(); sii != mii->second.end(); ++sii) { remap = (*sii); - int first_param = remap->_has_this ? 1 : 0; - for (int i = first_param; i < remap->_parameters.size(); ++i) { + size_t first_param = remap->_has_this ? 1u : 0u; + for (size_t i = first_param; i < remap->_parameters.size(); ++i) { if (remap->_parameters[i]._has_name) { strip_keyword_args = false; break; diff --git a/dtool/src/interrogatedb/dtool_super_base.cxx b/dtool/src/interrogatedb/dtool_super_base.cxx index 26b57a157d..610d89da8b 100644 --- a/dtool/src/interrogatedb/dtool_super_base.cxx +++ b/dtool/src/interrogatedb/dtool_super_base.cxx @@ -26,7 +26,7 @@ static PyObject *GetSuperBase(PyObject *self) { PyMethodDef Dtool_Methods_DTOOL_SUPER_BASE[] = { { "DtoolGetSuperBase", (PyCFunction) &GetSuperBase, METH_NOARGS, "Will Return SUPERbase Class"}, - { NULL, NULL } + { nullptr, nullptr, 0, nullptr } }; EXPCL_INTERROGATEDB void Dtool_PyModuleClassInit_DTOOL_SUPER_BASE(PyObject *module) { diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index b46f8186ac..80b551c84f 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -1357,6 +1357,13 @@ def CompileCxx(obj,src,opts): # Enable more warnings. cmd += " -Wall -Wno-reorder -Wno-unused-function" + if not src.endswith(".c"): + cmd += " -Wno-reorder" + + # Ignore unused variables in NDEBUG builds, often used in asserts. + if optlevel == 4: + cmd += " -Wno-unused-variable" + if src.endswith(".c"): cmd += ' ' + CFLAGS else: diff --git a/panda/src/bullet/bulletConvexHullShape.cxx b/panda/src/bullet/bulletConvexHullShape.cxx index 07d559c2fd..798aeda9e1 100644 --- a/panda/src/bullet/bulletConvexHullShape.cxx +++ b/panda/src/bullet/bulletConvexHullShape.cxx @@ -130,13 +130,11 @@ add_geom(const Geom *geom, const TransformState *ts) { #if BT_BULLET_VERSION >= 282 for (it = points.begin(); it != points.end(); ++it) { - LVecBase3 v = *it; _shape->addPoint(LVecBase3_to_btVector3(*it), false); } _shape->recalcLocalAabb(); #else for (it = points.begin(); it != points.end(); ++it) { - LVecBase3 v = *it; _shape->addPoint(LVecBase3_to_btVector3(*it)); } #endif diff --git a/panda/src/collide/collisionHandlerFluidPusher.cxx b/panda/src/collide/collisionHandlerFluidPusher.cxx index 476aacb82b..9e4e95f5b0 100644 --- a/panda/src/collide/collisionHandlerFluidPusher.cxx +++ b/panda/src/collide/collisionHandlerFluidPusher.cxx @@ -213,11 +213,11 @@ handle_entries() { prev_trans = prev_trans->set_pos(contact_pos); from_node_path.set_prev_transform(wrt_node, prev_trans); - { - //const LPoint3 new_pos(from_node_path.get_pos(wrt_node)); + /*{ + const LPoint3 new_pos(from_node_path.get_pos(wrt_node)); CPT(TransformState) new_prev_trans(from_node_path.get_prev_transform(wrt_node)); const LPoint3 new_prev_pos(new_prev_trans->get_pos()); - } + }*/ // recalculate the position delta N = from_node_path.get_pos_delta(wrt_node); diff --git a/panda/src/egg2pg/eggSaver.cxx b/panda/src/egg2pg/eggSaver.cxx index 43dcb06a5b..ab56a074dd 100644 --- a/panda/src/egg2pg/eggSaver.cxx +++ b/panda/src/egg2pg/eggSaver.cxx @@ -860,8 +860,6 @@ convert_primitive(const GeomVertexData *vertex_data, } } - LNormal normal; - LColor color; CPT(TransformBlendTable) transformBlendTable = vertex_data->get_transform_blend_table(); int num_primitives = primitive->get_num_primitives(); diff --git a/panda/src/express/datagram.I b/panda/src/express/datagram.I index 499bfab48b..cac87f1111 100644 --- a/panda/src/express/datagram.I +++ b/panda/src/express/datagram.I @@ -157,9 +157,9 @@ add_float64(PN_float64 value) { INLINE void Datagram:: add_stdfloat(PN_stdfloat value) { if (_stdfloat_double) { - add_float64(value); + add_float64((double)value); } else { - add_float32(value); + add_float32((float)value); } } diff --git a/panda/src/grutil/meshDrawer.h b/panda/src/grutil/meshDrawer.h index 1b391210f6..e959b37c24 100644 --- a/panda/src/grutil/meshDrawer.h +++ b/panda/src/grutil/meshDrawer.h @@ -107,8 +107,6 @@ private: GeomVertexRewriter *_color; // billboard vectors - LVector4 _colorv; - LVector3 _normalv; LVector3 _eyePos; LVector3 _b1, _b2, _b3, _b4; LVector3 _up, _right; diff --git a/panda/src/grutil/pfmVizzer.cxx b/panda/src/grutil/pfmVizzer.cxx index 9bd440a0c3..72a0cbf7a2 100644 --- a/panda/src/grutil/pfmVizzer.cxx +++ b/panda/src/grutil/pfmVizzer.cxx @@ -323,8 +323,7 @@ generate_vis_points() const { NodePath PfmVizzer:: generate_vis_mesh(MeshFace face) const { nassertr(_pfm.is_valid(), NodePath()); - bool check_aux_pfm = uses_aux_pfm(); - nassertr(!check_aux_pfm || (_aux_pfm != NULL && _aux_pfm->is_valid()), NodePath()); + nassertr(!uses_aux_pfm() || (_aux_pfm != NULL && _aux_pfm->is_valid()), NodePath()); nassertr(face != 0, NodePath()); if (_pfm.get_num_channels() == 1 && _vis_columns.empty()) { diff --git a/panda/src/mathutil/triangulator.cxx b/panda/src/mathutil/triangulator.cxx index a0c1ad9ad5..fabfe31147 100644 --- a/panda/src/mathutil/triangulator.cxx +++ b/panda/src/mathutil/triangulator.cxx @@ -867,7 +867,7 @@ add_segment(int segnum) { int tfirstr = 0, tlastr = 0, tfirstl = 0, tlastl = 0; int i1, i2, t, tn; // t1, t2, point_t tpt; - int tritop = 0, tribot = 0, is_swapped = 0; + int tribot = 0, is_swapped = 0; int tmptriseg; s = seg[segnum]; @@ -939,7 +939,6 @@ add_segment(int segnum) { else /* v0 already present */ { /* Get the topmost intersecting trapezoid */ tfirst = locate_endpoint(&s.v0, &s.v1, s.root0); - tritop = 1; } @@ -1294,16 +1293,13 @@ add_segment(int segnum) { // int tmpseg = tr[tr[t].d0].rseg; double y0, yt; point_t tmppt; - int tnext, i_d0, i_d1; + int tnext, i_d0; - i_d1 = false; i_d0 = false; if (FP_EQUAL(tr[t].lo.y, s.v0.y)) { if (tr[t].lo.x > s.v0.x) i_d0 = true; - else - i_d1 = true; } else { @@ -1314,8 +1310,6 @@ add_segment(int segnum) { if (_less_than(&tmppt, &tr[t].lo)) i_d0 = true; - else - i_d1 = true; } /* check continuity from the top so that the lower-neighbour */ @@ -1792,7 +1786,6 @@ traverse_polygon(int mcur, int trnum, int from, int dir) { int mnew; int v0, v1; //, v0next, v1next; int retval = 0; //, tmp; - int do_switch = false; // printf("visited size = %d, visited[trnum] = %d\n", visited.size(), // visited[trnum]); @@ -1817,7 +1810,6 @@ traverse_polygon(int mcur, int trnum, int from, int dir) { v1 = t->lseg; if (from == t->d1) { - do_switch = true; mnew = make_new_monotone_poly(mcur, v1, v0); traverse_polygon(mcur, t->d1, trnum, TR_FROM_UP); traverse_polygon(mnew, t->d0, trnum, TR_FROM_UP); @@ -1847,7 +1839,6 @@ traverse_polygon(int mcur, int trnum, int from, int dir) { v1 = tr[t->u0].rseg; if (from == t->u1) { - do_switch = true; mnew = make_new_monotone_poly(mcur, v1, v0); traverse_polygon(mcur, t->u1, trnum, TR_FROM_DN); traverse_polygon(mnew, t->u0, trnum, TR_FROM_DN); @@ -1879,7 +1870,6 @@ traverse_polygon(int mcur, int trnum, int from, int dir) { if (((dir == TR_FROM_DN) && (t->d1 == from)) || ((dir == TR_FROM_UP) && (t->u1 == from))) { - do_switch = true; mnew = make_new_monotone_poly(mcur, v1, v0); traverse_polygon(mcur, t->u1, trnum, TR_FROM_DN); traverse_polygon(mcur, t->d1, trnum, TR_FROM_UP); @@ -1905,7 +1895,6 @@ traverse_polygon(int mcur, int trnum, int from, int dir) { retval = SP_2UP_LEFT; if ((dir == TR_FROM_UP) && (t->u0 == from)) { - do_switch = true; mnew = make_new_monotone_poly(mcur, v1, v0); traverse_polygon(mcur, t->u0, trnum, TR_FROM_DN); traverse_polygon(mnew, t->d0, trnum, TR_FROM_UP); @@ -1928,7 +1917,6 @@ traverse_polygon(int mcur, int trnum, int from, int dir) { retval = SP_2UP_RIGHT; if ((dir == TR_FROM_UP) && (t->u1 == from)) { - do_switch = true; mnew = make_new_monotone_poly(mcur, v1, v0); traverse_polygon(mcur, t->u1, trnum, TR_FROM_DN); traverse_polygon(mnew, t->d1, trnum, TR_FROM_UP); @@ -1957,7 +1945,6 @@ traverse_polygon(int mcur, int trnum, int from, int dir) { retval = SP_2DN_LEFT; if (!((dir == TR_FROM_DN) && (t->d0 == from))) { - do_switch = true; mnew = make_new_monotone_poly(mcur, v1, v0); traverse_polygon(mcur, t->u1, trnum, TR_FROM_DN); traverse_polygon(mcur, t->d1, trnum, TR_FROM_UP); @@ -1981,7 +1968,6 @@ traverse_polygon(int mcur, int trnum, int from, int dir) { retval = SP_2DN_RIGHT; if ((dir == TR_FROM_DN) && (t->d1 == from)) { - do_switch = true; mnew = make_new_monotone_poly(mcur, v1, v0); traverse_polygon(mcur, t->d1, trnum, TR_FROM_UP); traverse_polygon(mnew, t->u1, trnum, TR_FROM_DN); @@ -2008,7 +1994,6 @@ traverse_polygon(int mcur, int trnum, int from, int dir) { retval = SP_SIMPLE_LRDN; if (dir == TR_FROM_UP) { - do_switch = true; mnew = make_new_monotone_poly(mcur, v1, v0); traverse_polygon(mcur, t->u0, trnum, TR_FROM_DN); traverse_polygon(mcur, t->u1, trnum, TR_FROM_DN); @@ -2033,7 +2018,6 @@ traverse_polygon(int mcur, int trnum, int from, int dir) { retval = SP_SIMPLE_LRUP; if (dir == TR_FROM_UP) { - do_switch = true; mnew = make_new_monotone_poly(mcur, v1, v0); traverse_polygon(mcur, t->u0, trnum, TR_FROM_DN); traverse_polygon(mcur, t->u1, trnum, TR_FROM_DN); diff --git a/panda/src/ode/odeTriMeshData.cxx b/panda/src/ode/odeTriMeshData.cxx index a87853c4bb..0c04196833 100644 --- a/panda/src/ode/odeTriMeshData.cxx +++ b/panda/src/ode/odeTriMeshData.cxx @@ -229,7 +229,7 @@ process_primitive(const GeomPrimitive *primitive, CPT(GeomVertexData) vData) { GeomVertexReader vReader(vData, "vertex"); GeomVertexReader nReader(vData, "normal"); - LVecBase3f vertex, normal; + LVecBase3f vertex; // CPT(GeomPrimitive) dPrimitive = primitive->decompose(); CPT(GeomPrimitive) dPrimitive = primitive; ostream &out = odetrimeshdata_cat.debug(); diff --git a/panda/src/pgraph/fog.cxx b/panda/src/pgraph/fog.cxx index 06c831f337..654c6fd613 100644 --- a/panda/src/pgraph/fog.cxx +++ b/panda/src/pgraph/fog.cxx @@ -136,7 +136,6 @@ void Fog:: adjust_to_camera(const TransformState *camera_transform) { LVector3 forward = LVector3::forward(); - LPoint3 onset_point, opaque_point; if (get_num_parents() != 0) { // Linear fog is relative to the fog's net transform in the scene graph. NodePath this_np(this); diff --git a/panda/src/pgui/pgScrollFrame.h b/panda/src/pgui/pgScrollFrame.h index 7dfae33d1b..c60a161a78 100644 --- a/panda/src/pgui/pgScrollFrame.h +++ b/panda/src/pgui/pgScrollFrame.h @@ -94,8 +94,6 @@ private: bool _needs_recompute_clip; bool _needs_recompute_canvas; - LVecBase4 _orig_clip_frame; - bool _has_virtual_frame; LVecBase4 _virtual_frame; diff --git a/panda/src/physics/baseIntegrator.cxx b/panda/src/physics/baseIntegrator.cxx index f0cbe93893..ca5ec4faad 100644 --- a/panda/src/physics/baseIntegrator.cxx +++ b/panda/src/physics/baseIntegrator.cxx @@ -40,16 +40,13 @@ precompute_linear_matrices(Physical *physical, const LinearForceVector &forces) { nassertv(physical); // make sure the physical's in the scene graph, somewhere. - PhysicalNode *physical_node = physical->get_physical_node(); - nassertv(physical_node); + nassertv(physical->get_physical_node() != nullptr); // by global forces, we mean forces not contained in the physical - int global_force_vec_size = forces.size(); + size_t global_force_vec_size = forces.size(); // by local forces, we mean members of the physical's force set. - int local_force_vec_size = physical->get_linear_forces().size(); - - ForceNode *force_node; + size_t local_force_vec_size = physical->get_linear_forces().size(); // prepare the vector _precomputed_linear_matrices.clear(); @@ -63,8 +60,7 @@ precompute_linear_matrices(Physical *physical, LinearForceVector::const_iterator fi; for (fi = forces.begin(); fi != forces.end(); ++fi) { // LinearForce *cur_force = *fi; - force_node = (*fi)->get_force_node(); - nassertv(force_node != (ForceNode *) NULL); + nassertv((*fi)->get_force_node() != nullptr); NodePath force_np = (*fi)->get_force_node_path(); _precomputed_linear_matrices.push_back( @@ -74,8 +70,7 @@ precompute_linear_matrices(Physical *physical, // tally the local xforms const LinearForceVector &force_vector = physical->get_linear_forces(); for (fi = force_vector.begin(); fi != force_vector.end(); ++fi) { - force_node = (*fi)->get_force_node(); - nassertv(force_node != (ForceNode *) NULL); + nassertv((*fi)->get_force_node() != nullptr); NodePath force_np = (*fi)->get_force_node_path(); _precomputed_linear_matrices.push_back( @@ -93,16 +88,13 @@ precompute_angular_matrices(Physical *physical, const AngularForceVector &forces) { nassertv(physical); // make sure the physical's in the scene graph, somewhere. - PhysicalNode *physical_node = physical->get_physical_node(); - nassertv(physical_node != NULL); + nassertv(physical->get_physical_node() != nullptr); // by global forces, we mean forces not contained in the physical - int global_force_vec_size = forces.size(); + size_t global_force_vec_size = forces.size(); // by local forces, we mean members of the physical's force set. - int local_force_vec_size = physical->get_angular_forces().size(); - - ForceNode *force_node; + size_t local_force_vec_size = physical->get_angular_forces().size(); // prepare the vector _precomputed_angular_matrices.clear(); @@ -115,8 +107,7 @@ precompute_angular_matrices(Physical *physical, // tally the global xforms AngularForceVector::const_iterator fi; for (fi = forces.begin(); fi != forces.end(); ++fi) { - force_node = (*fi)->get_force_node(); - nassertv(force_node != (ForceNode *) NULL); + nassertv((*fi)->get_force_node() != nullptr); NodePath force_np = (*fi)->get_force_node_path(); _precomputed_angular_matrices.push_back( @@ -126,8 +117,7 @@ precompute_angular_matrices(Physical *physical, // tally the local xforms const AngularForceVector &force_vector = physical->get_angular_forces(); for (fi = force_vector.begin(); fi != force_vector.end(); ++fi) { - force_node = (*fi)->get_force_node(); - nassertv(force_node != (ForceNode *) NULL); + nassertv((*fi)->get_force_node() != nullptr); NodePath force_np = (*fi)->get_force_node_path(); _precomputed_angular_matrices.push_back( diff --git a/panda/src/physics/physicsManager.I b/panda/src/physics/physicsManager.I index e9c128c641..6b2c94c94c 100644 --- a/panda/src/physics/physicsManager.I +++ b/panda/src/physics/physicsManager.I @@ -57,7 +57,7 @@ attach_physicalnode(PhysicalNode *p) { INLINE void PhysicsManager:: attach_physical_node(PhysicalNode *p) { nassertv(p); - for (int i = 0; i < p->get_num_physicals(); ++i) { + for (size_t i = 0; i < p->get_num_physicals(); ++i) { attach_physical(p->get_physical(i)); } } diff --git a/panda/src/physics/physicsManager.cxx b/panda/src/physics/physicsManager.cxx index 60d237d167..7bd75bec33 100644 --- a/panda/src/physics/physicsManager.cxx +++ b/panda/src/physics/physicsManager.cxx @@ -110,7 +110,7 @@ remove_physical(Physical *p) { void PhysicsManager:: remove_physical_node(PhysicalNode *p) { nassertv(p); - for (int i = 0; i < p->get_num_physicals(); ++i) { + for (size_t i = 0; i < p->get_num_physicals(); ++i) { remove_physical(p->get_physical(i)); } } diff --git a/panda/src/text/staticTextFont.cxx b/panda/src/text/staticTextFont.cxx index 88f4186ad7..2a06033f2f 100644 --- a/panda/src/text/staticTextFont.cxx +++ b/panda/src/text/staticTextFont.cxx @@ -248,7 +248,7 @@ find_character_gsets(PandaNode *root, CPT(Geom) &ch, CPT(Geom) &dot, const Geom *geom = geode->get_geom(i); bool found_points = false; - for (int j = 0; j < geom->get_num_primitives() && !found_points; j++) { + for (size_t j = 0; j < geom->get_num_primitives() && !found_points; ++j) { const GeomPrimitive *primitive = geom->get_primitive(j); if (primitive->is_of_type(GeomPoints::get_class_type())) { dot = geom; diff --git a/panda/src/tinydisplay/tinyGraphicsStateGuardian.cxx b/panda/src/tinydisplay/tinyGraphicsStateGuardian.cxx index a9c6b113a2..07f7ad4e6b 100644 --- a/panda/src/tinydisplay/tinyGraphicsStateGuardian.cxx +++ b/panda/src/tinydisplay/tinyGraphicsStateGuardian.cxx @@ -697,7 +697,6 @@ begin_draw_primitives(const GeomPipelineReader *geom_reader, // Texture coordinates. for (int si = 0; si < max_stage_index; ++si) { - LTexCoord d; (*texgen_func[si])(v->tex_coord[si], tcdata[si]); } diff --git a/panda/src/tinydisplay/ztriangle.h b/panda/src/tinydisplay/ztriangle.h index c8fdfc4c53..9b2db10f2d 100644 --- a/panda/src/tinydisplay/ztriangle.h +++ b/panda/src/tinydisplay/ztriangle.h @@ -348,10 +348,10 @@ int n; #ifdef INTERP_Z ZPOINT *pz; - unsigned int z,zz; + UNUSED unsigned int z,zz; #endif #ifdef INTERP_RGB - unsigned int or1,og1,ob1,oa1; + UNUSED unsigned int or1,og1,ob1,oa1; #endif #ifdef INTERP_ST unsigned int s,t; diff --git a/panda/src/tinydisplay/ztriangle_two.h b/panda/src/tinydisplay/ztriangle_two.h index 647dcba605..b8baba23c2 100644 --- a/panda/src/tinydisplay/ztriangle_two.h +++ b/panda/src/tinydisplay/ztriangle_two.h @@ -31,7 +31,7 @@ static void FNAME(flat_untextured) (ZBuffer *zb, ZBufferPoint *p0,ZBufferPoint *p1,ZBufferPoint *p2) { - int color; + UNUSED int color; int or0, og0, ob0, oa0; #define INTERP_Z diff --git a/pandatool/src/gtk-stats/gtkStatsLabel.cxx b/pandatool/src/gtk-stats/gtkStatsLabel.cxx index 846aeb8a15..e5a81afbfe 100644 --- a/pandatool/src/gtk-stats/gtkStatsLabel.cxx +++ b/pandatool/src/gtk-stats/gtkStatsLabel.cxx @@ -117,6 +117,14 @@ get_collector_index() const { return _collector_index; } +/** + * Returns the thread index. + */ +int GtkStatsLabel:: +get_thread_index() const { + return _thread_index; +} + /** * Enables or disables the visual highlight for this label. */ diff --git a/pandatool/src/gtk-stats/gtkStatsLabel.h b/pandatool/src/gtk-stats/gtkStatsLabel.h index 80f697dc4f..bf4834985e 100644 --- a/pandatool/src/gtk-stats/gtkStatsLabel.h +++ b/pandatool/src/gtk-stats/gtkStatsLabel.h @@ -36,6 +36,7 @@ public: int get_height() const; int get_collector_index() const; + int get_thread_index() const; void set_highlight(bool highlight); bool get_highlight() const; diff --git a/pandatool/src/objegg/objToEggConverter.cxx b/pandatool/src/objegg/objToEggConverter.cxx index c6df68710c..5444463a79 100644 --- a/pandatool/src/objegg/objToEggConverter.cxx +++ b/pandatool/src/objegg/objToEggConverter.cxx @@ -270,7 +270,6 @@ process_ref_plane_res(const string &line) { } bool okflag = true; - LPoint3d pos; okflag &= string_to_double(words[1], _ref_plane_res[0]); okflag &= string_to_double(words[2], _ref_plane_res[1]);