cast NULLs to avoid compiler objections

This commit is contained in:
David Rose 2004-12-01 18:13:37 +00:00
parent a25c6928d0
commit a696d20f00
7 changed files with 14 additions and 14 deletions

View File

@ -153,7 +153,7 @@ read_prc(istream &in) {
// Look for the first line in the buffer.. // Look for the first line in the buffer..
char *newline = (char *)memchr((void *)buffer, '\n', count); char *newline = (char *)memchr((void *)buffer, '\n', count);
if (newline == NULL) { if (newline == (char *)NULL) {
// The buffer was one long line. Huh. // The buffer was one long line. Huh.
prev_line += string(buffer, count); prev_line += string(buffer, count);
@ -165,7 +165,7 @@ read_prc(istream &in) {
// Now look for the next line, etc. // Now look for the next line, etc.
char *start = newline + 1; char *start = newline + 1;
newline = (char *)memchr((void *)start, '\n', buffer_end - start); newline = (char *)memchr((void *)start, '\n', buffer_end - start);
while (newline != NULL) { while (newline != (char *)NULL) {
length = newline - start; length = newline - start;
read_prc_line(string(start, length + 1)); read_prc_line(string(start, length + 1));
start = newline + 1; start = newline + 1;
@ -290,7 +290,7 @@ get_num_declarations() const {
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
const ConfigDeclaration *ConfigPage:: const ConfigDeclaration *ConfigPage::
get_declaration(int n) const { 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]; return _declarations[n];
} }

View File

@ -137,7 +137,7 @@ get_num_implicit_pages() const {
INLINE ConfigPage *ConfigPageManager:: INLINE ConfigPage *ConfigPageManager::
get_implicit_page(int n) const { get_implicit_page(int n) const {
check_sort_pages(); 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]; return _implicit_pages[n];
} }
@ -163,7 +163,7 @@ get_num_explicit_pages() const {
INLINE ConfigPage *ConfigPageManager:: INLINE ConfigPage *ConfigPageManager::
get_explicit_page(int n) const { get_explicit_page(int n) const {
check_sort_pages(); 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]; return _explicit_pages[n];
} }

View File

@ -204,7 +204,7 @@ get_num_references() const {
INLINE const ConfigDeclaration *ConfigVariableCore:: INLINE const ConfigDeclaration *ConfigVariableCore::
get_reference(int n) const { get_reference(int n) const {
check_sort_declarations(); check_sort_declarations();
nassertr(n >= 0 && n < (int)_declarations.size(), NULL); nassertr(n >= 0 && n < (int)_declarations.size(), (ConfigDeclaration *)NULL);
return _declarations[n]; return _declarations[n];
} }
@ -238,7 +238,7 @@ get_num_trusted_references() const {
INLINE const ConfigDeclaration *ConfigVariableCore:: INLINE const ConfigDeclaration *ConfigVariableCore::
get_trusted_reference(int n) const { get_trusted_reference(int n) const {
check_sort_declarations(); 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]; return _trusted_declarations[n];
} }
@ -265,7 +265,7 @@ get_num_unique_references() const {
INLINE const ConfigDeclaration *ConfigVariableCore:: INLINE const ConfigDeclaration *ConfigVariableCore::
get_unique_reference(int n) const { get_unique_reference(int n) const {
check_sort_declarations(); 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]; return _unique_declarations[n];
} }

View File

@ -246,7 +246,7 @@ bool ConfigVariableCore::
clear_local_value() { clear_local_value() {
if (_local_value != (ConfigDeclaration *)NULL) { if (_local_value != (ConfigDeclaration *)NULL) {
ConfigPage::get_local_page()->delete_declaration(_local_value); ConfigPage::get_local_page()->delete_declaration(_local_value);
_local_value = NULL; _local_value = (ConfigDeclaration *)NULL;
_value_seq++; _value_seq++;
return true; return true;
} }

View File

@ -35,7 +35,7 @@ get_num_variables() const {
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
INLINE ConfigVariableCore *ConfigVariableManager:: INLINE ConfigVariableCore *ConfigVariableManager::
get_variable(int n) const { 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]; return _variables[n];
} }

View File

@ -253,7 +253,7 @@ get_top_category() {
NotifyCategory *Notify:: NotifyCategory *Notify::
get_category(const string &basename, NotifyCategory *parent_category) { get_category(const string &basename, NotifyCategory *parent_category) {
// The string should not contain colons. // The string should not contain colons.
nassertr(basename.find(':') == string::npos, NULL); nassertr(basename.find(':') == string::npos, (NotifyCategory *)NULL);
string fullname; string fullname;
if (parent_category != (NotifyCategory *)NULL) { if (parent_category != (NotifyCategory *)NULL) {
@ -270,7 +270,7 @@ get_category(const string &basename, NotifyCategory *parent_category) {
} }
pair<Categories::iterator, bool> result = pair<Categories::iterator, bool> result =
_categories.insert(Categories::value_type(fullname, NULL)); _categories.insert(Categories::value_type(fullname, (NotifyCategory *)NULL));
bool inserted = result.second; bool inserted = result.second;
NotifyCategory *&category = (*result.first).second; NotifyCategory *&category = (*result.first).second;

View File

@ -66,7 +66,7 @@ void PrcKeyRegistry::
record_keys(const KeyDef *key_def, int num_keys) { record_keys(const KeyDef *key_def, int num_keys) {
for (int i = 0; i < num_keys; i++) { for (int i = 0; i < num_keys; i++) {
const KeyDef *def = &key_def[i]; const KeyDef *def = &key_def[i];
if (def->_data != NULL) { if (def->_data != (char *)NULL) {
// Clear the ith key. // Clear the ith key.
while ((int)_keys.size() <= i) { while ((int)_keys.size() <= i) {
Key key; Key key;
@ -136,7 +136,7 @@ get_num_keys() const {
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
EVP_PKEY *PrcKeyRegistry:: EVP_PKEY *PrcKeyRegistry::
get_key(int n) const { 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]._def != (KeyDef *)NULL) {
if (_keys[n]._pkey == (EVP_PKEY *)NULL) { if (_keys[n]._pkey == (EVP_PKEY *)NULL) {