Browse Source

squelch some more compiler warnings

David Rose 14 years ago
parent
commit
4785161374

+ 1 - 1
dtool/LocalSetup.pp

@@ -714,7 +714,7 @@ $[cdefine USE_DELETED_CHAIN]
 $[cdefine WANT_NATIVE_NET]
 $[cdefine WANT_NATIVE_NET]
 
 
 /* Turn off warnings for using scanf and such */
 /* Turn off warnings for using scanf and such */
-#if $[or $[eq $[USE_COMPILER],MSVC9], $[USE_COMPILER],MSVC9x64]
+#if $[or $[eq $[USE_COMPILER],MSVC9], $[eq $[USE_COMPILER],MSVC9x64]]
         #print Will ignore CRT_SECURE warnings for MSVC9
         #print Will ignore CRT_SECURE warnings for MSVC9
         $[cdefine _CRT_SECURE_NO_WARNINGS]
         $[cdefine _CRT_SECURE_NO_WARNINGS]
         # pragma warning( disable : 4996 4275 4267 4099 4049 4013 4005 )
         # pragma warning( disable : 4996 4275 4267 4099 4049 4013 4005 )

+ 6 - 3
dtool/src/dtoolutil/pandaFileStreamBuf.cxx

@@ -336,9 +336,12 @@ seekoff(streamoff off, ios_seekdir dir, ios_openmode which) {
       }
       }
 #else
 #else
       // Posix case.
       // Posix case.
-      new_pos = lseek(_fd, off, SEEK_END);
-      if (new_pos == -1) {
-        return -1;
+      {
+	off_t li = lseek(_fd, off, SEEK_END);
+	if (li == (size_t)-1) {
+	  return -1;
+	}
+	new_pos = (size_t)li;
       }
       }
 #endif  // _WIN32
 #endif  // _WIN32
       break;
       break;

+ 2 - 2
dtool/src/interrogate/functionRemap.cxx

