Skip to content

Commit b88bd99

Browse files
committed
Various compiler warning fixes
1 parent fa23c19 commit b88bd99

22 files changed

+55
-55
lines changed

dtool/src/interrogate/interfaceMakerPythonNative.cxx

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,6 @@ RenameSet methodRenameDictionary[] = {
103103
{ nullptr, nullptr, -1 }
104104
};
105105

106-
RenameSet classRenameDictionary[] = {
107-
// No longer used, now empty.
108-
{ nullptr, nullptr, -1 }
109-
};
110-
111106
const char *pythonKeywords[] = {
112107
"and",
113108
"as",
@@ -193,12 +188,6 @@ classNameFromCppName(const std::string &cppName, bool mangle) {
193188
}
194189
}
195190

196-
for (int x = 0; classRenameDictionary[x]._from != nullptr; x++) {
197-
if (cppName == classRenameDictionary[x]._from) {
198-
className = classRenameDictionary[x]._to;
199-
}
200-
}
201-
202191
if (className.empty()) {
203192
std::string text = "** ERROR ** Renaming class: " + cppName + " to empty string";
204193
printf("%s", text.c_str());
@@ -253,15 +242,6 @@ methodNameFromCppName(const std::string &cppName, const std::string &className,
253242
}
254243
}
255244

256-
if (className.size() > 0) {
257-
string lookup_name = className + '.' + cppName;
258-
for (int x = 0; classRenameDictionary[x]._from != nullptr; x++) {
259-
if (lookup_name == methodRenameDictionary[x]._from) {
260-
methodName = methodRenameDictionary[x]._to;
261-
}
262-
}
263-
}
264-
265245
// # Mangle names that happen to be python keywords so they are not anymore
266246
methodName = checkKeyword(methodName);
267247
return methodName;

