mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
fix some cases of 'return false' in functions returning a pointer or integer
This commit is contained in:
parent
56f7c3edf2
commit
7a9e94cac9
@ -242,7 +242,7 @@ open_read_file(const Filename &file) const {
|
||||
PT(FileBase) f = _root.do_find_file(file);
|
||||
((VirtualFileMountRamdisk *)this)->_lock.release();
|
||||
if (f == (FileBase *)NULL || f->is_directory()) {
|
||||
return false;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
File *f2 = DCAST(File, f);
|
||||
@ -263,7 +263,7 @@ open_write_file(const Filename &file, bool truncate) {
|
||||
PT(File) f = _root.do_create_file(file);
|
||||
_lock.release();
|
||||
if (f == (File *)NULL) {
|
||||
return false;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (truncate) {
|
||||
@ -288,7 +288,7 @@ open_append_file(const Filename &file) {
|
||||
PT(File) f = _root.do_create_file(file);
|
||||
_lock.release();
|
||||
if (f == (File *)NULL) {
|
||||
return false;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return new OSubStream(&f->_wrapper, 0, 0, true);
|
||||
@ -308,7 +308,7 @@ open_read_write_file(const Filename &file, bool truncate) {
|
||||
PT(File) f = _root.do_create_file(file);
|
||||
_lock.release();
|
||||
if (f == (File *)NULL) {
|
||||
return false;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return new SubStream(&f->_wrapper, 0, 0);
|
||||
@ -328,7 +328,7 @@ open_read_append_file(const Filename &file) {
|
||||
PT(FileBase) f = _root.do_find_file(file);
|
||||
_lock.release();
|
||||
if (f == (FileBase *)NULL || f->is_directory()) {
|
||||
return false;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
File *f2 = DCAST(File, f);
|
||||
@ -350,7 +350,7 @@ get_file_size(const Filename &file, istream *stream) const {
|
||||
PT(FileBase) f = _root.do_find_file(file);
|
||||
((VirtualFileMountRamdisk *)this)->_lock.release();
|
||||
if (f == (FileBase *)NULL || f->is_directory()) {
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
File *f2 = DCAST(File, f);
|
||||
@ -369,7 +369,7 @@ get_file_size(const Filename &file) const {
|
||||
PT(FileBase) f = _root.do_find_file(file);
|
||||
((VirtualFileMountRamdisk *)this)->_lock.release();
|
||||
if (f == (FileBase *)NULL || f->is_directory()) {
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
File *f2 = DCAST(File, f);
|
||||
|
@ -258,7 +258,7 @@ ns_load_texture(const Filename &orig_filename, int primary_file_num_channels,
|
||||
// No such file.
|
||||
gobj_cat.error()
|
||||
<< "Could not find " << filename << "\n";
|
||||
return false;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (gobj_cat.is_debug()) {
|
||||
@ -271,7 +271,7 @@ ns_load_texture(const Filename &orig_filename, int primary_file_num_channels,
|
||||
vfs->close_read_file(in);
|
||||
|
||||
if (tex == (Texture *)NULL) {
|
||||
return false;
|
||||
return NULL;
|
||||
}
|
||||
tex->set_fullpath(filename);
|
||||
tex->clear_alpha_fullpath();
|
||||
@ -561,7 +561,7 @@ ns_load_3d_texture(const Filename &filename_pattern,
|
||||
}
|
||||
|
||||
// Set the original filename, before we searched along the path.
|
||||
nassertr(tex != (Texture *)NULL, false);
|
||||
nassertr(tex != (Texture *)NULL, NULL);
|
||||
tex->set_filename(filename_pattern);
|
||||
tex->set_fullpath(filename);
|
||||
tex->_texture_pool_key = filename;
|
||||
@ -667,7 +667,7 @@ ns_load_2d_texture_array(const Filename &filename_pattern,
|
||||
}
|
||||
|
||||
// Set the original filename, before we searched along the path.
|
||||
nassertr(tex != (Texture *)NULL, false);
|
||||
nassertr(tex != (Texture *)NULL, NULL);
|
||||
tex->set_filename(filename_pattern);
|
||||
tex->set_fullpath(filename);
|
||||
tex->_texture_pool_key = filename;
|
||||
@ -768,7 +768,7 @@ ns_load_cube_map(const Filename &filename_pattern, bool read_mipmaps,
|
||||
}
|
||||
|
||||
// Set the original filename, before we searched along the path.
|
||||
nassertr(tex != (Texture *)NULL, false);
|
||||
nassertr(tex != (Texture *)NULL, NULL);
|
||||
tex->set_filename(filename_pattern);
|
||||
tex->set_fullpath(filename);
|
||||
tex->_texture_pool_key = filename;
|
||||
|
Loading…
x
Reference in New Issue
Block a user