some const correctness for wxClassInfo

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9800 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2001-04-19 23:13:07 +00:00
parent aac65598a1
commit 6057972be4
2 changed files with 13 additions and 7 deletions

View File

@@ -166,7 +166,7 @@ void wxLibrary::PrepareClasses(wxClassInfo *first)
{ {
if (info->m_className) if (info->m_className)
classTable.Put(info->m_className, (wxObject *)info); classTable.Put(info->m_className, (wxObject *)info);
info = info->GetNext(); info = (wxClassInfo *)info->GetNext();
} }
// Set base pointers for each wxClassInfo // Set base pointers for each wxClassInfo

View File

@@ -193,7 +193,11 @@ void wxObject::operator delete[] (void * buf)
* Class info: provides run-time class type information. * Class info: provides run-time class type information.
*/ */
wxClassInfo::wxClassInfo(wxChar *cName, wxChar *baseName1, wxChar *baseName2, int sz, wxObjectConstructorFn constr) wxClassInfo::wxClassInfo(const wxChar *cName,
const wxChar *baseName1,
const wxChar *baseName2,
int sz,
wxObjectConstructorFn constr)
{ {
m_className = cName; m_className = cName;
m_baseClassName1 = baseName1; m_baseClassName1 = baseName1;
@@ -217,21 +221,23 @@ wxObject *wxClassInfo::CreateObject()
return (wxObject *) NULL; return (wxObject *) NULL;
} }
wxClassInfo *wxClassInfo::FindClass(wxChar *c) wxClassInfo *wxClassInfo::FindClass(const wxChar *c)
{ {
wxClassInfo *p = sm_first; wxClassInfo *p = sm_first;
while (p) while (p)
{ {
if (p && p->GetClassName() && wxStrcmp(p->GetClassName(), c) == 0) if ( wxStrcmp(p->GetClassName(), c) == 0 )
return p; break;
p = p->m_next; p = p->m_next;
} }
return (wxClassInfo *) NULL;
return p;
} }
// Climb upwards through inheritance hierarchy. // Climb upwards through inheritance hierarchy.
// Dual inheritance is catered for. // Dual inheritance is catered for.
bool wxClassInfo::IsKindOf(wxClassInfo *info) const bool wxClassInfo::IsKindOf(const wxClassInfo *info) const
{ {
if (info == NULL) if (info == NULL)
return FALSE; return FALSE;