Browse Source

Fix various compile warnings and a few code consistency issues

rdb 9 years ago
parent
commit
4ed199cece

+ 4 - 4
direct/src/plugin/p3dInstance.cxx

@@ -3450,8 +3450,8 @@ paint_window_osx_port() {
   int y_size = min(_wparams.get_win_height(), _swbuffer->get_y_size());
   int y_size = min(_wparams.get_win_height(), _swbuffer->get_y_size());
   size_t rowsize = _swbuffer->get_row_size();
   size_t rowsize = _swbuffer->get_row_size();
 
 
-  Rect src_rect = {0, 0, y_size, x_size};
-  Rect ddrc_rect = {0, 0, y_size, x_size};
+  Rect src_rect = {0, 0, (short)y_size, (short)x_size};
+  Rect ddrc_rect = {0, 0, (short)y_size, (short)x_size};
 
 
   QDErr err;
   QDErr err;
 
 
@@ -3502,7 +3502,7 @@ paint_window_osx_cgcontext(CGContextRef context) {
   int y_size = min(_wparams.get_win_height(), _swbuffer->get_y_size());
   int y_size = min(_wparams.get_win_height(), _swbuffer->get_y_size());
 
 
   if (_buffer_image != NULL) {
   if (_buffer_image != NULL) {
-    CGRect region = { { 0, 0 }, { x_size, y_size } };
+    CGRect region = { { 0, 0 }, { (CGFloat)x_size, (CGFloat)y_size } };
     CGContextDrawImage(context, region, _buffer_image);
     CGContextDrawImage(context, region, _buffer_image);
   }
   }
 }
 }