@@ -398,7 +398,7 @@ get_call_str(const string &container, const vector_string &pexprs) const {
       if (_cpptype != NULL) {
       if (_cpptype != NULL) {
         // Fix nested classes by replacing :: with __
         // Fix nested classes by replacing :: with __
         char* nested_name = strdup(_cpptype->get_local_name(&parser).c_str());
         char* nested_name = strdup(_cpptype->get_local_name(&parser).c_str());
-        for (int i = 0; i < strlen(nested_name); ++i) {
+        for (size_t i = 0; i < strlen(nested_name); ++i) {
           if (nested_name[i] == ':') {
           if (nested_name[i] == ':') {
             nested_name[i] = '_';
             nested_name[i] = '_';
           }
           }
@@ -681,7 +681,7 @@ setup_properties(const InterrogateFunction &ifunc, InterfaceMaker *interface_mak
       }
       }
 
 
     } else if (fname == "size" || fname == "__len__") {
     } else if (fname == "size" || fname == "__len__") {
-      if (_parameters.size() == first_param &&
+      if ((int)_parameters.size() == first_param &&
           TypeManager::is_integer(_return_type->get_new_type())) {
           TypeManager::is_integer(_return_type->get_new_type())) {
         // It receives no parameters, and returns an integer.
         // It receives no parameters, and returns an integer.
         _flags |= F_size;
         _flags |= F_size;

+ 0 - 2
dtool/src/interrogate/interfaceMaker.cxx

@@ -118,8 +118,6 @@ InterfaceMaker::Object::
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void InterfaceMaker::Object::
 void InterfaceMaker::Object::
 check_protocols() {
 check_protocols() {
-  InterrogateDatabase *idb = InterrogateDatabase::get_ptr();
-
   int flags = 0;
   int flags = 0;
 
 
   Functions::const_iterator fi;
   Functions::const_iterator fi;

+ 23 - 22
panda/src/audiotraits/openalAudioSound.cxx

@@ -46,38 +46,39 @@ OpenALAudioSound(OpenALAudioManager* manager,
                  int mode) :
                  int mode) :
   _movie(movie),
   _movie(movie),
   _sd(NULL),
   _sd(NULL),
-  _loops_completed(0),
-  _playing_rate(0.0),
   _playing_loops(0),
   _playing_loops(0),
+  _playing_rate(0.0),
+  _loops_completed(0),
   _source(0),
   _source(0),
   _manager(manager),
   _manager(manager),
-  _basename(movie->get_filename().get_basename()),
   _volume(1.0f),
   _volume(1.0f),
   _balance(0),
   _balance(0),
-  _loop_count(1),
+  _play_rate(1.0),
+  _positional(positional),
+  _min_dist(3.28f),
+  _max_dist(1000000000.0f),
+  _drop_off_factor(1.0f),
   _length(0.0),
   _length(0.0),
+  _loop_count(1),
+  _desired_mode(mode),
   _start_time(0.0),
   _start_time(0.0),
-  _play_rate(1.0),
   _current_time(0.0),
   _current_time(0.0),
+  _basename(movie->get_filename().get_basename()),
   _active(true),
   _active(true),
-  _paused(false),
-  _desired_mode(mode)
+  _paused(false)
 {
 {
-  _location[0] = 0;
-  _location[1] = 0;
-  _location[2] = 0;
-  
-  _velocity[0] = 0;
-  _velocity[1] = 0;
-  _velocity[2] = 0;
-  
-  _min_dist = 3.28f; _max_dist = 1000000000.0f;
-  _drop_off_factor = 1.0f;
-  
-  _positional = positional;
-  
+  _location[0] = 0.0f;
+  _location[1] = 0.0f;
+  _location[2] = 0.0f;
+  _velocity[0] = 0.0f;
+  _velocity[1] = 0.0f;
+  _velocity[2] = 0.0f;
+
   require_sound_data();
   require_sound_data();
-  if (_manager == 0) return;
+  if (_manager == NULL) {
+    return;
+  }
+
   _length = _sd->_length;
   _length = _sd->_length;
   if (positional) {
   if (positional) {
     if (_sd->_channels != 1) {
     if (_sd->_channels != 1) {
@@ -506,7 +507,7 @@ push_fresh_buffers() {
     int rate = cursor->audio_rate();
     int rate = cursor->audio_rate();
     
     
     int fill = 0;
     int fill = 0;
-    for (int i=0; i<_stream_queued.size(); i++) {
+    for (size_t i = 0; i < _stream_queued.size(); i++) {
       fill += _stream_queued[i]._samples;
       fill += _stream_queued[i]._samples;
     }
     }
     
     

+ 2 - 2
panda/src/chan/movingPartBase.I

@@ -22,9 +22,9 @@
 INLINE MovingPartBase::
 INLINE MovingPartBase::
 MovingPartBase(const MovingPartBase &copy) :
 MovingPartBase(const MovingPartBase &copy) :
   PartGroup(copy),
   PartGroup(copy),
-  _forced_channel(copy._forced_channel),
   _num_effective_channels(0),
   _num_effective_channels(0),
-  _effective_control(NULL)
+  _effective_control(NULL),
+  _forced_channel(copy._forced_channel)
 {
 {
   // We don't copy the bound channels.  We do copy the forced_channel,
   // We don't copy the bound channels.  We do copy the forced_channel,
   // though this is just a pointerwise copy.
   // though this is just a pointerwise copy.

+ 9 - 9
panda/src/collide/collisionBox.I

@@ -84,12 +84,12 @@ INLINE CollisionBox::
 CollisionBox(const CollisionBox &copy) :
 CollisionBox(const CollisionBox &copy) :
   CollisionSolid(copy),
   CollisionSolid(copy),
   _center(copy._center),
   _center(copy._center),
-  _x( copy._x ),
-  _y( copy._y ),
-  _z( copy._z ),
-  _min( copy._min),
-  _max( copy._max),
-  _radius( copy._radius )
+  _min(copy._min),
+  _max(copy._max),
+  _x(copy._x ),
+  _y(copy._y ),
+  _z(copy._z ),
+  _radius(copy._radius )
 {
 {
   for(int v = 0; v < 8; v++)
   for(int v = 0; v < 8; v++)
     _vertex[v] = copy._vertex[v];
     _vertex[v] = copy._vertex[v];
@@ -350,13 +350,13 @@ operator = (const CollisionBox::PointDef &copy) {
   _p = copy._p;
   _p = copy._p;
   _v = copy._v;
   _v = copy._v;
 }
 }
+
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: CollisionBox::get_plane_points
 //     Function: CollisionBox::get_plane_points
 //       Access: Public
 //       Access: Public
 //  Description: returns the points that form the nth plane
 //  Description: returns the points that form the nth plane
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-
 INLINE CollisionBox::Points CollisionBox::
 INLINE CollisionBox::Points CollisionBox::
-get_plane_points( int n ){
-	return _points[n];
+get_plane_points(int n) {
+  return _points[n];
 }
 }

+ 74 - 73
panda/src/collide/collisionBox.cxx

@@ -12,8 +12,6 @@
 //
 //
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 
 
-
-#include "collisionDSSolid.h"
 #include "collisionBox.h"
 #include "collisionBox.h"
 #include "collisionLine.h"
 #include "collisionLine.h"
 #include "collisionRay.h"
 #include "collisionRay.h"
@@ -76,7 +74,7 @@ setup_box(){
     array[2] = get_point(plane_def[plane][2]);
     array[2] = get_point(plane_def[plane][2]);
     array[3] = get_point(plane_def[plane][3]);
     array[3] = get_point(plane_def[plane][3]);
     setup_points(array, array+4, plane);
     setup_points(array, array+4, plane);
-	}
+  }
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -149,9 +147,9 @@ void CollisionBox::
 xform(const LMatrix4f &mat) {
 xform(const LMatrix4f &mat) {
   _center = _center * mat;
   _center = _center * mat;
   for(int v = 0; v < 8; v++)
   for(int v = 0; v < 8; v++)
-	   _vertex[v] = _vertex[v] * mat;
+     _vertex[v] = _vertex[v] * mat;
   for(int p = 0; p < 6 ; p++)
   for(int p = 0; p < 6 ; p++)
-	   _planes[p] = set_plane(p);
+     _planes[p] = set_plane(p);
   _x = _vertex[0].get_x()-_center.get_x(); 
   _x = _vertex[0].get_x()-_center.get_x(); 
   _y = _vertex[0].get_y()-_center.get_y();
   _y = _vertex[0].get_y()-_center.get_y();
   _z = _vertex[0].get_z()-_center.get_z();
   _z = _vertex[0].get_z()-_center.get_z();
@@ -171,7 +169,7 @@ xform(const LMatrix4f &mat) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 LPoint3f CollisionBox::
 LPoint3f CollisionBox::
 get_collision_origin() const {
 get_collision_origin() const {
-	return _center;
+  return _center;
 }
 }
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
@@ -277,7 +275,8 @@ test_intersection_from_sphere(const CollisionEntry &entry) const {
   float from_radius = csqrt(from_radius_2);
   float from_radius = csqrt(from_radius_2);
 
 
   int ip;
   int ip;
-  float max_dist,dist;
+  float max_dist = 0.0;
+	float dist = 0.0;
   bool intersect;
   bool intersect;
   Planef plane;
   Planef plane;
   LVector3f normal;
   LVector3f normal;
@@ -288,57 +287,57 @@ test_intersection_from_sphere(const CollisionEntry &entry) const {
       continue;
       continue;
     }
     }
     if (wrt_prev_space != wrt_space) {
     if (wrt_prev_space != wrt_space) {
-		    // If we have a delta between the previous position and the
-		    // current position, we use that to determine some more properties
-		    // of the collision.
-		    LPoint3f b = from_center;
-		    LPoint3f a = sphere->get_center() * wrt_prev_space->get_mat();
-		    LVector3f delta = b - a;
-
-		    // First, there is no collision if the "from" object is definitely
-		    // moving in the same direction as the plane's normal.
-		    float dot = delta.dot(plane.get_normal());
-		    if (dot > 0.1f) {
-		      continue; // no intersection
-		    }
-
-		    if (IS_NEARLY_ZERO(dot)) {
-		      // If we're moving parallel to the plane, the sphere is tested
-		      // at its final point.  Leave it as it is.
-
-		    } else {
-		      // Otherwise, we're moving into the plane; the sphere is tested
-		      // at the point along its path that is closest to intersecting
-		      // the plane.  This may be the actual intersection point, or it
-		      // may be the starting point or the final point.
-		      // dot is equal to the (negative) magnitude of 'delta' along the
-		      // direction of the plane normal
-		      // t = ratio of (distance from start pos to plane) to (distance
-		      // from start pos to end pos), along axis of plane normal
-		      float dist_to_p = plane.dist_to_plane(a);
-		      t = (dist_to_p / -dot);
-    	      
-		      // also compute the actual contact point and time of contact
-		      // for handlers that need it
-		      actual_t = ((dist_to_p - from_radius) / -dot);
-		      actual_t = min(1.0f, max(0.0f, actual_t));
-		      contact_point = a + (actual_t * delta);
-
-		      if (t >= 1.0f) {
-			    // Leave it where it is.
-
-		      } else if (t < 0.0f) {
+        // If we have a delta between the previous position and the
+        // current position, we use that to determine some more properties
+        // of the collision.
+        LPoint3f b = from_center;
+        LPoint3f a = sphere->get_center() * wrt_prev_space->get_mat();
+        LVector3f delta = b - a;
+
+        // First, there is no collision if the "from" object is definitely
+        // moving in the same direction as the plane's normal.
+        float dot = delta.dot(plane.get_normal());
+        if (dot > 0.1f) {
+          continue; // no intersection
+        }
+
+        if (IS_NEARLY_ZERO(dot)) {
+          // If we're moving parallel to the plane, the sphere is tested
+          // at its final point.  Leave it as it is.
+
+        } else {
+          // Otherwise, we're moving into the plane; the sphere is tested
+          // at the point along its path that is closest to intersecting
+          // the plane.  This may be the actual intersection point, or it
+          // may be the starting point or the final point.
+          // dot is equal to the (negative) magnitude of 'delta' along the
+          // direction of the plane normal
+          // t = ratio of (distance from start pos to plane) to (distance
+          // from start pos to end pos), along axis of plane normal
+          float dist_to_p = plane.dist_to_plane(a);
+          t = (dist_to_p / -dot);
+            
+          // also compute the actual contact point and time of contact
+          // for handlers that need it
+          actual_t = ((dist_to_p - from_radius) / -dot);
+          actual_t = min(1.0f, max(0.0f, actual_t));
+          contact_point = a + (actual_t * delta);
+
+          if (t >= 1.0f) {
+          // Leave it where it is.
+
+          } else if (t < 0.0f) {
              from_center = a;
              from_center = a;
              moved_from_center = true;
              moved_from_center = true;
-		      } else {
-			          from_center = a + t * delta;
-			          moved_from_center = true;
-		      }
-		    }
-	   }
+          } else {
+                from_center = a + t * delta;
+                moved_from_center = true;
+          }
+        }
+     }
 
 
     normal = (has_effective_normal() && sphere->get_respect_effective_normal()) ? get_effective_normal() : plane.get_normal();
     normal = (has_effective_normal() && sphere->get_respect_effective_normal()) ? get_effective_normal() : plane.get_normal();
-	   
+     
     #ifndef NDEBUG
     #ifndef NDEBUG
     /*if (!IS_THRESHOLD_EQUAL(normal.length_squared(), 1.0f, 0.001), NULL) {
     /*if (!IS_THRESHOLD_EQUAL(normal.length_squared(), 1.0f, 0.001), NULL) {
       std::cout
       std::cout
@@ -349,14 +348,14 @@ test_intersection_from_sphere(const CollisionEntry &entry) const {
     }*/
     }*/
     #endif
     #endif
 
 
-	  // The nearest point within the plane to our center is the
-	  // intersection of the line (center, center - normal) with the plane.
-	  
+    // The nearest point within the plane to our center is the
+    // intersection of the line (center, center - normal) with the plane.
+    
     if (!plane.intersects_line(dist, from_center, -(plane.get_normal()))) {
     if (!plane.intersects_line(dist, from_center, -(plane.get_normal()))) {
-		    // No intersection with plane?  This means the plane's effective
-		    // normal was within the plane itself.  A useless polygon.
-		    continue;
-	   }
+        // No intersection with plane?  This means the plane's effective
+        // normal was within the plane itself.  A useless polygon.
+        continue;
+     }
 
 
     if (dist > from_radius || dist < -from_radius) {
     if (dist > from_radius || dist < -from_radius) {
       // No intersection with the plane.
       // No intersection with the plane.
@@ -419,7 +418,7 @@ test_intersection_from_sphere(const CollisionEntry &entry) const {
     intersect = true;
     intersect = true;
   }
   }
   if( !intersect )
   if( !intersect )
-	  return NULL;
+    return NULL;
 
 
   if (collide_cat.is_debug()) {
   if (collide_cat.is_debug()) {
     collide_cat.debug()
     collide_cat.debug()
@@ -465,14 +464,15 @@ test_intersection_from_ray(const CollisionEntry &entry) const {
   LVector3f from_direction = ray->get_direction() * wrt_mat;
   LVector3f from_direction = ray->get_direction() * wrt_mat;
 
 
   int i, j;
   int i, j;
-  float t, near_t;
+  float t;
+	float near_t = 0.0;
   bool intersect;
   bool intersect;
   Planef plane;
   Planef plane;
   Planef near_plane; 
   Planef near_plane; 
 
 
   //Returns the details about the first plane of the box that the ray
   //Returns the details about the first plane of the box that the ray
   //intersects.
   //intersects.
-  for(i = 0, intersect = false, t = 0, j = 0; i < 6 && j < 2; i++) {
+  for (i = 0, intersect = false, t = 0, j = 0; i < 6 && j < 2; i++) {
     plane = get_plane(i);
     plane = get_plane(i);
 
 
     if (!plane.intersects_line(t, from_origin, from_direction)) {
     if (!plane.intersects_line(t, from_origin, from_direction)) {
@@ -492,7 +492,7 @@ test_intersection_from_ray(const CollisionEntry &entry) const {
       continue;
       continue;
     }
     }
     intersect = true;
     intersect = true;
-    if(j) {
+    if (j) {
       if(t < near_t) {
       if(t < near_t) {
         near_plane = plane;
         near_plane = plane;
         near_t = t;
         near_t = t;
@@ -504,11 +504,11 @@ test_intersection_from_ray(const CollisionEntry &entry) const {
     }
     }
     ++j;
     ++j;
   }
   }
-	 
+   
 
 
   if(!intersect) {
   if(!intersect) {
-	   //No intersection with ANY of the box's planes has been detected
-	   return NULL;
+     //No intersection with ANY of the box's planes has been detected
+     return NULL;
   }
   }
 
 
   if (collide_cat.is_debug()) {
   if (collide_cat.is_debug()) {
@@ -548,7 +548,8 @@ test_intersection_from_segment(const CollisionEntry &entry) const {
   LVector3f from_direction = from_extent - from_origin;
   LVector3f from_direction = from_extent - from_origin;
 
 
   int i, j;
   int i, j;
-  float t, near_t;
+  float t;
+	float near_t = 0.0;
   bool intersect;
   bool intersect;
   Planef plane;
   Planef plane;
   Planef near_plane; 
   Planef near_plane; 
@@ -588,11 +589,11 @@ test_intersection_from_segment(const CollisionEntry &entry) const {
     }
     }
     ++j;
     ++j;
   }
   }
-	 
+   
 
 
   if(!intersect) {
   if(!intersect) {
-	   //No intersection with ANY of the box's planes has been detected
-	   return NULL;
+     //No intersection with ANY of the box's planes has been detected
+     return NULL;
   }
   }
 
 
   if (collide_cat.is_debug()) {
   if (collide_cat.is_debug()) {
@@ -986,7 +987,7 @@ point_is_inside(const LPoint2f &p, const CollisionBox::Points &points) const {
     }
     }
   }
   }
   if (is_right(p - points[points.size() - 1]._p, 
   if (is_right(p - points[points.size() - 1]._p, 
-	  points[0]._p - points[points.size() - 1]._p)) {
+    points[0]._p - points[points.size() - 1]._p)) {
     return false;
     return false;
   }
   }
 
 

+ 2 - 2
panda/src/collide/collisionHandlerHighestEvent.cxx

@@ -49,7 +49,7 @@ begin_group() {
   }
   }
   _last_colliding.clear();
   _last_colliding.clear();
   if (_closest_collider) {
   if (_closest_collider) {
-    bool inserted = _last_colliding.insert(_closest_collider).second;
+    _last_colliding.insert(_closest_collider);
   }
   }
   _current_colliding.clear();
   _current_colliding.clear();
   _collider_distance = 0;
   _collider_distance = 0;
@@ -86,7 +86,7 @@ add_entry(CollisionEntry *entry) {
 bool CollisionHandlerHighestEvent::
 bool CollisionHandlerHighestEvent::
 end_group() {
 end_group() {
   if (_closest_collider) {
   if (_closest_collider) {
-    bool inserted = _current_colliding.insert(_closest_collider).second;
+    _current_colliding.insert(_closest_collider);
   }
   }
   return CollisionHandlerEvent::end_group();
   return CollisionHandlerEvent::end_group();
 }
 }

+ 3 - 4
panda/src/collide/collisionSphere.cxx

@@ -478,8 +478,6 @@ test_intersection_from_box(const CollisionEntry &entry) const {
 
 
   LPoint3f orig_center = get_center();
   LPoint3f orig_center = get_center();
   LPoint3f to_center = orig_center;
   LPoint3f to_center = orig_center;
-  bool moved_from_center = false;
-  float t = 1.0f;
   LPoint3f contact_point(from_center);
   LPoint3f contact_point(from_center);
   float actual_t = 1.0f;
   float actual_t = 1.0f;
 
 
@@ -487,12 +485,13 @@ test_intersection_from_box(const CollisionEntry &entry) const {
   float to_radius_2 = to_radius * to_radius;
   float to_radius_2 = to_radius * to_radius;
 
 
   int ip;
   int ip;
-  float max_dist,dist;
+  float max_dist = 0.0f;
+  float dist = 0.0f; // initial assignment to squelch silly compiler warning
   bool intersect;
   bool intersect;
   Planef plane;
   Planef plane;
   LVector3f normal;
   LVector3f normal;
 
 
-  for( ip = 0, intersect=false; ip < 6 && !intersect; ip++ ){
+  for (ip = 0, intersect=false; ip < 6 && !intersect; ip++) {
     plane = local_b.get_plane( ip );
     plane = local_b.get_plane( ip );
     if (local_b.get_plane_points(ip).size() < 3) {
     if (local_b.get_plane_points(ip).size() < 3) {
       continue;
       continue;

+ 2 - 2
panda/src/display/subprocessWindowBuffer.cxx

@@ -64,11 +64,11 @@ SubprocessWindowBuffer(int x_size, int y_size) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 SubprocessWindowBuffer::
 SubprocessWindowBuffer::
 SubprocessWindowBuffer(const SubprocessWindowBuffer &copy) :
 SubprocessWindowBuffer(const SubprocessWindowBuffer &copy) :
+  _mmap_size(copy._mmap_size),
   _x_size(copy._x_size),
   _x_size(copy._x_size),
   _y_size(copy._y_size),
   _y_size(copy._y_size),
   _row_size(copy._row_size),
   _row_size(copy._row_size),
-  _framebuffer_size(copy._framebuffer_size),
-  _mmap_size(copy._mmap_size)
+  _framebuffer_size(copy._framebuffer_size)
 {
 {
   memcpy(_this_magic, _magic_number, magic_number_length);
   memcpy(_this_magic, _magic_number, magic_number_length);
   _event_in = 0;
   _event_in = 0;

+ 4 - 1
panda/src/egg/eggGroup.cxx

@@ -1004,7 +1004,8 @@ string_cs_type(const string &strval) {
     return CST_inv_sphere;
     return CST_inv_sphere;
   } else if (cmp_nocase_uh(strval, "tube") == 0) {
   } else if (cmp_nocase_uh(strval, "tube") == 0) {
     return CST_tube;
     return CST_tube;
-  } else if (cmp_nocase_uh(strval, "floor-mesh") == 0) {    
+  } else if (cmp_nocase_uh(strval, "floor-mesh") == 0 ||
+	     cmp_nocase_uh(strval, "floormesh") == 0) {
     return CST_floor_mesh;
     return CST_floor_mesh;
   } else {
   } else {
     return CST_none;
     return CST_none;
@@ -1491,6 +1492,8 @@ ostream &operator << (ostream &out, EggGroup::CollisionSolidType t) {
     return out << "InvSphere";
     return out << "InvSphere";
   case EggGroup::CST_tube:
   case EggGroup::CST_tube:
     return out << "Tube";
     return out << "Tube";
+  case EggGroup::CST_floor_mesh:
+    return out << "FloorMesh";
   }
   }
 
 
   nassertr(false, out);
   nassertr(false, out);

+ 2 - 2
panda/src/egg/eggTexture.cxx

@@ -550,7 +550,7 @@ has_alpha_channel(int num_components) const {
 //     Function: EggTexture::affects_polygon_alpha
 //     Function: EggTexture::affects_polygon_alpha
 //       Access: Published
 //       Access: Published
 //  Description: Returns true if this texture's environment type or
 //  Description: Returns true if this texture's environment type or
-//               combine mode allows the texture to have an affect on
+//               combine mode allows the texture to have an effect on
 //               the polygon's alpha values, false otherwise.
 //               the polygon's alpha values, false otherwise.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 bool EggTexture::
 bool EggTexture::
@@ -564,13 +564,13 @@ affects_polygon_alpha() const {
   case ET_blend:
   case ET_blend:
   case ET_add:
   case ET_add:
   case ET_blend_color_scale:
   case ET_blend_color_scale:
-    return false;
   case ET_modulate_glow:
   case ET_modulate_glow:
   case ET_modulate_gloss:
   case ET_modulate_gloss:
   case ET_normal:
   case ET_normal:
   case ET_normal_height:
   case ET_normal_height:
   case ET_glow:
   case ET_glow:
   case ET_gloss:
   case ET_gloss:
+  case ET_height:
     return false;
     return false;
 
 
   case ET_selector:
   case ET_selector:

+ 2 - 3
panda/src/event/asyncTaskChain.cxx

@@ -1013,7 +1013,7 @@ finish_sort_group() {
     filter_timeslice_priority();
     filter_timeslice_priority();
   }
   }
 
 
-  nassertr(_num_tasks == _active.size() + _this_active.size() + _next_active.size() + _sleeping.size(), true);
+  nassertr((size_t)_num_tasks == _active.size() + _this_active.size() + _next_active.size() + _sleeping.size(), true);
   make_heap(_active.begin(), _active.end(), AsyncTaskSortPriority());
   make_heap(_active.begin(), _active.end(), AsyncTaskSortPriority());
 
 
   _current_sort = -INT_MAX;
   _current_sort = -INT_MAX;
@@ -1419,12 +1419,11 @@ do_write(ostream &out, int indent_level) const {
 
 
   if (!tasks.empty()) {
   if (!tasks.empty()) {
     sort(tasks.begin(), tasks.end(), AsyncTaskSortPriority());
     sort(tasks.begin(), tasks.end(), AsyncTaskSortPriority());
-    TaskHeap::reverse_iterator ti;
-    int current_sort = tasks.back()->get_sort() - 1;
 
 
     // Since AsyncTaskSortPriority() sorts backwards (because of STL's
     // Since AsyncTaskSortPriority() sorts backwards (because of STL's
     // push_heap semantics), we go through the task list in reverse
     // push_heap semantics), we go through the task list in reverse
     // order to print them forwards.
     // order to print them forwards.
+    TaskHeap::reverse_iterator ti;
     for (ti = tasks.rbegin(); ti != tasks.rend(); ++ti) {
     for (ti = tasks.rbegin(); ti != tasks.rend(); ++ti) {
       AsyncTask *task = (*ti);
       AsyncTask *task = (*ti);
       write_task_line(out, indent_level, task, now);
       write_task_line(out, indent_level, task, now);

+ 1 - 1
panda/src/express/multifile.cxx

@@ -2044,7 +2044,7 @@ read_subfile(int index, pvector<unsigned char> &result) {
     _read->seek_read(pos, buffer, num_bytes, count, eof);
     _read->seek_read(pos, buffer, num_bytes, count, eof);
     while (count != 0) {
     while (count != 0) {
       thread_consider_yield();
       thread_consider_yield();
-      nassertr(count <= max_bytes, false);
+      nassertr(count <= (streamsize)max_bytes, false);
       result.insert(result.end(), buffer, buffer + (size_t)count);
       result.insert(result.end(), buffer, buffer + (size_t)count);
       max_bytes -= (size_t)count;
       max_bytes -= (size_t)count;
       pos += count;
       pos += count;

+ 5 - 4
panda/src/grutil/geoMipTerrain.cxx

@@ -627,10 +627,11 @@ set_heightfield(const Filename &filename, PNMFileType *ftype) {
       reqy = max(3, (int) pow(2.0, ceil(log((double) max(2, imgheader.get_y_size() - 1)) / log(2.0))) + 1);
       reqy = max(3, (int) pow(2.0, ceil(log((double) max(2, imgheader.get_y_size() - 1)) / log(2.0))) + 1);
       
       
       // If it's not a valid size, tell PNMImage to resize it.
       // If it's not a valid size, tell PNMImage to resize it.
-      if (reqx != imgheader.get_x_size() || reqy != imgheader.get_y_size()) {
-        grutil_cat.warning() << "Rescaling heightfield image " << filename
-                             << " from " << imgheader.get_x_size() << "x" << imgheader.get_y_size()
-                             << " to " << reqx << "x" << reqy << " pixels.\n";
+      if (reqx != (unsigned int)imgheader.get_x_size() || reqy != (unsigned int)imgheader.get_y_size()) {
+        grutil_cat.warning()
+	  << "Rescaling heightfield image " << filename
+	  << " from " << imgheader.get_x_size() << "x" << imgheader.get_y_size()
+	  << " to " << reqx << "x" << reqy << " pixels.\n";
         _heightfield.set_read_size(reqx, reqy);
         _heightfield.set_read_size(reqx, reqy);
       }
       }
     }
     }

+ 44 - 44
panda/src/grutil/meshDrawer.cxx

@@ -416,7 +416,7 @@ void MeshDrawer::geometry(NodePath draw_node) {
             prim_vertex_reader->set_row_unsafe(vidx);
             prim_vertex_reader->set_row_unsafe(vidx);
             prim_uv_reader->set_row_unsafe(vidx);
             prim_uv_reader->set_row_unsafe(vidx);
             vec[indx_over] = _render.get_relative_point(
             vec[indx_over] = _render.get_relative_point(
-              current_node_path,prim_vertex_reader->get_data3f());
+							current_node_path,prim_vertex_reader->get_data3f());
             uv[indx_over] = prim_uv_reader->get_data2f();
             uv[indx_over] = prim_uv_reader->get_data2f();
             indx_over++;
             indx_over++;
             if (indx_over > 2) break;
             if (indx_over > 2) break;
@@ -424,8 +424,8 @@ void MeshDrawer::geometry(NodePath draw_node) {
 
 
           // draw polygon
           // draw polygon
           tri(vec[0],color,uv[0],
           tri(vec[0],color,uv[0],
-            vec[1],color,uv[1],
-            vec[2],color,uv[2]);
+	      vec[1],color,uv[1],
+	      vec[2],color,uv[2]);
         }
         }
         // if we are over budget just quit
         // if we are over budget just quit
         if( _clear_index > _end_clear_index) return;
         if( _clear_index > _end_clear_index) return;
@@ -447,37 +447,38 @@ void MeshDrawer::geometry(NodePath draw_node) {
 //               parameters.
 //               parameters.
 //               Frame contains u,v,u-size,v-size quadruple.
 //               Frame contains u,v,u-size,v-size quadruple.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
-void MeshDrawer::link_segment(LVector3f pos, LVector4f frame,
-        float thickness, LVector4f color) {
+void MeshDrawer::
+link_segment(LVector3f pos, LVector4f frame,
+	     float thickness, LVector4f color) {
   assert(_render.get_error_type() == NodePath::ET_ok);
   assert(_render.get_error_type() == NodePath::ET_ok);
   assert(_camera.get_error_type() == NodePath::ET_ok);
   assert(_camera.get_error_type() == NodePath::ET_ok);
-    /*
-     * X
-     * ---X
-     * ===0---X
-     * ===0===0---X
-     * ===0===0===O---X
-     * ===0===0===0===End
-     *
-     * first call marks position X
-     * second call moves position and promises to draw segment
-     * it can't draw it yet because next segment might bend it
-     * third call finally draws segment
-     * and the chain continues till
-     * link_segment_end to flush the linking segments is called.
-     */
-
-    // mark 1st position
-    if(_at_start==0) {
-        _last_pos = pos;
-        _last_thickness = thickness;
-        _last_color = color;
-        _at_start=1;
-        return;
-    }
+  /*
+   * X
+   * ---X
+   * ===0---X
+   * ===0===0---X
+   * ===0===0===O---X
+   * ===0===0===0===End
+   *
+   * first call marks position X
+   * second call moves position and promises to draw segment
+   * it can't draw it yet because next segment might bend it
+   * third call finally draws segment
+   * and the chain continues till
+   * link_segment_end to flush the linking segments is called.
+   */
+
+  // mark 1st position
+  if(_at_start==0) {
+    _last_pos = pos;
+    _last_thickness = thickness;
+    _last_color = color;
+    _at_start=1;
+    return;
+  }
 
 
-    LVector3f start = _last_pos;
-    LVector3f stop = pos;
+  LVector3f start = _last_pos;
+  LVector3f stop = pos;
 
 
   LVector3f cam_start3d = _camera.get_relative_point(_render, start);
   LVector3f cam_start3d = _camera.get_relative_point(_render, start);
   LPoint2f cam_start2d = LVector2f();
   LPoint2f cam_start2d = LVector2f();
@@ -487,9 +488,8 @@ void MeshDrawer::link_segment(LVector3f pos, LVector4f frame,
   PT(Camera) camera = DCAST(Camera, _camera.node());
   PT(Camera) camera = DCAST(Camera, _camera.node());
   PT(Lens) lens = camera->get_lens();
   PT(Lens) lens = camera->get_lens();
 
 
-  bool start_good = lens->project(cam_start3d, cam_start2d);
-  bool stop_good = lens->project(cam_stop3d, cam_stop2d);
-  //if start_good and stop_good:
+  lens->project(cam_start3d, cam_start2d);
+  lens->project(cam_stop3d, cam_stop2d);
 
 
   LVector2f dif =  cam_stop2d - cam_start2d;
   LVector2f dif =  cam_stop2d - cam_start2d;
   float rotation = atan2(dif.get_x(),dif.get_y());
   float rotation = atan2(dif.get_x(),dif.get_y());
@@ -503,12 +503,12 @@ void MeshDrawer::link_segment(LVector3f pos, LVector4f frame,
   // we need to draw it when we know what the next segment looks like
   // we need to draw it when we know what the next segment looks like
   // because it can bend it a little
   // because it can bend it a little
   if(_at_start==1) {
   if(_at_start==1) {
-        _last_v1 = now_v1;
-        _last_v2 = now_v2;
-        _last_v3 = now_v3;
-        _last_v4 = now_v4;
-        _at_start = 2;
-        return;
+    _last_v1 = now_v1;
+    _last_v2 = now_v2;
+    _last_v3 = now_v3;
+    _last_v4 = now_v4;
+    _at_start = 2;
+    return;
   }
   }
 
 
   // draw the last segment a little bent
   // draw the last segment a little bent
@@ -524,11 +524,11 @@ void MeshDrawer::link_segment(LVector3f pos, LVector4f frame,
   float vs = frame.get_w();
   float vs = frame.get_w();
 
 
   tri(v1, _last_color, LVector2f(u,v),
   tri(v1, _last_color, LVector2f(u,v),
-    v2, color, LVector2f(u+us,v),
-    v3, color, LVector2f(u+us,v+vs));
+      v2, color, LVector2f(u+us,v),
+      v3, color, LVector2f(u+us,v+vs));
   tri(v3, color, LVector2f(u+us,v+vs),
   tri(v3, color, LVector2f(u+us,v+vs),
-    v4, _last_color, LVector2f(u,v+vs),
-    v1, _last_color, LVector2f(u,v));
+      v4, _last_color, LVector2f(u,v+vs),
+      v1, _last_color, LVector2f(u,v));
 
 
   // save this segment
   // save this segment
   _last_v1 = v2;
   _last_v1 = v2;

+ 6 - 8
panda/src/grutil/movieTexture.cxx

@@ -63,11 +63,11 @@ CData() :
   _video_width(1),
   _video_width(1),
   _video_height(1),
   _video_height(1),
   _video_length(1.0),
   _video_length(1.0),
-  _playing(false),
   _clock(0.0),
   _clock(0.0),
-  _play_rate(1.0),
+  _playing(false),
   _loop_count(1),
   _loop_count(1),
-  _loops_total(1)
+  _loops_total(1),
+  _play_rate(1.0)
 {
 {
 }
 }
 
 
@@ -82,11 +82,11 @@ CData(const CData &copy) :
   _video_width(copy._video_width),
   _video_width(copy._video_width),
   _video_height(copy._video_height),
   _video_height(copy._video_height),
   _video_length(copy._video_length),
   _video_length(copy._video_length),
-  _playing(false),
   _clock(0.0),
   _clock(0.0),
-  _play_rate(1.0),
+  _playing(false),
   _loop_count(1),
   _loop_count(1),
-  _loops_total(1)
+  _loops_total(1),
+  _play_rate(1.0)
 {
 {
 }
 }
 
 
@@ -189,8 +189,6 @@ do_recalculate_image_properties(CDWriter &cdata, const LoaderOptions &options) {
     if (y_max > x_max) x_max = y_max;
     if (y_max > x_max) x_max = y_max;
   }
   }
 
 
-  int x_size = x_max;
-  int y_size = y_max;
   if (Texture::get_textures_power_2() != ATS_none) {
   if (Texture::get_textures_power_2() != ATS_none) {
     x_max = up_to_power_2(x_max);
     x_max = up_to_power_2(x_max);
     y_max = up_to_power_2(y_max);
     y_max = up_to_power_2(y_max);

+ 2 - 2
panda/src/linmath/lvecBase2_ext_src.I

@@ -118,7 +118,7 @@ __setattr__, PyObject *self, const string &attr_name, PyObject *assign) {
     nassertr(fast != NULL, -1);
     nassertr(fast != NULL, -1);
 
 
     // Let's be strict about size mismatches, to prevent user error.
     // Let's be strict about size mismatches, to prevent user error.
-    if (PySequence_Fast_GET_SIZE(fast) != attr_name.size()) {
+    if (PySequence_Fast_GET_SIZE(fast) != (int)attr_name.size()) {
       PyErr_SetString(PyExc_ValueError, "length mismatch");
       PyErr_SetString(PyExc_ValueError, "length mismatch");
       Py_DECREF(fast);
       Py_DECREF(fast);
       return -1;
       return -1;
@@ -127,7 +127,7 @@ __setattr__, PyObject *self, const string &attr_name, PyObject *assign) {
     // Get a pointer to the items, iterate over it and
     // Get a pointer to the items, iterate over it and
     // perform our magic assignment.  Fast fast.  Oh yeah.
     // perform our magic assignment.  Fast fast.  Oh yeah.
     PyObject** items = PySequence_Fast_ITEMS(fast);
     PyObject** items = PySequence_Fast_ITEMS(fast);
-    for (int i = 0; i < attr_name.size(); ++i) {
+    for (size_t i = 0; i < attr_name.size(); ++i) {
 
 
       PyObject* fl = PyNumber_Float(items[i]);
       PyObject* fl = PyNumber_Float(items[i]);
       if (fl == NULL) {
       if (fl == NULL) {

+ 2 - 2
panda/src/linmath/lvecBase3_ext_src.I

@@ -127,7 +127,7 @@ __setattr__, PyObject *self, const string &attr_name, PyObject *assign) {
     nassertr(fast != NULL, -1);
     nassertr(fast != NULL, -1);
 
 
     // Let's be strict about size mismatches, to prevent user error.
     // Let's be strict about size mismatches, to prevent user error.
-    if (PySequence_Fast_GET_SIZE(fast) != attr_name.size()) {
+    if (PySequence_Fast_GET_SIZE(fast) != (int)attr_name.size()) {
       PyErr_SetString(PyExc_ValueError, "length mismatch");
       PyErr_SetString(PyExc_ValueError, "length mismatch");
       Py_DECREF(fast);
       Py_DECREF(fast);
       return -1;
       return -1;
@@ -136,7 +136,7 @@ __setattr__, PyObject *self, const string &attr_name, PyObject *assign) {
     // Get a pointer to the items, iterate over it and
     // Get a pointer to the items, iterate over it and
     // perform our magic assignment.  Fast fast.  Oh yeah.
     // perform our magic assignment.  Fast fast.  Oh yeah.
     PyObject** items = PySequence_Fast_ITEMS(fast);
     PyObject** items = PySequence_Fast_ITEMS(fast);
-    for (int i = 0; i < attr_name.size(); ++i) {
+    for (size_t i = 0; i < attr_name.size(); ++i) {
 
 
       PyObject* fl = PyNumber_Float(items[i]);
       PyObject* fl = PyNumber_Float(items[i]);
       if (fl == NULL) {
       if (fl == NULL) {

+ 2 - 2
panda/src/linmath/lvecBase4_ext_src.I

@@ -141,7 +141,7 @@ __setattr__, PyObject *self, const string &attr_name, PyObject *assign) {
     nassertr(fast != NULL, -1);
     nassertr(fast != NULL, -1);
 
 
     // Let's be strict about size mismatches, to prevent user error.
     // Let's be strict about size mismatches, to prevent user error.
-    if (PySequence_Fast_GET_SIZE(fast) != attr_name.size()) {
+    if (PySequence_Fast_GET_SIZE(fast) != (int)attr_name.size()) {
       PyErr_SetString(PyExc_ValueError, "length mismatch");
       PyErr_SetString(PyExc_ValueError, "length mismatch");
       Py_DECREF(fast);
       Py_DECREF(fast);
       return -1;
       return -1;
@@ -150,7 +150,7 @@ __setattr__, PyObject *self, const string &attr_name, PyObject *assign) {
     // Get a pointer to the items, iterate over it and
     // Get a pointer to the items, iterate over it and
     // perform our magic assignment.  Fast fast.  Oh yeah.
     // perform our magic assignment.  Fast fast.  Oh yeah.
     PyObject** items = PySequence_Fast_ITEMS(fast);
     PyObject** items = PySequence_Fast_ITEMS(fast);
-    for (int i = 0; i < attr_name.size(); ++i) {
+    for (size_t i = 0; i < attr_name.size(); ++i) {
 
 
       PyObject* fl = PyNumber_Float(items[i]);
       PyObject* fl = PyNumber_Float(items[i]);
       if (fl == NULL) {
       if (fl == NULL) {

+ 3 - 0
panda/src/pgui/pgEntry.cxx

@@ -592,15 +592,18 @@ setup(float width, int num_lines) {
 
 
   switch (text_node->get_align()) {
   switch (text_node->get_align()) {
   case TextNode::A_left:
   case TextNode::A_left:
+  case TextNode::A_boxed_left:
     // The default case.
     // The default case.
     break;
     break;
 
 
   case TextNode::A_center:
   case TextNode::A_center:
+  case TextNode::A_boxed_center:
     frame[0] = -width / 2.0;
     frame[0] = -width / 2.0;
     frame[1] = width / 2.0;
     frame[1] = width / 2.0;
     break;
     break;
 
 
   case TextNode::A_right:
   case TextNode::A_right:
+  case TextNode::A_boxed_right:
     frame[0] = -width;
     frame[0] = -width;
     frame[1] = 0.0f;
     frame[1] = 0.0f;
     break;
     break;

+ 1 - 1
panda/src/pipeline/thread.cxx

@@ -302,7 +302,7 @@ call_python_func(PyObject *function, PyObject *args) {
 
 
   // Create a new Python thread state data structure, so Python can
   // Create a new Python thread state data structure, so Python can
   // properly lock itself.  
   // properly lock itself.  
-  PyObject *result;
+  PyObject *result = NULL;
 
 
   if (this == get_main_thread()) {
   if (this == get_main_thread()) {
     // In the main thread, just call the function.
     // In the main thread, just call the function.

+ 1 - 1
panda/src/pnmtext/freetypeFont.cxx

@@ -62,7 +62,6 @@ FreetypeFont() {
 FreetypeFont::
 FreetypeFont::
 FreetypeFont(const FreetypeFont &copy) :
 FreetypeFont(const FreetypeFont &copy) :
   Namable(copy),
   Namable(copy),
-  _face(copy._face),
   _point_size(copy._point_size),
   _point_size(copy._point_size),
   _requested_pixels_per_unit(copy._requested_pixels_per_unit),
   _requested_pixels_per_unit(copy._requested_pixels_per_unit),
   _tex_pixels_per_unit(copy._tex_pixels_per_unit),
   _tex_pixels_per_unit(copy._tex_pixels_per_unit),
@@ -71,6 +70,7 @@ FreetypeFont(const FreetypeFont &copy) :
   _native_antialias(copy._native_antialias),
   _native_antialias(copy._native_antialias),
   _line_height(copy._line_height),
   _line_height(copy._line_height),
   _space_advance(copy._space_advance),
   _space_advance(copy._space_advance),
+  _face(copy._face),
   _char_size(copy._char_size),
   _char_size(copy._char_size),
   _dpi(copy._dpi),
   _dpi(copy._dpi),
   _pixel_width(copy._pixel_width),
   _pixel_width(copy._pixel_width),

+ 1 - 1
panda/src/pstatclient/pStatClient.cxx

@@ -283,7 +283,7 @@ main_tick() {
           // We have some memory usage on this TypeHandle.  See if we
           // We have some memory usage on this TypeHandle.  See if we
           // have a collector for it.
           // have a collector for it.
           if (!col.is_valid()) {
           if (!col.is_valid()) {
-            const char *category;
+            const char *category = "";
             switch (mc) {
             switch (mc) {
             case TypeHandle::MC_singleton:
             case TypeHandle::MC_singleton:
               category = "Heap:Single";
               category = "Heap:Single";

+ 12 - 0
panda/src/text/textProperties.cxx

@@ -304,6 +304,18 @@ write(ostream &out, int indent_level) const {
     case A_center:
     case A_center:
       out << "A_center\n";
       out << "A_center\n";
       break;
       break;
+
+    case A_boxed_left:
+      out << "A_boxed_left\n";
+      break;
+      
+    case A_boxed_right:
+      out << "A_boxed_right\n";
+      break;
+      
+    case A_boxed_center:
+      out << "A_boxed_center\n";
+      break;
     }
     }
   }
   }