Quellcode durchsuchen

Fix more compiler warnings

rdb vor 7 Jahren
Ursprung
Commit
f804b10d45

+ 1 - 1
panda/src/egg/eggCompositePrimitive.cxx

@@ -431,7 +431,7 @@ void EggCompositePrimitive::
 write_body(std::ostream &out, int indent_level) const {
   EggPrimitive::write_body(out, indent_level);
 
-  for (int i = 0; i < get_num_components(); i++) {
+  for (size_t i = 0; i < get_num_components(); ++i) {
     const EggAttributes *attrib = get_component(i);
     if (attrib->compare_to(*this) != 0 &&
         (attrib->has_color() || attrib->has_normal())) {

+ 6 - 6
panda/src/glstuff/glGeomMunger_src.cxx

@@ -104,7 +104,7 @@ munge_format_impl(const GeomVertexFormat *orig,
   }
 
   // Convert packed formats that OpenGL may not understand.
-  for (int i = 0; i < orig->get_num_columns(); ++i) {
+  for (size_t i = 0; i < orig->get_num_columns(); ++i) {
     const GeomVertexColumn *column = orig->get_column(i);
     int array = orig->get_array_with(column->get_name());
 
@@ -182,7 +182,7 @@ munge_format_impl(const GeomVertexFormat *orig,
   if ((_flags & F_parallel_arrays) != 0) {
     // Split out the interleaved array into n parallel arrays.
     new_format = new GeomVertexFormat;
-    for (int i = 0; i < format->get_num_columns(); ++i) {
+    for (size_t i = 0; i < format->get_num_columns(); ++i) {
       const GeomVertexColumn *column = format->get_column(i);
       PT(GeomVertexArrayFormat) new_array_format = new GeomVertexArrayFormat;
       new_array_format->add_column(column->get_name(), column->get_num_components(),
@@ -290,7 +290,7 @@ premunge_format_impl(const GeomVertexFormat *orig) {
   }
 
   // Convert packed formats that OpenGL may not understand.
-  for (int i = 0; i < orig->get_num_columns(); ++i) {
+  for (size_t i = 0; i < orig->get_num_columns(); ++i) {
     const GeomVertexColumn *column = orig->get_column(i);
     int array = orig->get_array_with(column->get_name());
 
@@ -317,7 +317,7 @@ premunge_format_impl(const GeomVertexFormat *orig) {
   if ((_flags & F_parallel_arrays) != 0) {
     // Split out the interleaved array into n parallel arrays.
     new_format = new GeomVertexFormat;
-    for (int i = 0; i < format->get_num_columns(); ++i) {
+    for (size_t i = 0; i < format->get_num_columns(); ++i) {
       const GeomVertexColumn *column = format->get_column(i);
       PT(GeomVertexArrayFormat) new_array_format = new GeomVertexArrayFormat;
       new_array_format->add_column(column->get_name(), column->get_num_components(),
@@ -396,11 +396,11 @@ premunge_format_impl(const GeomVertexFormat *orig) {
 
     // Now go through the remaining arrays and make sure they are tightly
     // packed (with the column alignment restrictions).  If not, repack them.
-    for (int i = 0; i < new_format->get_num_arrays(); ++i) {
+    for (size_t i = 0; i < new_format->get_num_arrays(); ++i) {
       CPT(GeomVertexArrayFormat) orig_a = new_format->get_array(i);
       if (orig_a->count_unused_space() != 0) {
         PT(GeomVertexArrayFormat) new_a = new GeomVertexArrayFormat;
-        for (int j = 0; j < orig_a->get_num_columns(); ++j) {
+        for (size_t j = 0; j < orig_a->get_num_columns(); ++j) {
           const GeomVertexColumn *column = orig_a->get_column(j);
           new_a->add_column(column->get_name(), column->get_num_components(),
                             column->get_numeric_type(), column->get_contents(),

+ 4 - 4
panda/src/glstuff/glGraphicsBuffer_src.cxx

@@ -389,7 +389,7 @@ rebuild_bitplanes() {
   _rb_size_z = 1;
   _rb_data_size_bytes = 0;
 
-  int num_fbos = 1;
+  size_t num_fbos = 1;
 
   // These variables indicate what should be bound to each bitplane.
   Texture *attach[RTP_COUNT];
@@ -458,7 +458,7 @@ rebuild_bitplanes() {
       }
 
       if (tex->get_z_size() > 1) {
-        num_fbos = max(num_fbos, tex->get_z_size());
+        num_fbos = max(num_fbos, (size_t)tex->get_z_size());
       }
 
       // Assign the texture to this slot.
@@ -523,13 +523,13 @@ rebuild_bitplanes() {
 
   if (num_fbos > _fbo.size()) {
     // Generate more FBO handles.
-    int start = _fbo.size();
+    size_t start = _fbo.size();
     GLuint zero = 0;
     _fbo.resize(num_fbos, zero);
     glgsg->_glGenFramebuffers(num_fbos - start, &_fbo[start]);
   }
 
-  for (int layer = 0; layer < num_fbos; ++layer) {
+  for (int layer = 0; layer < (int)num_fbos; ++layer) {
     // Bind the FBO
     if (_fbo[layer] == 0) {
       report_my_gl_errors();

+ 0 - 1
panda/src/vrpn/vrpn_interface.h

@@ -19,7 +19,6 @@
 #ifdef CPPPARSER
   // For correct interrogate parsing of UNC's vrpn library.
   #if defined(WIN32_VC) || defined(WIN64_VC)
-    #define _WIN32
     #define SOCKET int
   #else
     #define linux