@@ -3538,7 +3538,7 @@ handle_event_osx_event_record(const P3D_event_data &event) {
     // First, convert the coordinates from screen coordinates to browser
     // First, convert the coordinates from screen coordinates to browser
     // window coordinates.
     // window coordinates.
     WindowRef window = handle._handle._osx_cgcontext._window;
     WindowRef window = handle._handle._osx_cgcontext._window;
-    CGPoint cgpt = { pt.h, pt.v };
+    CGPoint cgpt = { (CGFloat)pt.h, (CGFloat)pt.v };
     HIPointConvert(&cgpt, kHICoordSpaceScreenPixel, NULL,
     HIPointConvert(&cgpt, kHICoordSpaceScreenPixel, NULL,
                    kHICoordSpaceWindow, window);
                    kHICoordSpaceWindow, window);
 
 

+ 8 - 8
direct/src/plugin/p3dOsxSplashWindow.cxx

@@ -267,7 +267,7 @@ refresh() {
     return;
     return;
   }
   }
   if (_toplevel_window != NULL) {
   if (_toplevel_window != NULL) {
-    Rect r = { 0, 0, _win_height, _win_width };
+    Rect r = { 0, 0, (short)_win_height, (short)_win_width };
     InvalWindowRect(_toplevel_window, &r);
     InvalWindowRect(_toplevel_window, &r);
 
 
   } else {
   } else {
@@ -345,7 +345,7 @@ paint_window_osx_cgcontext(CGContextRef context) {
   CGColorSpaceRef rgb_space = CGColorSpaceCreateDeviceRGB();
   CGColorSpaceRef rgb_space = CGColorSpaceCreateDeviceRGB();
   CGColorRef bg = CGColorCreate(rgb_space, bg_components);
   CGColorRef bg = CGColorCreate(rgb_space, bg_components);
 
 
-  CGRect region = { { 0, 0 }, { _win_width, _win_height } };
+  CGRect region = { { 0, 0 }, { (CGFloat)_win_width, (CGFloat)_win_height } };
   CGContextSetFillColorWithColor(context, bg);
   CGContextSetFillColorWithColor(context, bg);
   CGContextFillRect(context, region);
   CGContextFillRect(context, region);
 
 
@@ -407,7 +407,7 @@ handle_event_osx_event_record(const P3D_event_data &event) {
     // First, convert the coordinates from screen coordinates to browser
     // First, convert the coordinates from screen coordinates to browser
     // window coordinates.
     // window coordinates.
     WindowRef window = handle._handle._osx_cgcontext._window;
     WindowRef window = handle._handle._osx_cgcontext._window;
-    CGPoint cgpt = { pt.h, pt.v };
+    CGPoint cgpt = { (CGFloat)pt.h, (CGFloat)pt.v };
     HIPointConvert(&cgpt, kHICoordSpaceScreenPixel, NULL,
     HIPointConvert(&cgpt, kHICoordSpaceScreenPixel, NULL,
                    kHICoordSpaceWindow, window);
                    kHICoordSpaceWindow, window);
 
 
@@ -617,7 +617,7 @@ paint_progress_bar(CGContextRef context) {
   int bar_x, bar_y, bar_width, bar_height;
   int bar_x, bar_y, bar_width, bar_height;
   get_bar_placement(bar_x, bar_y, bar_width, bar_height);
   get_bar_placement(bar_x, bar_y, bar_width, bar_height);
 
 
-  CGRect bar_rect = { { bar_x, bar_y }, { bar_width, bar_height } };
+  CGRect bar_rect = { { (CGFloat)bar_x, (CGFloat)bar_y }, { (CGFloat)bar_width, (CGFloat)bar_height } };
 
 
   // Clear the entire progress bar to white (or the background color).
   // Clear the entire progress bar to white (or the background color).
   CGContextSetFillColorWithColor(context, bar_bg);
   CGContextSetFillColorWithColor(context, bar_bg);
@@ -627,7 +627,7 @@ paint_progress_bar(CGContextRef context) {
   if (_progress_known) {
   if (_progress_known) {
     int progress_width = (int)(bar_width * _install_progress + 0.5);
     int progress_width = (int)(bar_width * _install_progress + 0.5);
     if (progress_width != 0) {
     if (progress_width != 0) {
-      CGRect prog = { { bar_x, bar_y }, { progress_width, bar_height } };
+      CGRect prog = { { (CGFloat)bar_x, (CGFloat)bar_y }, { (CGFloat)progress_width, (CGFloat)bar_height } };
       CGContextSetFillColorWithColor(context, bar);
       CGContextSetFillColorWithColor(context, bar);
       CGContextFillRect(context, prog);
       CGContextFillRect(context, prog);
     }
     }
@@ -642,7 +642,7 @@ paint_progress_bar(CGContextRef context) {
       progress = block_travel * 2 - progress;
       progress = block_travel * 2 - progress;
     }
     }
 
 
-    CGRect prog = { { bar_x + progress, bar_y }, { block_width, bar_height } };
+    CGRect prog = { { (CGFloat)(bar_x + progress), (CGFloat)bar_y }, { (CGFloat)block_width, (CGFloat)bar_height } };
     CGContextSetFillColorWithColor(context, bar);
     CGContextSetFillColorWithColor(context, bar);
     CGContextFillRect(context, prog);
     CGContextFillRect(context, prog);
   }
   }
@@ -652,8 +652,8 @@ paint_progress_bar(CGContextRef context) {
     // We offset the border by half a pixel, so we'll be drawing the one-pixel
     // We offset the border by half a pixel, so we'll be drawing the one-pixel
     // line through the middle of a pixel, and it won't try to antialias
     // line through the middle of a pixel, and it won't try to antialias
     // itself into a half-black two-pixel line.
     // itself into a half-black two-pixel line.
-    CGRect border_rect = { { bar_x - 0.5, bar_y - 0.5 },
-                           { bar_width + 1, bar_height + 1 } };
+    CGRect border_rect = { { (CGFloat)(bar_x - 0.5), (CGFloat)(bar_y - 0.5) },
+                           { (CGFloat)(bar_width + 1), (CGFloat)(bar_height + 1) } };
 
 
     CGContextBeginPath(context);
     CGContextBeginPath(context);
     CGContextSetLineWidth(context, 1);
     CGContextSetLineWidth(context, 1);

+ 7 - 2
dtool/src/dtoolbase/dlmalloc_src.cxx

@@ -587,8 +587,11 @@ MAX_RELEASE_CHECK_RATE   default: 4095 unless not HAVE_MMAP
 #define MAX_SIZE_T           (~(size_t)0)
 #define MAX_SIZE_T           (~(size_t)0)
 
 
 #ifndef USE_LOCKS /* ensure true if spin or recursive locks set */
 #ifndef USE_LOCKS /* ensure true if spin or recursive locks set */
-#define USE_LOCKS  ((defined(USE_SPIN_LOCKS) && USE_SPIN_LOCKS != 0) || \
-                    (defined(USE_RECURSIVE_LOCKS) && USE_RECURSIVE_LOCKS != 0))
+#if (defined(USE_SPIN_LOCKS) && USE_SPIN_LOCKS != 0) || (defined(USE_RECURSIVE_LOCKS) && USE_RECURSIVE_LOCKS != 0)
+#define USE_LOCKS 1
+#else
+#define USE_LOCKS 0
+#endif
 #endif /* USE_LOCKS */
 #endif /* USE_LOCKS */
 
 
 #if USE_LOCKS /* Spin locks for gcc >= 4.1, older gcc on x86, MSC >= 1310 */
 #if USE_LOCKS /* Spin locks for gcc >= 4.1, older gcc on x86, MSC >= 1310 */
@@ -647,7 +650,9 @@ MAX_RELEASE_CHECK_RATE   default: 4095 unless not HAVE_MMAP
 #ifndef HAVE_MREMAP
 #ifndef HAVE_MREMAP
 #ifdef linux
 #ifdef linux
 #define HAVE_MREMAP 1
 #define HAVE_MREMAP 1
+#ifndef _GNU_SOURCE
 #define _GNU_SOURCE /* Turns on mremap() definition */
 #define _GNU_SOURCE /* Turns on mremap() definition */
+#endif
 #else   /* linux */
 #else   /* linux */
 #define HAVE_MREMAP 0
 #define HAVE_MREMAP 0
 #endif  /* linux */
 #endif  /* linux */

+ 1 - 1
dtool/src/interrogate/interfaceMakerPythonNative.cxx

@@ -6198,7 +6198,7 @@ write_make_seq(ostream &out, Object *obj, const std::string &ClassName,
     // the assumption that the called method doesn't do anything with this
     // the assumption that the called method doesn't do anything with this
     // tuple other than unpack it (which is a fairly safe assumption to make).
     // tuple other than unpack it (which is a fairly safe assumption to make).
     out << "  PyTupleObject args;\n";
     out << "  PyTupleObject args;\n";
-    out << "  PyObject_INIT_VAR(&args, &PyTuple_Type, 1);\n";
+    out << "  (void)PyObject_INIT_VAR(&args, &PyTuple_Type, 1);\n";
   }
   }
 
 
   out <<
   out <<

+ 4 - 0
dtool/src/parser-inc/arpa/inet.h

@@ -0,0 +1,4 @@
+#pragma once
+
+#include <inttypes.h>
+#include <netinet/in.h>

+ 9 - 0
dtool/src/parser-inc/netdb.h

@@ -0,0 +1,9 @@
+#pragma once
+
+#include <inttypes.h>
+#include <netinet/in.h>
+
+struct hostent;
+struct netent;
+struct protoent;
+struct servent;

+ 2 - 2
panda/src/audiotraits/fmodAudioManager.cxx

@@ -424,8 +424,8 @@ get_sound(const string &file_name, bool positional, int) {
   vfs->resolve_filename(path, get_model_path());
   vfs->resolve_filename(path, get_model_path());
 
 
   // Build a new AudioSound from the audio data.
   // Build a new AudioSound from the audio data.
-  PT(AudioSound) audioSound = 0;
-  PT(FmodAudioSound) fmodAudioSound = new FmodAudioSound(this, path, positional );
+  PT(AudioSound) audioSound;
+  PT(FmodAudioSound) fmodAudioSound = new FmodAudioSound(this, path, positional);
 
 
   _all_sounds.insert(fmodAudioSound);
   _all_sounds.insert(fmodAudioSound);
 
 

+ 0 - 1
panda/src/audiotraits/openalAudioManager.cxx

@@ -1022,7 +1022,6 @@ cleanup() {
 OpenALAudioManager::SoundData::
 OpenALAudioManager::SoundData::
 SoundData() :
 SoundData() :
   _manager(0),
   _manager(0),
-  _movie(0),
   _sample(0),
   _sample(0),
   _stream(NULL),
   _stream(NULL),
   _length(0.0),
   _length(0.0),

+ 4 - 4
panda/src/collide/collisionBox.cxx

@@ -199,7 +199,7 @@ PT(CollisionEntry) CollisionBox::
 test_intersection_from_sphere(const CollisionEntry &entry) const {
 test_intersection_from_sphere(const CollisionEntry &entry) const {
 
 
   const CollisionSphere *sphere;
   const CollisionSphere *sphere;
-  DCAST_INTO_R(sphere, entry.get_from(), 0);
+  DCAST_INTO_R(sphere, entry.get_from(), NULL);
 
 
   CPT(TransformState) wrt_space = entry.get_wrt_space();
   CPT(TransformState) wrt_space = entry.get_wrt_space();
   CPT(TransformState) wrt_prev_space = entry.get_wrt_prev_space();
   CPT(TransformState) wrt_prev_space = entry.get_wrt_prev_space();
@@ -402,7 +402,7 @@ test_intersection_from_sphere(const CollisionEntry &entry) const {
 PT(CollisionEntry) CollisionBox::
 PT(CollisionEntry) CollisionBox::
 test_intersection_from_ray(const CollisionEntry &entry) const {
 test_intersection_from_ray(const CollisionEntry &entry) const {
   const CollisionRay *ray;
   const CollisionRay *ray;
-  DCAST_INTO_R(ray, entry.get_from(), 0);
+  DCAST_INTO_R(ray, entry.get_from(), NULL);
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
 
 
   LPoint3 from_origin = ray->get_origin() * wrt_mat;
   LPoint3 from_origin = ray->get_origin() * wrt_mat;
@@ -483,7 +483,7 @@ test_intersection_from_ray(const CollisionEntry &entry) const {
 PT(CollisionEntry) CollisionBox::
 PT(CollisionEntry) CollisionBox::
 test_intersection_from_segment(const CollisionEntry &entry) const {
 test_intersection_from_segment(const CollisionEntry &entry) const {
   const CollisionSegment *seg;
   const CollisionSegment *seg;
-  DCAST_INTO_R(seg, entry.get_from(), 0);
+  DCAST_INTO_R(seg, entry.get_from(), NULL);
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
 
 
   LPoint3 from_origin = seg->get_point_a() * wrt_mat;
   LPoint3 from_origin = seg->get_point_a() * wrt_mat;
@@ -564,7 +564,7 @@ test_intersection_from_segment(const CollisionEntry &entry) const {
 PT(CollisionEntry) CollisionBox::
 PT(CollisionEntry) CollisionBox::
 test_intersection_from_box(const CollisionEntry &entry) const {
 test_intersection_from_box(const CollisionEntry &entry) const {
   const CollisionBox *box;
   const CollisionBox *box;
-  DCAST_INTO_R(box, entry.get_from(), 0);
+  DCAST_INTO_R(box, entry.get_from(), NULL);
 
 
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
 
 

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

@@ -125,7 +125,7 @@ compute_internal_bounds() const {
 PT(CollisionEntry) CollisionFloorMesh::
 PT(CollisionEntry) CollisionFloorMesh::
 test_intersection_from_ray(const CollisionEntry &entry) const {
 test_intersection_from_ray(const CollisionEntry &entry) const {
   const CollisionRay *ray;
   const CollisionRay *ray;
-  DCAST_INTO_R(ray, entry.get_from(), 0);
+  DCAST_INTO_R(ray, entry.get_from(), NULL);
   LPoint3 from_origin = ray->get_origin() * entry.get_wrt_mat();
   LPoint3 from_origin = ray->get_origin() * entry.get_wrt_mat();
 
 
   double fx = from_origin[0];
   double fx = from_origin[0];
@@ -190,7 +190,7 @@ test_intersection_from_ray(const CollisionEntry &entry) const {
 PT(CollisionEntry) CollisionFloorMesh::
 PT(CollisionEntry) CollisionFloorMesh::
 test_intersection_from_sphere(const CollisionEntry &entry) const {
 test_intersection_from_sphere(const CollisionEntry &entry) const {
   const CollisionSphere *sphere;
   const CollisionSphere *sphere;
-  DCAST_INTO_R(sphere, entry.get_from(), 0);
+  DCAST_INTO_R(sphere, entry.get_from(), NULL);
   LPoint3 from_origin = sphere->get_center() * entry.get_wrt_mat();
   LPoint3 from_origin = sphere->get_center() * entry.get_wrt_mat();
 
 
   double fx = from_origin[0];
   double fx = from_origin[0];

+ 1 - 1
panda/src/collide/collisionHandlerFluidPusher.cxx

@@ -136,7 +136,7 @@ handle_entries() {
 
 
       // currently we only support spheres as the collider
       // currently we only support spheres as the collider
       const CollisionSphere *sphere;
       const CollisionSphere *sphere;
-      DCAST_INTO_R(sphere, entries.front()->get_from(), 0);
+      DCAST_INTO_R(sphere, entries.front()->get_from(), false);
 
 
       from_node_path.set_pos(wrt_node, 0,0,0);
       from_node_path.set_pos(wrt_node, 0,0,0);
       LPoint3 sphere_offset = (sphere->get_center() *
       LPoint3 sphere_offset = (sphere->get_center() *

+ 4 - 4
panda/src/collide/collisionInvSphere.cxx

@@ -92,7 +92,7 @@ compute_internal_bounds() const {
 PT(CollisionEntry) CollisionInvSphere::
 PT(CollisionEntry) CollisionInvSphere::
 test_intersection_from_sphere(const CollisionEntry &entry) const {
 test_intersection_from_sphere(const CollisionEntry &entry) const {
   const CollisionSphere *sphere;
   const CollisionSphere *sphere;
-  DCAST_INTO_R(sphere, entry.get_from(), 0);
+  DCAST_INTO_R(sphere, entry.get_from(), NULL);
 
 
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
 
 
@@ -144,7 +144,7 @@ test_intersection_from_sphere(const CollisionEntry &entry) const {
 PT(CollisionEntry) CollisionInvSphere::
 PT(CollisionEntry) CollisionInvSphere::
 test_intersection_from_line(const CollisionEntry &entry) const {
 test_intersection_from_line(const CollisionEntry &entry) const {
   const CollisionLine *line;
   const CollisionLine *line;
-  DCAST_INTO_R(line, entry.get_from(), 0);
+  DCAST_INTO_R(line, entry.get_from(), NULL);
 
 
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
 
 
@@ -185,7 +185,7 @@ test_intersection_from_line(const CollisionEntry &entry) const {
 PT(CollisionEntry) CollisionInvSphere::
 PT(CollisionEntry) CollisionInvSphere::
 test_intersection_from_ray(const CollisionEntry &entry) const {
 test_intersection_from_ray(const CollisionEntry &entry) const {
   const CollisionRay *ray;
   const CollisionRay *ray;
-  DCAST_INTO_R(ray, entry.get_from(), 0);
+  DCAST_INTO_R(ray, entry.get_from(), NULL);
 
 
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
 
 
@@ -228,7 +228,7 @@ test_intersection_from_ray(const CollisionEntry &entry) const {
 PT(CollisionEntry) CollisionInvSphere::
 PT(CollisionEntry) CollisionInvSphere::
 test_intersection_from_segment(const CollisionEntry &entry) const {
 test_intersection_from_segment(const CollisionEntry &entry) const {
   const CollisionSegment *segment;
   const CollisionSegment *segment;
-  DCAST_INTO_R(segment, entry.get_from(), 0);
+  DCAST_INTO_R(segment, entry.get_from(), NULL);
 
 
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
 
 

+ 7 - 7
panda/src/collide/collisionPlane.cxx

@@ -107,7 +107,7 @@ compute_internal_bounds() const {
 PT(CollisionEntry) CollisionPlane::
 PT(CollisionEntry) CollisionPlane::
 test_intersection_from_sphere(const CollisionEntry &entry) const {
 test_intersection_from_sphere(const CollisionEntry &entry) const {
   const CollisionSphere *sphere;
   const CollisionSphere *sphere;
-  DCAST_INTO_R(sphere, entry.get_from(), 0);
+  DCAST_INTO_R(sphere, entry.get_from(), NULL);
 
 
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
 
 
@@ -146,7 +146,7 @@ test_intersection_from_sphere(const CollisionEntry &entry) const {
 PT(CollisionEntry) CollisionPlane::
 PT(CollisionEntry) CollisionPlane::
 test_intersection_from_line(const CollisionEntry &entry) const {
 test_intersection_from_line(const CollisionEntry &entry) const {
   const CollisionLine *line;
   const CollisionLine *line;
-  DCAST_INTO_R(line, entry.get_from(), 0);
+  DCAST_INTO_R(line, entry.get_from(), NULL);
 
 
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
 
 
@@ -191,7 +191,7 @@ test_intersection_from_line(const CollisionEntry &entry) const {
 PT(CollisionEntry) CollisionPlane::
 PT(CollisionEntry) CollisionPlane::
 test_intersection_from_ray(const CollisionEntry &entry) const {
 test_intersection_from_ray(const CollisionEntry &entry) const {
   const CollisionRay *ray;
   const CollisionRay *ray;
-  DCAST_INTO_R(ray, entry.get_from(), 0);
+  DCAST_INTO_R(ray, entry.get_from(), NULL);
 
 
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
 
 
@@ -243,7 +243,7 @@ test_intersection_from_ray(const CollisionEntry &entry) const {
 PT(CollisionEntry) CollisionPlane::
 PT(CollisionEntry) CollisionPlane::
 test_intersection_from_segment(const CollisionEntry &entry) const {
 test_intersection_from_segment(const CollisionEntry &entry) const {
   const CollisionSegment *segment;
   const CollisionSegment *segment;
-  DCAST_INTO_R(segment, entry.get_from(), 0);
+  DCAST_INTO_R(segment, entry.get_from(), NULL);
 
 
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
 
 
@@ -300,7 +300,7 @@ test_intersection_from_segment(const CollisionEntry &entry) const {
 PT(CollisionEntry) CollisionPlane::
 PT(CollisionEntry) CollisionPlane::
 test_intersection_from_tube(const CollisionEntry &entry) const {
 test_intersection_from_tube(const CollisionEntry &entry) const {
   const CollisionTube *tube;
   const CollisionTube *tube;
-  DCAST_INTO_R(tube, entry.get_from(), 0);
+  DCAST_INTO_R(tube, entry.get_from(), NULL);
 
 
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
 
 
@@ -371,7 +371,7 @@ test_intersection_from_tube(const CollisionEntry &entry) const {
 PT(CollisionEntry) CollisionPlane::
 PT(CollisionEntry) CollisionPlane::
 test_intersection_from_parabola(const CollisionEntry &entry) const {
 test_intersection_from_parabola(const CollisionEntry &entry) const {
   const CollisionParabola *parabola;
   const CollisionParabola *parabola;
-  DCAST_INTO_R(parabola, entry.get_from(), 0);
+  DCAST_INTO_R(parabola, entry.get_from(), NULL);
 
 
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
 
 
@@ -437,7 +437,7 @@ test_intersection_from_parabola(const CollisionEntry &entry) const {
 PT(CollisionEntry) CollisionPlane::
 PT(CollisionEntry) CollisionPlane::
 test_intersection_from_box(const CollisionEntry &entry) const {
 test_intersection_from_box(const CollisionEntry &entry) const {
   const CollisionBox *box;
   const CollisionBox *box;
-  DCAST_INTO_R(box, entry.get_from(), 0);
+  DCAST_INTO_R(box, entry.get_from(), NULL);
 
 
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
 
 

+ 6 - 6
panda/src/collide/collisionPolygon.cxx

@@ -364,7 +364,7 @@ test_intersection_from_sphere(const CollisionEntry &entry) const {
   }
   }
 
 
   const CollisionSphere *sphere;
   const CollisionSphere *sphere;
-  DCAST_INTO_R(sphere, entry.get_from(), 0);
+  DCAST_INTO_R(sphere, entry.get_from(), NULL);
 
 
   CPT(TransformState) wrt_space = entry.get_wrt_space();
   CPT(TransformState) wrt_space = entry.get_wrt_space();
   CPT(TransformState) wrt_prev_space = entry.get_wrt_prev_space();
   CPT(TransformState) wrt_prev_space = entry.get_wrt_prev_space();
@@ -545,7 +545,7 @@ test_intersection_from_line(const CollisionEntry &entry) const {
   }
   }
 
 
   const CollisionLine *line;
   const CollisionLine *line;
-  DCAST_INTO_R(line, entry.get_from(), 0);
+  DCAST_INTO_R(line, entry.get_from(), NULL);
 
 
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
 
 
@@ -613,7 +613,7 @@ test_intersection_from_ray(const CollisionEntry &entry) const {
   }
   }
 
 
   const CollisionRay *ray;
   const CollisionRay *ray;
-  DCAST_INTO_R(ray, entry.get_from(), 0);
+  DCAST_INTO_R(ray, entry.get_from(), NULL);
 
 
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
 
 
@@ -686,7 +686,7 @@ test_intersection_from_segment(const CollisionEntry &entry) const {
   }
   }
 
 
   const CollisionSegment *segment;
   const CollisionSegment *segment;
-  DCAST_INTO_R(segment, entry.get_from(), 0);
+  DCAST_INTO_R(segment, entry.get_from(), NULL);
 
 
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
 
 
@@ -761,7 +761,7 @@ test_intersection_from_parabola(const CollisionEntry &entry) const {
   }
   }
 
 
   const CollisionParabola *parabola;
   const CollisionParabola *parabola;
-  DCAST_INTO_R(parabola, entry.get_from(), 0);
+  DCAST_INTO_R(parabola, entry.get_from(), NULL);
 
 
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
 
 
@@ -846,7 +846,7 @@ test_intersection_from_parabola(const CollisionEntry &entry) const {
 PT(CollisionEntry) CollisionPolygon::
 PT(CollisionEntry) CollisionPolygon::
 test_intersection_from_box(const CollisionEntry &entry) const {
 test_intersection_from_box(const CollisionEntry &entry) const {
   const CollisionBox *box;
   const CollisionBox *box;
-  DCAST_INTO_R(box, entry.get_from(), 0);
+  DCAST_INTO_R(box, entry.get_from(), NULL);
 
 
   // To make things easier, transform the box into the coordinate space of the
   // To make things easier, transform the box into the coordinate space of the
   // plane.
   // plane.

+ 7 - 7
panda/src/collide/collisionSphere.cxx

@@ -120,7 +120,7 @@ compute_internal_bounds() const {
 PT(CollisionEntry) CollisionSphere::
 PT(CollisionEntry) CollisionSphere::
 test_intersection_from_sphere(const CollisionEntry &entry) const {
 test_intersection_from_sphere(const CollisionEntry &entry) const {
   const CollisionSphere *sphere;
   const CollisionSphere *sphere;
-  DCAST_INTO_R(sphere, entry.get_from(), 0);
+  DCAST_INTO_R(sphere, entry.get_from(), NULL);
 
 
   CPT(TransformState) wrt_space = entry.get_wrt_space();
   CPT(TransformState) wrt_space = entry.get_wrt_space();
 
 
@@ -231,7 +231,7 @@ test_intersection_from_sphere(const CollisionEntry &entry) const {
 PT(CollisionEntry) CollisionSphere::
 PT(CollisionEntry) CollisionSphere::
 test_intersection_from_line(const CollisionEntry &entry) const {
 test_intersection_from_line(const CollisionEntry &entry) const {
   const CollisionLine *line;
   const CollisionLine *line;
-  DCAST_INTO_R(line, entry.get_from(), 0);
+  DCAST_INTO_R(line, entry.get_from(), NULL);
 
 
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
 
 
@@ -271,7 +271,7 @@ test_intersection_from_line(const CollisionEntry &entry) const {
 PT(CollisionEntry) CollisionSphere::
 PT(CollisionEntry) CollisionSphere::
 test_intersection_from_box(const CollisionEntry &entry) const {
 test_intersection_from_box(const CollisionEntry &entry) const {
   const CollisionBox *box;
   const CollisionBox *box;
-  DCAST_INTO_R(box, entry.get_from(), 0);
+  DCAST_INTO_R(box, entry.get_from(), NULL);
 
 
   // Instead of transforming the box into the sphere's coordinate space, we do
   // Instead of transforming the box into the sphere's coordinate space, we do
   // it the other way around.  It's easier that way.
   // it the other way around.  It's easier that way.
@@ -347,7 +347,7 @@ test_intersection_from_box(const CollisionEntry &entry) const {
 PT(CollisionEntry) CollisionSphere::
 PT(CollisionEntry) CollisionSphere::
 test_intersection_from_ray(const CollisionEntry &entry) const {
 test_intersection_from_ray(const CollisionEntry &entry) const {
   const CollisionRay *ray;
   const CollisionRay *ray;
-  DCAST_INTO_R(ray, entry.get_from(), 0);
+  DCAST_INTO_R(ray, entry.get_from(), NULL);
 
 
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
 
 
@@ -394,7 +394,7 @@ test_intersection_from_ray(const CollisionEntry &entry) const {
 PT(CollisionEntry) CollisionSphere::
 PT(CollisionEntry) CollisionSphere::
 test_intersection_from_segment(const CollisionEntry &entry) const {
 test_intersection_from_segment(const CollisionEntry &entry) const {
   const CollisionSegment *segment;
   const CollisionSegment *segment;
-  DCAST_INTO_R(segment, entry.get_from(), 0);
+  DCAST_INTO_R(segment, entry.get_from(), NULL);
 
 
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
 
 
@@ -443,7 +443,7 @@ test_intersection_from_segment(const CollisionEntry &entry) const {
 PT(CollisionEntry) CollisionSphere::
 PT(CollisionEntry) CollisionSphere::
 test_intersection_from_tube(const CollisionEntry &entry) const {
 test_intersection_from_tube(const CollisionEntry &entry) const {
   const CollisionTube *tube;
   const CollisionTube *tube;
-  DCAST_INTO_R(tube, entry.get_from(), 0);
+  DCAST_INTO_R(tube, entry.get_from(), NULL);
 
 
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
 
 
@@ -499,7 +499,7 @@ test_intersection_from_tube(const CollisionEntry &entry) const {
 PT(CollisionEntry) CollisionSphere::
 PT(CollisionEntry) CollisionSphere::
 test_intersection_from_parabola(const CollisionEntry &entry) const {
 test_intersection_from_parabola(const CollisionEntry &entry) const {
   const CollisionParabola *parabola;
   const CollisionParabola *parabola;
-  DCAST_INTO_R(parabola, entry.get_from(), 0);
+  DCAST_INTO_R(parabola, entry.get_from(), NULL);
 
 
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
 
 

+ 5 - 5
panda/src/collide/collisionTube.cxx

@@ -146,7 +146,7 @@ compute_internal_bounds() const {
 PT(CollisionEntry) CollisionTube::
 PT(CollisionEntry) CollisionTube::
 test_intersection_from_sphere(const CollisionEntry &entry) const {
 test_intersection_from_sphere(const CollisionEntry &entry) const {
   const CollisionSphere *sphere;
   const CollisionSphere *sphere;
-  DCAST_INTO_R(sphere, entry.get_from(), 0);
+  DCAST_INTO_R(sphere, entry.get_from(), NULL);
 
 
   CPT(TransformState) wrt_space = entry.get_wrt_space();
   CPT(TransformState) wrt_space = entry.get_wrt_space();
   CPT(TransformState) wrt_prev_space = entry.get_wrt_prev_space();
   CPT(TransformState) wrt_prev_space = entry.get_wrt_prev_space();
@@ -224,7 +224,7 @@ test_intersection_from_sphere(const CollisionEntry &entry) const {
 PT(CollisionEntry) CollisionTube::
 PT(CollisionEntry) CollisionTube::
 test_intersection_from_line(const CollisionEntry &entry) const {
 test_intersection_from_line(const CollisionEntry &entry) const {
   const CollisionLine *line;
   const CollisionLine *line;
-  DCAST_INTO_R(line, entry.get_from(), 0);
+  DCAST_INTO_R(line, entry.get_from(), NULL);
 
 
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
 
 
@@ -272,7 +272,7 @@ test_intersection_from_line(const CollisionEntry &entry) const {
 PT(CollisionEntry) CollisionTube::
 PT(CollisionEntry) CollisionTube::
 test_intersection_from_ray(const CollisionEntry &entry) const {
 test_intersection_from_ray(const CollisionEntry &entry) const {
   const CollisionRay *ray;
   const CollisionRay *ray;
-  DCAST_INTO_R(ray, entry.get_from(), 0);
+  DCAST_INTO_R(ray, entry.get_from(), NULL);
 
 
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
 
 
@@ -333,7 +333,7 @@ test_intersection_from_ray(const CollisionEntry &entry) const {
 PT(CollisionEntry) CollisionTube::
 PT(CollisionEntry) CollisionTube::
 test_intersection_from_segment(const CollisionEntry &entry) const {
 test_intersection_from_segment(const CollisionEntry &entry) const {
   const CollisionSegment *segment;
   const CollisionSegment *segment;
-  DCAST_INTO_R(segment, entry.get_from(), 0);
+  DCAST_INTO_R(segment, entry.get_from(), NULL);
 
 
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
 
 
@@ -397,7 +397,7 @@ test_intersection_from_segment(const CollisionEntry &entry) const {
 PT(CollisionEntry) CollisionTube::
 PT(CollisionEntry) CollisionTube::
 test_intersection_from_parabola(const CollisionEntry &entry) const {
 test_intersection_from_parabola(const CollisionEntry &entry) const {
   const CollisionParabola *parabola;
   const CollisionParabola *parabola;
-  DCAST_INTO_R(parabola, entry.get_from(), 0);
+  DCAST_INTO_R(parabola, entry.get_from(), NULL);
 
 
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
   const LMatrix4 &wrt_mat = entry.get_wrt_mat();
 
 

+ 1 - 1
panda/src/downloader/httpClient.cxx

@@ -807,7 +807,7 @@ load_client_certificate() {
 
 
       // Rewind the "file" to the beginning in order to read the public key
       // Rewind the "file" to the beginning in order to read the public key
       // (which might appear first in the file).
       // (which might appear first in the file).
-      BIO_reset(mbio);
+      (void)BIO_reset(mbio);
 
 
       ERR_clear_error();
       ERR_clear_error();
       _client_certificate_pub =
       _client_certificate_pub =

+ 2 - 2
panda/src/gobj/texture_ext.cxx

@@ -66,7 +66,7 @@ set_ram_image(PyObject *image, Texture::CompressionMode compression,
 
 
       if (view.len % component_width != 0) {
       if (view.len % component_width != 0) {
         PyErr_Format(PyExc_ValueError,
         PyErr_Format(PyExc_ValueError,
-                    "byte buffer is not a multiple of %zu bytes",
+                    "byte buffer is not a multiple of %d bytes",
                     component_width);
                     component_width);
         return;
         return;
       }
       }
@@ -131,7 +131,7 @@ set_ram_image_as(PyObject *image, const string &provided_format) {
 
 
     if (view.len % component_width != 0) {
     if (view.len % component_width != 0) {
       PyErr_Format(PyExc_ValueError,
       PyErr_Format(PyExc_ValueError,
-                  "byte buffer is not a multiple of %zu bytes",
+                  "byte buffer is not a multiple of %d bytes",
                   component_width);
                   component_width);
       return;
       return;
     }
     }

+ 1 - 1
panda/src/ode/odeTriMeshData.cxx

@@ -29,7 +29,7 @@ get_data(dGeomID id) {
   if (iter != data_map.end()) {
   if (iter != data_map.end()) {
     return iter->second;
     return iter->second;
   }
   }
-  return 0;
+  return NULL;
 }
 }
 
 
 void OdeTriMeshData::
 void OdeTriMeshData::

+ 1 - 1
panda/src/ode/odeTriMeshGeom.I

@@ -34,7 +34,7 @@ set_tri_mesh_data(OdeTriMeshData &data) {
 
 
 INLINE PT(OdeTriMeshData) OdeTriMeshGeom::
 INLINE PT(OdeTriMeshData) OdeTriMeshGeom::
 get_tri_mesh_data() const {
 get_tri_mesh_data() const {
-  nassertr(_id != 0 ,0);
+  nassertr(_id != 0, NULL);
   return OdeTriMeshData::get_data(_id);
   return OdeTriMeshData::get_data(_id);
 }
 }
 
 

+ 2 - 2
panda/src/pgraph/clipPlaneAttrib.cxx

@@ -487,7 +487,7 @@ filter_to_max(int max_clip_planes) const {
 CPT(RenderAttrib) ClipPlaneAttrib::
 CPT(RenderAttrib) ClipPlaneAttrib::
 compose_off(const RenderAttrib *other) const {
 compose_off(const RenderAttrib *other) const {
   const ClipPlaneAttrib *ta;
   const ClipPlaneAttrib *ta;
-  DCAST_INTO_R(ta, other, 0);
+  DCAST_INTO_R(ta, other, NULL);
 
 
   if (_off_all_planes || (!ta->_off_all_planes && ta->_off_planes.empty())) {
   if (_off_all_planes || (!ta->_off_all_planes && ta->_off_planes.empty())) {
     // If we turn off all planes, or the other turns none off, the result is
     // If we turn off all planes, or the other turns none off, the result is
@@ -701,7 +701,7 @@ get_hash_impl() const {
 CPT(RenderAttrib) ClipPlaneAttrib::
 CPT(RenderAttrib) ClipPlaneAttrib::
 compose_impl(const RenderAttrib *other) const {
 compose_impl(const RenderAttrib *other) const {
   const ClipPlaneAttrib *ta;
   const ClipPlaneAttrib *ta;
-  DCAST_INTO_R(ta, other, 0);
+  DCAST_INTO_R(ta, other, NULL);
 
 
   if (ta->_off_all_planes) {
   if (ta->_off_all_planes) {
     // If the other type turns off all planes, it doesn't matter what we are.
     // If the other type turns off all planes, it doesn't matter what we are.

+ 1 - 1
panda/src/pgraph/portalClipper.cxx

@@ -39,7 +39,7 @@ PortalClipper::
 PortalClipper(GeometricBoundingVolume *frustum, SceneSetup *scene_setup):
 PortalClipper(GeometricBoundingVolume *frustum, SceneSetup *scene_setup):
 _reduced_viewport_min(-1,-1),
 _reduced_viewport_min(-1,-1),
 _reduced_viewport_max(1,1),
 _reduced_viewport_max(1,1),
-_clip_state(0)
+_clip_state(NULL)
 {
 {
   _previous = new GeomNode("my_frustum");
   _previous = new GeomNode("my_frustum");
 
 

+ 2 - 1
panda/src/physx/physxControllerDesc.h

@@ -23,8 +23,9 @@
  * Descriptor class for a character controller.
  * Descriptor class for a character controller.
  */
  */
 class EXPCL_PANDAPHYSX PhysxControllerDesc {
 class EXPCL_PANDAPHYSX PhysxControllerDesc {
-
 PUBLISHED:
 PUBLISHED:
+  virtual ~PhysxControllerDesc() {};
+
   virtual void set_to_default() = 0;
   virtual void set_to_default() = 0;
   virtual bool is_valid() const = 0;
   virtual bool is_valid() const = 0;
 
 

+ 1 - 1
pandatool/src/xfile/xParser.cxx.prebuilt

@@ -98,7 +98,7 @@
 
 
 static XFile *x_file = (XFile *)NULL;
 static XFile *x_file = (XFile *)NULL;
 static XFileNode *current_node = (XFileNode *)NULL;
 static XFileNode *current_node = (XFileNode *)NULL;
-static PT(XFileDataDef) current_data_def = (XFileDataDef *)NULL;
+static PT(XFileDataDef) current_data_def;
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 // Defining the interface to the parser.
 // Defining the interface to the parser.

+ 1 - 1
pandatool/src/xfile/xParser.yxx

@@ -32,7 +32,7 @@
 
 
 static XFile *x_file = (XFile *)NULL;
 static XFile *x_file = (XFile *)NULL;
 static XFileNode *current_node = (XFileNode *)NULL;
 static XFileNode *current_node = (XFileNode *)NULL;
-static PT(XFileDataDef) current_data_def = (XFileDataDef *)NULL;
+static PT(XFileDataDef) current_data_def;
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 // Defining the interface to the parser.
 // Defining the interface to the parser.