Browse Source

general: fix a few more compiler warnings

rdb 7 years ago
parent
commit
94cbdc563b

+ 1 - 1
panda/src/glstuff/glCgShaderContext_src.cxx

@@ -525,7 +525,7 @@ issue_parameters(int altered) {
       }
 
       // Check if the size of the shader input and ptr_data match
-      int input_size = spec._dim[0] * spec._dim[1] * spec._dim[2];
+      size_t input_size = spec._dim[0] * spec._dim[1] * spec._dim[2];
 
       // dimension is negative only if the parameter had the (deprecated)k_
       // prefix.

+ 3 - 1
panda/src/glstuff/glGraphicsStateGuardian_src.cxx

@@ -11610,17 +11610,18 @@ do_issue_tex_gen() {
   // effectively define an identity matrix that maps the spatial coordinates
   // one-for-one to UV's.  If you want a mapping other than identity, use a
   // TexMatrixAttrib (or a TexProjectorEffect).
+#ifndef OPENGLES
   static const PN_stdfloat s_data[4] = { 1, 0, 0, 0 };
   static const PN_stdfloat t_data[4] = { 0, 1, 0, 0 };
   static const PN_stdfloat r_data[4] = { 0, 0, 1, 0 };
   static const PN_stdfloat q_data[4] = { 0, 0, 0, 1 };
+#endif
 
   _tex_gen_modifies_mat = false;
 
   bool got_point_sprites = false;
 
   for (int i = 0; i < _num_active_texture_stages; i++) {
-    TextureStage *stage = _target_texture->get_on_ff_stage(i);
     set_active_texture_stage(i);
     if (_supports_point_sprite) {
 #ifdef OPENGLES
@@ -11636,6 +11637,7 @@ do_issue_tex_gen() {
     glDisable(GL_TEXTURE_GEN_R);
     glDisable(GL_TEXTURE_GEN_Q);
 
+    TextureStage *stage = _target_texture->get_on_ff_stage(i);
     TexGenAttrib::Mode mode = _target_tex_gen->get_mode(stage);
     switch (mode) {
     case TexGenAttrib::M_off:

+ 1 - 3
panda/src/x11display/x11GraphicsWindow.cxx

@@ -1382,9 +1382,7 @@ open_raw_mice() {
 void x11GraphicsWindow::
 poll_raw_mice() {
 #ifdef PHAVE_LINUX_INPUT_H
-  for (int di = 0; di < _mouse_device_info.size(); ++di) {
-    MouseDeviceInfo &inf = _mouse_device_info[di];
-
+  for (MouseDeviceInfo &inf : _mouse_device_info) {
     // Read all bytes into buffer.
     if (inf._fd >= 0) {
       while (1) {