]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/helpdata.cpp
reverted last changes by DW
[wxWidgets.git] / src / html / helpdata.cpp
index 9379ddd1d9231a873d050c16feeba6ba5049820e..6c187b1327a406ac619af4e2e5ee6e542e4768c8 100644 (file)
@@ -68,7 +68,7 @@ static wxString SafeFileName(const wxString& s)
 }
 
 
-static int IndexCompareFunc(const void *a, const void *b)
+static int LINKAGEMODE IndexCompareFunc(const void *a, const void *b)
 {
     return strcmp(((wxHtmlContentsItem*)a) -> m_Name, ((wxHtmlContentsItem*)b) -> m_Name);
 }
@@ -123,8 +123,8 @@ bool HP_TagHandler::HandleTag(const wxHtmlTag& tag)
         m_Name = m_Page = wxEmptyString;
         ParseInner(tag);
         if (m_Page != wxEmptyString) {
-            if (m_ItemsCnt % HTML_REALLOC_STEP == 0)
-                m_Items = (wxHtmlContentsItem*) realloc(m_Items, (m_ItemsCnt + HTML_REALLOC_STEP) * sizeof(wxHtmlContentsItem));
+            if (m_ItemsCnt % wxHTML_REALLOC_STEP == 0)
+                m_Items = (wxHtmlContentsItem*) realloc(m_Items, (m_ItemsCnt + wxHTML_REALLOC_STEP) * sizeof(wxHtmlContentsItem));
             m_Items[m_ItemsCnt].m_Level = m_Level;
             m_Items[m_ItemsCnt].m_ID = m_ID;
             m_Items[m_ItemsCnt].m_Page = new char[m_Page.Length() + 1];
@@ -209,7 +209,7 @@ bool wxHtmlHelpData::LoadMSProject(wxHtmlBookRecord *book, wxFileSystem& fsys, c
     HP_TagHandler *handler = new HP_TagHandler(book);
     parser.AddTagHandler(handler);
 
-    f = ( contentsfile.IsEmpty() ? NULL : fsys.OpenFile(contentsfile) );
+    f = ( contentsfile.IsEmpty() ? 0 : fsys.OpenFile(contentsfile) );
     if (f) {
         sz = f -> GetStream() -> GetSize();
         buf = new char[sz+1];
@@ -222,7 +222,7 @@ bool wxHtmlHelpData::LoadMSProject(wxHtmlBookRecord *book, wxFileSystem& fsys, c
         delete[] buf;
     }
 
-    f = ( indexfile.IsEmpty() ? NULL : fsys.OpenFile(indexfile) );
+    f = ( indexfile.IsEmpty() ? 0 : fsys.OpenFile(indexfile) );
     if (f) {
         sz = f -> GetStream() -> GetSize();
         buf = new  char[sz+1];
@@ -248,7 +248,7 @@ bool wxHtmlHelpData::LoadCachedBook(wxHtmlBookRecord *book, wxInputStream *f)
     f -> Read(&x, sizeof(x));
     st = m_ContentsCnt;
     m_ContentsCnt += x;
-    m_Contents = (wxHtmlContentsItem*) realloc(m_Contents, (m_ContentsCnt / HTML_REALLOC_STEP + 1) * HTML_REALLOC_STEP * sizeof(wxHtmlContentsItem));
+    m_Contents = (wxHtmlContentsItem*) realloc(m_Contents, (m_ContentsCnt / wxHTML_REALLOC_STEP + 1) * wxHTML_REALLOC_STEP * sizeof(wxHtmlContentsItem));
     for (i = st; i < m_ContentsCnt; i++) {
         f -> Read(&x, sizeof(x));
         m_Contents[i].m_Level = x;
@@ -268,7 +268,7 @@ bool wxHtmlHelpData::LoadCachedBook(wxHtmlBookRecord *book, wxInputStream *f)
     f -> Read(&x, sizeof(x));
     st = m_IndexCnt;
     m_IndexCnt += x;
-    m_Index = (wxHtmlContentsItem*) realloc(m_Index, (m_IndexCnt / HTML_REALLOC_STEP + 1) * HTML_REALLOC_STEP * sizeof(wxHtmlContentsItem));
+    m_Index = (wxHtmlContentsItem*) realloc(m_Index, (m_IndexCnt / wxHTML_REALLOC_STEP + 1) * wxHTML_REALLOC_STEP * sizeof(wxHtmlContentsItem));
     for (i = st; i < m_IndexCnt; i++) {
         f -> Read(&x, sizeof(x));
         m_Index[i].m_Name = new char[x];
@@ -352,8 +352,8 @@ bool wxHtmlHelpData::AddBookParam(const wxString& title, const wxString& contfil
 
     bookr = new wxHtmlBookRecord(path+'/', title, deftopic);
 
-    if (m_ContentsCnt % HTML_REALLOC_STEP == 0)
-        m_Contents = (wxHtmlContentsItem*) realloc(m_Contents, (m_ContentsCnt + HTML_REALLOC_STEP) * sizeof(wxHtmlContentsItem));
+    if (m_ContentsCnt % wxHTML_REALLOC_STEP == 0)
+        m_Contents = (wxHtmlContentsItem*) realloc(m_Contents, (m_ContentsCnt + wxHTML_REALLOC_STEP) * sizeof(wxHtmlContentsItem));
     m_Contents[m_ContentsCnt].m_Level = 0;
     m_Contents[m_ContentsCnt].m_ID = 0;
     m_Contents[m_ContentsCnt].m_Page = new char[deftopic.Length() + 1];
@@ -549,7 +549,11 @@ bool wxHtmlSearchStatus::Search()
 
     if (! m_Active) {
        // sanity check. Illegal use, but we'll try to prevent a crash anyway
-       wxASSERT(0);
+#if !defined(__VISAGECPP__)
+wxASSERT(0);
+#else
+wxASSERT(m_Active);
+#endif
        return FALSE;
     }