mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
Fix various compile warnings and a few code consistency issues
This commit is contained in:
parent
ba5bba42b0
commit
4ed199cece
@ -3450,8 +3450,8 @@ paint_window_osx_port() {
|
||||
int y_size = min(_wparams.get_win_height(), _swbuffer->get_y_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;
|
||||
|
||||
@ -3502,7 +3502,7 @@ paint_window_osx_cgcontext(CGContextRef context) {
|
||||
int y_size = min(_wparams.get_win_height(), _swbuffer->get_y_size());
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
@ -3538,7 +3538,7 @@ handle_event_osx_event_record(const P3D_event_data &event) {
|
||||
// First, convert the coordinates from screen coordinates to browser
|
||||
// window coordinates.
|
||||
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,
|
||||
kHICoordSpaceWindow, window);
|
||||
|
||||
|
@ -267,7 +267,7 @@ refresh() {
|
||||
return;
|
||||
}
|
||||
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);
|
||||
|
||||
} else {
|
||||
@ -345,7 +345,7 @@ paint_window_osx_cgcontext(CGContextRef context) {
|
||||
CGColorSpaceRef rgb_space = CGColorSpaceCreateDeviceRGB();
|
||||
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);
|
||||
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
|
||||
// window coordinates.
|
||||
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,
|
||||
kHICoordSpaceWindow, window);
|
||||
|
||||
@ -617,7 +617,7 @@ paint_progress_bar(CGContextRef context) {
|
||||
int 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).
|
||||
CGContextSetFillColorWithColor(context, bar_bg);
|
||||
@ -627,7 +627,7 @@ paint_progress_bar(CGContextRef context) {
|
||||
if (_progress_known) {
|
||||
int progress_width = (int)(bar_width * _install_progress + 0.5);
|
||||
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);
|
||||
CGContextFillRect(context, prog);
|
||||
}
|
||||
@ -642,7 +642,7 @@ paint_progress_bar(CGContextRef context) {
|
||||
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);
|
||||
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
|
||||
// line through the middle of a pixel, and it won't try to antialias
|
||||
// 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);
|
||||
CGContextSetLineWidth(context, 1);
|
||||
|
@ -587,8 +587,11 @@ MAX_RELEASE_CHECK_RATE default: 4095 unless not HAVE_MMAP
|
||||
#define MAX_SIZE_T (~(size_t)0)
|
||||
|
||||
#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 */
|
||||
|
||||
#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
|
||||
#ifdef linux
|
||||
#define HAVE_MREMAP 1
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE /* Turns on mremap() definition */
|
||||
#endif
|
||||
#else /* linux */
|
||||
#define HAVE_MREMAP 0
|
||||
#endif /* linux */
|
||||
|
@ -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
|
||||
// tuple other than unpack it (which is a fairly safe assumption to make).
|
||||
out << " PyTupleObject args;\n";
|
||||
out << " PyObject_INIT_VAR(&args, &PyTuple_Type, 1);\n";
|
||||
out << " (void)PyObject_INIT_VAR(&args, &PyTuple_Type, 1);\n";
|
||||
}
|
||||
|
||||
out <<
|
||||
|
4
dtool/src/parser-inc/arpa/inet.h
Normal file
4
dtool/src/parser-inc/arpa/inet.h
Normal file
@ -0,0 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <netinet/in.h>
|
9
dtool/src/parser-inc/netdb.h
Normal file
9
dtool/src/parser-inc/netdb.h
Normal file
@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
struct hostent;
|
||||
struct netent;
|
||||
struct protoent;
|
||||
struct servent;
|
@ -424,8 +424,8 @@ get_sound(const string &file_name, bool positional, int) {
|
||||
vfs->resolve_filename(path, get_model_path());
|
||||
|
||||
// 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);
|
||||
|
||||
|
@ -1022,7 +1022,6 @@ cleanup() {
|
||||
OpenALAudioManager::SoundData::
|
||||
SoundData() :
|
||||
_manager(0),
|
||||
_movie(0),
|
||||
_sample(0),
|
||||
_stream(NULL),
|
||||
_length(0.0),
|
||||
|
@ -199,7 +199,7 @@ PT(CollisionEntry) CollisionBox::
|
||||
test_intersection_from_sphere(const CollisionEntry &entry) const {
|
||||
|
||||
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_prev_space = entry.get_wrt_prev_space();
|
||||
@ -402,7 +402,7 @@ test_intersection_from_sphere(const CollisionEntry &entry) const {
|
||||
PT(CollisionEntry) CollisionBox::
|
||||
test_intersection_from_ray(const CollisionEntry &entry) const {
|
||||
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();
|
||||
|
||||
LPoint3 from_origin = ray->get_origin() * wrt_mat;
|
||||
@ -483,7 +483,7 @@ test_intersection_from_ray(const CollisionEntry &entry) const {
|
||||
PT(CollisionEntry) CollisionBox::
|
||||
test_intersection_from_segment(const CollisionEntry &entry) const {
|
||||
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();
|
||||
|
||||
LPoint3 from_origin = seg->get_point_a() * wrt_mat;
|
||||
@ -564,7 +564,7 @@ test_intersection_from_segment(const CollisionEntry &entry) const {
|
||||
PT(CollisionEntry) CollisionBox::
|
||||
test_intersection_from_box(const CollisionEntry &entry) const {
|
||||
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();
|
||||
|
||||
|
@ -125,7 +125,7 @@ compute_internal_bounds() const {
|
||||
PT(CollisionEntry) CollisionFloorMesh::
|
||||
test_intersection_from_ray(const CollisionEntry &entry) const {
|
||||
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();
|
||||
|
||||
double fx = from_origin[0];
|
||||
@ -190,7 +190,7 @@ test_intersection_from_ray(const CollisionEntry &entry) const {
|
||||
PT(CollisionEntry) CollisionFloorMesh::
|
||||
test_intersection_from_sphere(const CollisionEntry &entry) const {
|
||||
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();
|
||||
|
||||
double fx = from_origin[0];
|
||||
|
@ -136,7 +136,7 @@ handle_entries() {
|
||||
|
||||
// currently we only support spheres as the collider
|
||||
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);
|
||||
LPoint3 sphere_offset = (sphere->get_center() *
|
||||
|
@ -92,7 +92,7 @@ compute_internal_bounds() const {
|
||||
PT(CollisionEntry) CollisionInvSphere::
|
||||
test_intersection_from_sphere(const CollisionEntry &entry) const {
|
||||
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();
|
||||
|
||||
@ -144,7 +144,7 @@ test_intersection_from_sphere(const CollisionEntry &entry) const {
|
||||
PT(CollisionEntry) CollisionInvSphere::
|
||||
test_intersection_from_line(const CollisionEntry &entry) const {
|
||||
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();
|
||||
|
||||
@ -185,7 +185,7 @@ test_intersection_from_line(const CollisionEntry &entry) const {
|
||||
PT(CollisionEntry) CollisionInvSphere::
|
||||
test_intersection_from_ray(const CollisionEntry &entry) const {
|
||||
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();
|
||||
|
||||
@ -228,7 +228,7 @@ test_intersection_from_ray(const CollisionEntry &entry) const {
|
||||
PT(CollisionEntry) CollisionInvSphere::
|
||||
test_intersection_from_segment(const CollisionEntry &entry) const {
|
||||
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();
|
||||
|
||||
|
@ -107,7 +107,7 @@ compute_internal_bounds() const {
|
||||
PT(CollisionEntry) CollisionPlane::
|
||||
test_intersection_from_sphere(const CollisionEntry &entry) const {
|
||||
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();
|
||||
|
||||
@ -146,7 +146,7 @@ test_intersection_from_sphere(const CollisionEntry &entry) const {
|
||||
PT(CollisionEntry) CollisionPlane::
|
||||
test_intersection_from_line(const CollisionEntry &entry) const {
|
||||
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();
|
||||
|
||||
@ -191,7 +191,7 @@ test_intersection_from_line(const CollisionEntry &entry) const {
|
||||
PT(CollisionEntry) CollisionPlane::
|
||||
test_intersection_from_ray(const CollisionEntry &entry) const {
|
||||
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();
|
||||
|
||||
@ -243,7 +243,7 @@ test_intersection_from_ray(const CollisionEntry &entry) const {
|
||||
PT(CollisionEntry) CollisionPlane::
|
||||
test_intersection_from_segment(const CollisionEntry &entry) const {
|
||||
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();
|
||||
|
||||
@ -300,7 +300,7 @@ test_intersection_from_segment(const CollisionEntry &entry) const {
|
||||
PT(CollisionEntry) CollisionPlane::
|
||||
test_intersection_from_tube(const CollisionEntry &entry) const {
|
||||
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();
|
||||
|
||||
@ -371,7 +371,7 @@ test_intersection_from_tube(const CollisionEntry &entry) const {
|
||||
PT(CollisionEntry) CollisionPlane::
|
||||
test_intersection_from_parabola(const CollisionEntry &entry) const {
|
||||
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();
|
||||
|
||||
@ -437,7 +437,7 @@ test_intersection_from_parabola(const CollisionEntry &entry) const {
|
||||
PT(CollisionEntry) CollisionPlane::
|
||||
test_intersection_from_box(const CollisionEntry &entry) const {
|
||||
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();
|
||||
|
||||
|
@ -364,7 +364,7 @@ test_intersection_from_sphere(const CollisionEntry &entry) const {
|
||||
}
|
||||
|
||||
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_prev_space = entry.get_wrt_prev_space();
|
||||
@ -545,7 +545,7 @@ test_intersection_from_line(const CollisionEntry &entry) const {
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
@ -613,7 +613,7 @@ test_intersection_from_ray(const CollisionEntry &entry) const {
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
@ -686,7 +686,7 @@ test_intersection_from_segment(const CollisionEntry &entry) const {
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
@ -761,7 +761,7 @@ test_intersection_from_parabola(const CollisionEntry &entry) const {
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
@ -846,7 +846,7 @@ test_intersection_from_parabola(const CollisionEntry &entry) const {
|
||||
PT(CollisionEntry) CollisionPolygon::
|
||||
test_intersection_from_box(const CollisionEntry &entry) const {
|
||||
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
|
||||
// plane.
|
||||
|
@ -120,7 +120,7 @@ compute_internal_bounds() const {
|
||||
PT(CollisionEntry) CollisionSphere::
|
||||
test_intersection_from_sphere(const CollisionEntry &entry) const {
|
||||
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();
|
||||
|
||||
@ -231,7 +231,7 @@ test_intersection_from_sphere(const CollisionEntry &entry) const {
|
||||
PT(CollisionEntry) CollisionSphere::
|
||||
test_intersection_from_line(const CollisionEntry &entry) const {
|
||||
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();
|
||||
|
||||
@ -271,7 +271,7 @@ test_intersection_from_line(const CollisionEntry &entry) const {
|
||||
PT(CollisionEntry) CollisionSphere::
|
||||
test_intersection_from_box(const CollisionEntry &entry) const {
|
||||
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
|
||||
// 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::
|
||||
test_intersection_from_ray(const CollisionEntry &entry) const {
|
||||
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();
|
||||
|
||||
@ -394,7 +394,7 @@ test_intersection_from_ray(const CollisionEntry &entry) const {
|
||||
PT(CollisionEntry) CollisionSphere::
|
||||
test_intersection_from_segment(const CollisionEntry &entry) const {
|
||||
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();
|
||||
|
||||
@ -443,7 +443,7 @@ test_intersection_from_segment(const CollisionEntry &entry) const {
|
||||
PT(CollisionEntry) CollisionSphere::
|
||||
test_intersection_from_tube(const CollisionEntry &entry) const {
|
||||
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();
|
||||
|
||||
@ -499,7 +499,7 @@ test_intersection_from_tube(const CollisionEntry &entry) const {
|
||||
PT(CollisionEntry) CollisionSphere::
|
||||
test_intersection_from_parabola(const CollisionEntry &entry) const {
|
||||
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();
|
||||
|
||||
|
@ -146,7 +146,7 @@ compute_internal_bounds() const {
|
||||
PT(CollisionEntry) CollisionTube::
|
||||
test_intersection_from_sphere(const CollisionEntry &entry) const {
|
||||
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_prev_space = entry.get_wrt_prev_space();
|
||||
@ -224,7 +224,7 @@ test_intersection_from_sphere(const CollisionEntry &entry) const {
|
||||
PT(CollisionEntry) CollisionTube::
|
||||
test_intersection_from_line(const CollisionEntry &entry) const {
|
||||
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();
|
||||
|
||||
@ -272,7 +272,7 @@ test_intersection_from_line(const CollisionEntry &entry) const {
|
||||
PT(CollisionEntry) CollisionTube::
|
||||
test_intersection_from_ray(const CollisionEntry &entry) const {
|
||||
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();
|
||||
|
||||
@ -333,7 +333,7 @@ test_intersection_from_ray(const CollisionEntry &entry) const {
|
||||
PT(CollisionEntry) CollisionTube::
|
||||
test_intersection_from_segment(const CollisionEntry &entry) const {
|
||||
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();
|
||||
|
||||
@ -397,7 +397,7 @@ test_intersection_from_segment(const CollisionEntry &entry) const {
|
||||
PT(CollisionEntry) CollisionTube::
|
||||
test_intersection_from_parabola(const CollisionEntry &entry) const {
|
||||
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();
|
||||
|
||||
|
@ -807,7 +807,7 @@ load_client_certificate() {
|
||||
|
||||
// Rewind the "file" to the beginning in order to read the public key
|
||||
// (which might appear first in the file).
|
||||
BIO_reset(mbio);
|
||||
(void)BIO_reset(mbio);
|
||||
|
||||
ERR_clear_error();
|
||||
_client_certificate_pub =
|
||||
|
@ -66,7 +66,7 @@ set_ram_image(PyObject *image, Texture::CompressionMode compression,
|
||||
|
||||
if (view.len % component_width != 0) {
|
||||
PyErr_Format(PyExc_ValueError,
|
||||
"byte buffer is not a multiple of %zu bytes",
|
||||
"byte buffer is not a multiple of %d bytes",
|
||||
component_width);
|
||||
return;
|
||||
}
|
||||
@ -131,7 +131,7 @@ set_ram_image_as(PyObject *image, const string &provided_format) {
|
||||
|
||||
if (view.len % component_width != 0) {
|
||||
PyErr_Format(PyExc_ValueError,
|
||||
"byte buffer is not a multiple of %zu bytes",
|
||||
"byte buffer is not a multiple of %d bytes",
|
||||
component_width);
|
||||
return;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ get_data(dGeomID id) {
|
||||
if (iter != data_map.end()) {
|
||||
return iter->second;
|
||||
}
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void OdeTriMeshData::
|
||||
|
@ -34,7 +34,7 @@ set_tri_mesh_data(OdeTriMeshData &data) {
|
||||
|
||||
INLINE PT(OdeTriMeshData) OdeTriMeshGeom::
|
||||
get_tri_mesh_data() const {
|
||||
nassertr(_id != 0 ,0);
|
||||
nassertr(_id != 0, NULL);
|
||||
return OdeTriMeshData::get_data(_id);
|
||||
}
|
||||
|
||||
|
@ -487,7 +487,7 @@ filter_to_max(int max_clip_planes) const {
|
||||
CPT(RenderAttrib) ClipPlaneAttrib::
|
||||
compose_off(const RenderAttrib *other) const {
|
||||
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 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::
|
||||
compose_impl(const RenderAttrib *other) const {
|
||||
const ClipPlaneAttrib *ta;
|
||||
DCAST_INTO_R(ta, other, 0);
|
||||
DCAST_INTO_R(ta, other, NULL);
|
||||
|
||||
if (ta->_off_all_planes) {
|
||||
// If the other type turns off all planes, it doesn't matter what we are.
|
||||
|
@ -39,7 +39,7 @@ PortalClipper::
|
||||
PortalClipper(GeometricBoundingVolume *frustum, SceneSetup *scene_setup):
|
||||
_reduced_viewport_min(-1,-1),
|
||||
_reduced_viewport_max(1,1),
|
||||
_clip_state(0)
|
||||
_clip_state(NULL)
|
||||
{
|
||||
_previous = new GeomNode("my_frustum");
|
||||
|
||||
|
@ -23,8 +23,9 @@
|
||||
* Descriptor class for a character controller.
|
||||
*/
|
||||
class EXPCL_PANDAPHYSX PhysxControllerDesc {
|
||||
|
||||
PUBLISHED:
|
||||
virtual ~PhysxControllerDesc() {};
|
||||
|
||||
virtual void set_to_default() = 0;
|
||||
virtual bool is_valid() const = 0;
|
||||
|
||||
|
@ -98,7 +98,7 @@
|
||||
|
||||
static XFile *x_file = (XFile *)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.
|
||||
|
@ -32,7 +32,7 @@
|
||||
|
||||
static XFile *x_file = (XFile *)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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user