fixed problem associated with deleting "const char *"

on the solaris compiler
This commit is contained in:
Jeff Hill
1998-10-23 19:23:46 +00:00
parent 18c24640c7
commit 409d2c2aaf
2 changed files with 28 additions and 14 deletions

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.18 1998/10/23 00:20:40 jhill
* attempted to clean up HP-UX warnings
*
* Revision 1.17 1998/06/16 03:00:19 jhill
* cleaned up fast string hash table
*
@@ -682,16 +685,20 @@ stringId::~stringId()
{
if (this->allocType==copyString) {
if (this->pStr!=NULL) {
#ifdef _MSC_VER
//
// bugs in microsloth visual C++ appear to require
// a const cast away here
// the microsoft and solaris compilers will
// not allow a pointer to "const char"
// to be deleted
//
// the HP-UX compiler gives us a warning on
// each cast away of const, but in this case
// it cant be avoided
//
// I hope that deleting a pointer to "char"
// is the same as deleting a pointer to
// "const char" on all compilers
//
delete [] (char * const) this->pStr;
#else
delete [] this->pStr;
#endif
}
}
}

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.18 1998/10/23 00:20:40 jhill
* attempted to clean up HP-UX warnings
*
* Revision 1.17 1998/06/16 03:00:19 jhill
* cleaned up fast string hash table
*
@@ -682,16 +685,20 @@ stringId::~stringId()
{
if (this->allocType==copyString) {
if (this->pStr!=NULL) {
#ifdef _MSC_VER
//
// bugs in microsloth visual C++ appear to require
// a const cast away here
// the microsoft and solaris compilers will
// not allow a pointer to "const char"
// to be deleted
//
// the HP-UX compiler gives us a warning on
// each cast away of const, but in this case
// it cant be avoided
//
// I hope that deleting a pointer to "char"
// is the same as deleting a pointer to
// "const char" on all compilers
//
delete [] (char * const) this->pStr;
#else
delete [] this->pStr;
#endif
}
}
}