mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 09:23:03 -04:00
cast NULLs to avoid compiler objections
This commit is contained in:
parent
a25c6928d0
commit
a696d20f00
@ -153,7 +153,7 @@ read_prc(istream &in) {
|
||||
|
||||
// Look for the first line in the buffer..
|
||||
char *newline = (char *)memchr((void *)buffer, '\n', count);
|
||||
if (newline == NULL) {
|
||||
if (newline == (char *)NULL) {
|
||||
// The buffer was one long line. Huh.
|
||||
prev_line += string(buffer, count);
|
||||
|
||||
@ -165,7 +165,7 @@ read_prc(istream &in) {
|
||||
// Now look for the next line, etc.
|
||||
char *start = newline + 1;
|
||||
newline = (char *)memchr((void *)start, '\n', buffer_end - start);
|
||||
while (newline != NULL) {
|
||||
while (newline != (char *)NULL) {
|
||||
length = newline - start;
|
||||
read_prc_line(string(start, length + 1));
|
||||
start = newline + 1;
|
||||
@ -290,7 +290,7 @@ get_num_declarations() const {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
const ConfigDeclaration *ConfigPage::
|
||||
get_declaration(int n) const {
|
||||
nassertr(n >= 0 && n < (int)_declarations.size(), NULL);
|
||||
nassertr(n >= 0 && n < (int)_declarations.size(), (ConfigDeclaration *)NULL);
|
||||
return _declarations[n];
|
||||
}
|
||||
|
||||
|
@ -137,7 +137,7 @@ get_num_implicit_pages() const {
|
||||
INLINE ConfigPage *ConfigPageManager::
|
||||
get_implicit_page(int n) const {
|
||||
check_sort_pages();
|
||||
nassertr(n >= 0 && n < (int)_implicit_pages.size(), NULL);
|
||||
nassertr(n >= 0 && n < (int)_implicit_pages.size(), (ConfigPage *)NULL);
|
||||
return _implicit_pages[n];
|
||||
}
|
||||
|
||||
@ -163,7 +163,7 @@ get_num_explicit_pages() const {
|
||||
INLINE ConfigPage *ConfigPageManager::
|
||||
get_explicit_page(int n) const {
|
||||
check_sort_pages();
|
||||
nassertr(n >= 0 && n < (int)_explicit_pages.size(), NULL);
|
||||
nassertr(n >= 0 && n < (int)_explicit_pages.size(), (ConfigPage *)NULL);
|
||||
return _explicit_pages[n];
|
||||
}
|
||||
|
||||
|
@ -204,7 +204,7 @@ get_num_references() const {
|
||||
INLINE const ConfigDeclaration *ConfigVariableCore::
|
||||
get_reference(int n) const {
|
||||
check_sort_declarations();
|
||||
nassertr(n >= 0 && n < (int)_declarations.size(), NULL);
|
||||
nassertr(n >= 0 && n < (int)_declarations.size(), (ConfigDeclaration *)NULL);
|
||||
return _declarations[n];
|
||||
}
|
||||
|
||||
@ -238,7 +238,7 @@ get_num_trusted_references() const {
|
||||
INLINE const ConfigDeclaration *ConfigVariableCore::
|
||||
get_trusted_reference(int n) const {
|
||||
check_sort_declarations();
|
||||
nassertr(n >= 0 && n < (int)_trusted_declarations.size(), NULL);
|
||||
nassertr(n >= 0 && n < (int)_trusted_declarations.size(), (ConfigDeclaration *)NULL);
|
||||
return _trusted_declarations[n];
|
||||
}
|
||||
|
||||
@ -265,7 +265,7 @@ get_num_unique_references() const {
|
||||
INLINE const ConfigDeclaration *ConfigVariableCore::
|
||||
get_unique_reference(int n) const {
|
||||
check_sort_declarations();
|
||||
nassertr(n >= 0 && n < (int)_unique_declarations.size(), NULL);
|
||||
nassertr(n >= 0 && n < (int)_unique_declarations.size(), (ConfigDeclaration *)NULL);
|
||||
return _unique_declarations[n];
|
||||
}
|
||||
|
||||
|
@ -246,7 +246,7 @@ bool ConfigVariableCore::
|
||||
clear_local_value() {
|
||||
if (_local_value != (ConfigDeclaration *)NULL) {
|
||||
ConfigPage::get_local_page()->delete_declaration(_local_value);
|
||||
_local_value = NULL;
|
||||
_local_value = (ConfigDeclaration *)NULL;
|
||||
_value_seq++;
|
||||
return true;
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ get_num_variables() const {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE ConfigVariableCore *ConfigVariableManager::
|
||||
get_variable(int n) const {
|
||||
nassertr(n >= 0 && n < (int)_variables.size(), NULL);
|
||||
nassertr(n >= 0 && n < (int)_variables.size(), (ConfigVariableCore *)NULL);
|
||||
return _variables[n];
|
||||
}
|
||||
|
||||
|
@ -253,7 +253,7 @@ get_top_category() {
|
||||
NotifyCategory *Notify::
|
||||
get_category(const string &basename, NotifyCategory *parent_category) {
|
||||
// The string should not contain colons.
|
||||
nassertr(basename.find(':') == string::npos, NULL);
|
||||
nassertr(basename.find(':') == string::npos, (NotifyCategory *)NULL);
|
||||
|
||||
string fullname;
|
||||
if (parent_category != (NotifyCategory *)NULL) {
|
||||
@ -270,7 +270,7 @@ get_category(const string &basename, NotifyCategory *parent_category) {
|
||||
}
|
||||
|
||||
pair<Categories::iterator, bool> result =
|
||||
_categories.insert(Categories::value_type(fullname, NULL));
|
||||
_categories.insert(Categories::value_type(fullname, (NotifyCategory *)NULL));
|
||||
|
||||
bool inserted = result.second;
|
||||
NotifyCategory *&category = (*result.first).second;
|
||||
|
@ -66,7 +66,7 @@ void PrcKeyRegistry::
|
||||
record_keys(const KeyDef *key_def, int num_keys) {
|
||||
for (int i = 0; i < num_keys; i++) {
|
||||
const KeyDef *def = &key_def[i];
|
||||
if (def->_data != NULL) {
|
||||
if (def->_data != (char *)NULL) {
|
||||
// Clear the ith key.
|
||||
while ((int)_keys.size() <= i) {
|
||||
Key key;
|
||||
@ -136,7 +136,7 @@ get_num_keys() const {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
EVP_PKEY *PrcKeyRegistry::
|
||||
get_key(int n) const {
|
||||
nassertr(n >= 0 && n < (int)_keys.size(), NULL);
|
||||
nassertr(n >= 0 && n < (int)_keys.size(), (EVP_PKEY *)NULL);
|
||||
|
||||
if (_keys[n]._def != (KeyDef *)NULL) {
|
||||
if (_keys[n]._pkey == (EVP_PKEY *)NULL) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user