panda/src/char/characterSlider.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class EXPCL_PANDA_CHAR CharacterSlider : public MovingPartScalar {
3434
explicit CharacterSlider(PartGroup *parent, const std::string &name);
3535
virtual ~CharacterSlider();
3636

37+
public:
3738
virtual PartGroup *make_copy() const;
3839

3940
virtual bool update_internals(PartBundle *root, PartGroup *parent,

panda/src/display/nativeWindowHandle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* This class exists for name scoping only. Don't use the constructor
3434
* directly; use one of the make_* methods.
3535
*/
36-
class EXPCL_PANDA_DISPLAY NativeWindowHandle : public WindowHandle {
36+
class EXPCL_PANDA_DISPLAY NativeWindowHandle final : public WindowHandle {
3737
private:
3838
INLINE NativeWindowHandle();
3939
INLINE NativeWindowHandle(const NativeWindowHandle &copy);

panda/src/egg/eggCompositePrimitive.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ get_shading() const {
5757
if (!first_component->has_normal()) {
5858
first_component = this;
5959
}
60-
for (int i = 1; i < get_num_components(); i++) {
60+
for (size_t i = 1; i < get_num_components(); ++i) {
6161
const EggAttributes *component = get_component(i);
6262
if (!component->has_normal()) {
6363
component = this;
@@ -74,7 +74,7 @@ get_shading() const {
7474
if (!first_component->has_color()) {
7575
first_component = this;
7676
}
77-
for (int i = 1; i < get_num_components(); i++) {
77+
for (size_t i = 1; i < get_num_components(); ++i) {
7878
const EggAttributes *component = get_component(i);
7979
if (!component->has_color()) {
8080
component = this;
@@ -295,7 +295,7 @@ apply_last_attribute() {
295295
// The first component gets applied to the third vertex, and so on from
296296
// there.
297297
int num_lead_vertices = get_num_lead_vertices();
298-
for (int i = 0; i < get_num_components(); i++) {
298+
for (size_t i = 0; i < get_num_components(); ++i) {
299299
EggAttributes *component = get_component(i);
300300
do_apply_flat_attribute(i + num_lead_vertices, component);
301301
}
@@ -313,7 +313,7 @@ void EggCompositePrimitive::
313313
apply_first_attribute() {
314314
// The first component gets applied to the first vertex, and so on from
315315
// there.
316-
for (int i = 0; i < get_num_components(); i++) {
316+
for (size_t i = 0; i < get_num_components(); ++i) {
317317
EggAttributes *component = get_component(i);
318318
do_apply_flat_attribute(i, component);
319319
}

panda/src/egg/eggPrimitive.cxx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ get_shading() const {
227227
if (!first_vertex->has_normal()) {
228228
first_vertex = this;
229229
}
230-
for (int i = 1; i < get_num_vertices(); i++) {
230+
for (size_t i = 1; i < get_num_vertices(); ++i) {
231231
const EggAttributes *vertex = get_vertex(i);
232232
if (!vertex->has_normal()) {
233233
vertex = this;
@@ -244,7 +244,7 @@ get_shading() const {
244244
if (!first_vertex->has_color()) {
245245
first_vertex = this;
246246
}
247-
for (int i = 1; i < get_num_vertices(); i++) {
247+
for (size_t i = 1; i < get_num_vertices(); ++i) {
248248
const EggAttributes *vertex = get_vertex(i);
249249
if (!vertex->has_color()) {
250250
vertex = this;
@@ -461,9 +461,7 @@ apply_first_attribute() {
461461
void EggPrimitive::
462462
post_apply_flat_attribute() {
463463
if (!empty()) {
464-
for (int i = 0; i < (int)size(); i++) {
465-
EggVertex *vertex = get_vertex(i);
466-
464+
for (EggVertex *vertex : _vertices) {
467465
// Use set_normal() instead of copy_normal(), to avoid getting the
468466
// morphs--we don't want them here, since we're just putting a bogus
469467
// value on the normal anyway.

panda/src/egg/eggTriangleFan.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ apply_first_attribute() {
5757
// In the case of a triangle fan, the first vertex of the fan is the common
5858
// vertex, so we consider the second vertex to be the key vertex of the
5959
// first triangle, and move from there.
60-
for (int i = 0; i < get_num_components(); i++) {
60+
for (size_t i = 0; i < get_num_components(); ++i) {
6161
EggAttributes *component = get_component(i);
6262
do_apply_flat_attribute(i + 1, component);
6363
}

panda/src/egg2pg/eggSaver.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ convert_collision_node(CollisionNode *node, const WorkingNodePath &node_path,
560560
// Get an arbitrary vector on the plane by taking the cross product
561561
// with any vector, as long as it is different.
562562
LVector3 vec1;
563-
if (abs(normal[2]) > abs(normal[1])) {
563+
if (std::fabs(normal[2]) > std::fabs(normal[1])) {
564564
vec1 = normal.cross(LVector3(0, 1, 0));
565565
} else {
566566
vec1 = normal.cross(LVector3(0, 0, 1));
@@ -626,7 +626,7 @@ convert_collision_node(CollisionNode *node, const WorkingNodePath &node_path,
626626
// Also get an arbitrary vector perpendicular to the tube.
627627
LVector3 axis = point_b - point_a;
628628
LVector3 sideways;
629-
if (abs(axis[2]) > abs(axis[1])) {
629+
if (std::fabs(axis[2]) > std::fabs(axis[1])) {
630630
sideways = axis.cross(LVector3(0, 1, 0));
631631
} else {
632632
sideways = axis.cross(LVector3(0, 0, 1));

panda/src/event/asyncTaskSequence.I

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ get_repeat_count() const {
3434
* Returns the index of the task within the sequence that is currently being
3535
* executed (or that will be executed at the next epoch).
3636
*/
37-
INLINE int AsyncTaskSequence::
37+
INLINE size_t AsyncTaskSequence::
3838
get_current_task_index() const {
3939
return _task_index;
4040
}

panda/src/event/asyncTaskSequence.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class EXPCL_PANDA_EVENT AsyncTaskSequence : public AsyncTask, public AsyncTaskCo
3939
INLINE void set_repeat_count(int repeat_count);
4040
INLINE int get_repeat_count() const;
4141

42-
INLINE int get_current_task_index() const;
42+
INLINE size_t get_current_task_index() const;
4343

4444
protected:
4545
virtual bool is_runnable();
@@ -51,7 +51,7 @@ class EXPCL_PANDA_EVENT AsyncTaskSequence : public AsyncTask, public AsyncTaskCo
5151
void set_current_task(AsyncTask *task, bool clean_exit);
5252

5353
int _repeat_count;
54-
int _task_index;
54+
size_t _task_index;
5555
PT(AsyncTask) _current_task;
5656

5757
public:

panda/src/glstuff/glGraphicsStateGuardian_src.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3007,7 +3007,7 @@ reset() {
30073007

30083008
#ifndef OPENGLES_1
30093009
_enabled_vertex_attrib_arrays.clear();
3010-
memset(_vertex_attrib_divisors, 0, sizeof(GLint) * 32);
3010+
memset(_vertex_attrib_divisors, 0, sizeof(GLuint) * 32);
30113011
#endif
30123012

30133013
// Dither is on by default in GL; let's turn it off

0 commit comments

Comments
 (0)