Applied patch [ 817317 ] fixes for errors and warnings reported by MinGW for utils

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24743 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2003-12-11 09:01:25 +00:00
parent b1755cdb31
commit ddc4f3b528
12 changed files with 160 additions and 148 deletions

View File

@@ -23,6 +23,18 @@ linux-gnu.system.cache
*.swo *.swo
Release Release
Debug Debug
ReleaseUnicode
DebugUnicode
ReleaseUnicodeARM
DebugUnicodeARM
ReleaseUnicodeMIPS
DebugUnicodeMIPS
ReleaseUnicodeSH3
DebugUnicodeSH3
ReleaseUnicodeX86
DebugUnicodeX86
ReleaseUnicodeX86EM
DebugUnicodeX86EM
ReleaseDLL ReleaseDLL
DebugDLL DebugDLL
ReleaseUnicodeDLL ReleaseUnicodeDLL

View File

@@ -119,6 +119,7 @@ wxGTK:
- fixes to wxTextCtrl scrolling under GTK2 (Nerijus Baliunas) - fixes to wxTextCtrl scrolling under GTK2 (Nerijus Baliunas)
- fix for crash when using user-dashed lines (Chris Borgolte) - fix for crash when using user-dashed lines (Chris Borgolte)
- fixed wxChoice::Delete() in presence of client data - fixed wxChoice::Delete() in presence of client data
- allow calling wxWindow::SetFont if window not yet created
wxHTML: wxHTML:

View File

@@ -652,7 +652,7 @@ void SourcePainter::GetResultString(string& result, MarkupTagsT tags)
for( unsigned n = 0; n != len; ++n ) for( unsigned n = 0; n != len; ++n )
result += mResultStr[pos+n]; result += mResultStr[(unsigned int)(pos+n)];
pos += len; pos += len;

View File

@@ -248,7 +248,7 @@ void ctConfigItemsSelector::InitSourceConfigList(ctConfigItem* item)
ctConfigItem* child = (ctConfigItem*) node->GetData(); ctConfigItem* child = (ctConfigItem*) node->GetData();
InitSourceConfigList(child); InitSourceConfigList(child);
node = node->Next(); node = node->GetNext();
} }
} }

View File

@@ -1229,10 +1229,10 @@ void ctConfiguration::Detach()
/// the config items /// the config items
void ctConfiguration::DetachFromTree() void ctConfiguration::DetachFromTree()
{ {
/*
wxTreeItemId item = GetTreeItemId(); wxTreeItemId item = GetTreeItemId();
// TODO // TODO
/*
ctTreeItemData* data = (ctTreeItemData*) wxGetApp().GetMainFrame()->GetConfigTreeCtrl()->GetItemData(item); ctTreeItemData* data = (ctTreeItemData*) wxGetApp().GetMainFrame()->GetConfigTreeCtrl()->GetItemData(item);
data->SetConfigItem(NULL); data->SetConfigItem(NULL);
m_treeItemId = wxTreeItemId(); m_treeItemId = wxTreeItemId();

View File

@@ -153,9 +153,7 @@ bool hvApp::OnInit()
wxGetCwd(), wxGetCwd(),
wxEmptyString, wxEmptyString,
wxEmptyString, wxEmptyString,
wxT( wxT("Help books (*.htb)|*.htb|Help books (*.zip)|*.zip|HTML Help Project (*.hhp)|*.hhp"),
"Help books (*.htb)|*.htb|Help books (*.zip)|*.zip|\
HTML Help Project (*.hhp)|*.hhp"),
wxOPEN | wxFILE_MUST_EXIST, wxOPEN | wxFILE_MUST_EXIST,
NULL); NULL);
@@ -226,11 +224,11 @@ bool hvApp::OnInit()
int hvApp::OnExit() int hvApp::OnExit()
{ {
#if hvUSE_IPC #if hvUSE_IPC
wxNode* node = m_connections.First(); wxNode* node = m_connections.GetFirst();
while (node) while (node)
{ {
wxNode* next = node->Next(); wxNode* next = node->GetNext();
hvConnection* connection = (hvConnection*) node->Data(); hvConnection* connection = (hvConnection*) node->GetData();
connection->Disconnect(); connection->Disconnect();
delete connection; delete connection;
node = next; node = next;

View File

@@ -327,12 +327,12 @@ void Text2HTML(TexChunk *chunk)
if (def && (def->macroId == ltVERBATIM || def->macroId == ltVERB || def->macroId == ltSPECIAL)) if (def && (def->macroId == ltVERBATIM || def->macroId == ltVERB || def->macroId == ltSPECIAL))
inVerbatim = TRUE; inVerbatim = TRUE;
wxNode *node = chunk->children.First(); wxNode *node = chunk->children.GetFirst();
while (node) while (node)
{ {
TexChunk *child_chunk = (TexChunk *)node->Data(); TexChunk *child_chunk = (TexChunk *)node->GetData();
Text2HTML(child_chunk); Text2HTML(child_chunk);
node = node->Next(); node = node->GetNext();
} }
if (def && (def->macroId == ltVERBATIM || def->macroId == ltVERB || def->macroId == ltSPECIAL)) if (def && (def->macroId == ltVERBATIM || def->macroId == ltVERB || def->macroId == ltSPECIAL))
@@ -342,12 +342,12 @@ void Text2HTML(TexChunk *chunk)
} }
case CHUNK_TYPE_ARG: case CHUNK_TYPE_ARG:
{ {
wxNode *node = chunk->children.First(); wxNode *node = chunk->children.GetFirst();
while (node) while (node)
{ {
TexChunk *child_chunk = (TexChunk *)node->Data(); TexChunk *child_chunk = (TexChunk *)node->GetData();
Text2HTML(child_chunk); Text2HTML(child_chunk);
node = node->Next(); node = node->GetNext();
} }
break; break;
@@ -1215,9 +1215,9 @@ void HTMLOnMacro(int macroId, int no_args, bool start)
else else
{ {
indentLevel --; indentLevel --;
if (itemizeStack.First()) if (itemizeStack.GetFirst())
{ {
ItemizeStruc *struc = (ItemizeStruc *)itemizeStack.First()->Data(); ItemizeStruc *struc = (ItemizeStruc *)itemizeStack.GetFirst()->GetData();
switch (struc->listType) switch (struc->listType)
{ {
case LATEX_ITEMIZE: case LATEX_ITEMIZE:
@@ -1233,7 +1233,7 @@ void HTMLOnMacro(int macroId, int no_args, bool start)
} }
delete struc; delete struc;
delete itemizeStack.First(); delete itemizeStack.GetFirst();
} }
} }
break; break;
@@ -1484,10 +1484,10 @@ void HTMLOnMacro(int macroId, int no_args, bool start)
{ {
if (!start) if (!start)
{ {
wxNode *node = itemizeStack.First(); wxNode *node = itemizeStack.GetFirst();
if (node) if (node)
{ {
ItemizeStruc *struc = (ItemizeStruc *)node->Data(); ItemizeStruc *struc = (ItemizeStruc *)node->GetData();
struc->currentItem += 1; struc->currentItem += 1;
if (struc->listType == LATEX_DESCRIPTION) if (struc->listType == LATEX_DESCRIPTION)
{ {
@@ -3108,16 +3108,16 @@ void GenerateHTMLIndexFile(char *fname)
wxNode *node = NULL; wxNode *node = NULL;
while ((node = TopicTable.Next())) while ((node = TopicTable.Next()))
{ {
TexTopic *texTopic = (TexTopic *)node->Data(); TexTopic *texTopic = (TexTopic *)node->GetData();
const char *topicName = node->GetKeyString(); const char *topicName = node->GetKeyString();
if (texTopic->filename && texTopic->keywords) if (texTopic->filename && texTopic->keywords)
{ {
wxNode *node1 = texTopic->keywords->First(); wxStringListNode *node1 = texTopic->keywords->GetFirst();
while (node1) while (node1)
{ {
char *s = (char *)node1->Data(); char *s = (char *)node1->GetData();
fprintf(fd, "%s|%s|%s\n", topicName, texTopic->filename, s); fprintf(fd, "%s|%s|%s\n", topicName, texTopic->filename, s);
node1 = node1->Next(); node1 = node1->GetNext();
} }
} }
} }
@@ -3207,21 +3207,21 @@ void GenerateHTMLWorkshopFiles(char *fname)
wxNode *node = NULL; wxNode *node = NULL;
while ((node = TopicTable.Next())) while ((node = TopicTable.Next()))
{ {
TexTopic *texTopic = (TexTopic *)node->Data(); TexTopic *texTopic = (TexTopic *)node->GetData();
const char *topicName = node->GetKeyString(); const char *topicName = node->GetKeyString();
if (texTopic->filename && texTopic->keywords) if (texTopic->filename && texTopic->keywords)
{ {
wxNode *node1 = texTopic->keywords->First(); wxStringListNode *node1 = texTopic->keywords->GetFirst();
while (node1) while (node1)
{ {
char *s = (char *)node1->Data(); char *s = (char *)node1->GetData();
fprintf(f, fprintf(f,
" <LI> <OBJECT type=\"text/sitemap\">\n" " <LI> <OBJECT type=\"text/sitemap\">\n"
" <param name=\"Local\" value=\"%s#%s\">\n" " <param name=\"Local\" value=\"%s#%s\">\n"
" <param name=\"Name\" value=\"%s\">\n" " <param name=\"Name\" value=\"%s\">\n"
" </OBJECT>\n", " </OBJECT>\n",
texTopic->filename, topicName, s); texTopic->filename, topicName, s);
node1 = node1->Next(); node1 = node1->GetNext();
} }
} }
} }

View File

@@ -347,10 +347,10 @@ void GenerateKeywordsForTopic(char *topic)
wxStringList *list = texTopic->keywords; wxStringList *list = texTopic->keywords;
if (list) if (list)
{ {
wxNode *node = list->First(); wxStringListNode *node = list->GetFirst();
while (node) while (node)
{ {
char *s = (char *)node->Data(); char *s = (char *)node->GetData();
// Must separate out main entry form subentry (only 1 subentry allowed) // Must separate out main entry form subentry (only 1 subentry allowed)
char buf1[100]; char buf2[100]; char buf1[100]; char buf2[100];
@@ -376,7 +376,7 @@ void GenerateKeywordsForTopic(char *topic)
TexOutput(buf2); TexOutput(buf2);
} }
TexOutput("}\n"); TexOutput("}\n");
node = node->Next(); node = node->GetNext();
} }
} }
} }
@@ -412,12 +412,12 @@ void GenerateIndexEntry(char *entry)
void WriteColourTable(FILE *fd) void WriteColourTable(FILE *fd)
{ {
fprintf(fd, "{\\colortbl"); fprintf(fd, "{\\colortbl");
wxNode *node = ColourTable.First(); wxNode *node = ColourTable.GetFirst();
while (node) while (node)
{ {
ColourTableEntry *entry = (ColourTableEntry *)node->Data(); ColourTableEntry *entry = (ColourTableEntry *)node->GetData();
fprintf(fd, "\\red%d\\green%d\\blue%d;\n", entry->red, entry->green, entry->blue); fprintf(fd, "\\red%d\\green%d\\blue%d;\n", entry->red, entry->green, entry->blue);
node = node->Next(); node = node->GetNext();
} }
fprintf(fd, "}"); fprintf(fd, "}");
} }
@@ -717,12 +717,12 @@ void Text2RTF(TexChunk *chunk)
if (def && (def->macroId == ltVERBATIM || def->macroId == ltVERB)) if (def && (def->macroId == ltVERBATIM || def->macroId == ltVERB))
inVerbatim = TRUE; inVerbatim = TRUE;
wxNode *node = chunk->children.First(); wxNode *node = chunk->children.GetFirst();
while (node) while (node)
{ {
TexChunk *child_chunk = (TexChunk *)node->Data(); TexChunk *child_chunk = (TexChunk *)node->GetData();
Text2RTF(child_chunk); Text2RTF(child_chunk);
node = node->Next(); node = node->GetNext();
} }
if (def && (def->macroId == ltVERBATIM || def->macroId == ltVERB)) if (def && (def->macroId == ltVERBATIM || def->macroId == ltVERB))
@@ -732,12 +732,12 @@ void Text2RTF(TexChunk *chunk)
} }
case CHUNK_TYPE_ARG: case CHUNK_TYPE_ARG:
{ {
wxNode *node = chunk->children.First(); wxNode *node = chunk->children.GetFirst();
while (node) while (node)
{ {
TexChunk *child_chunk = (TexChunk *)node->Data(); TexChunk *child_chunk = (TexChunk *)node->GetData();
Text2RTF(child_chunk); Text2RTF(child_chunk);
node = node->Next(); node = node->GetNext();
} }
break; break;
@@ -784,10 +784,10 @@ void PushEnvironmentStyle(char *style)
void PopEnvironmentStyle(void) void PopEnvironmentStyle(void)
{ {
wxNode *node = environmentStack.Last(); wxStringListNode *node = environmentStack.GetLast();
if (node) if (node)
{ {
char *val = (char *)node->Data(); char *val = (char *)node->GetData();
delete[] val; delete[] val;
delete node; delete node;
} }
@@ -796,12 +796,12 @@ void PopEnvironmentStyle(void)
// Write out the styles, most recent first. // Write out the styles, most recent first.
void WriteEnvironmentStyles(void) void WriteEnvironmentStyles(void)
{ {
wxNode *node = environmentStack.Last(); wxStringListNode *node = environmentStack.GetLast();
while (node) while (node)
{ {
char *val = (char *)node->Data(); char *val = (char *)node->GetData();
TexOutput(val); TexOutput(val);
node = node->Next(); node = node->GetNext();
} }
if (!inTabular && (ParIndent > 0) && (forbidParindent == 0)) if (!inTabular && (ParIndent > 0) && (forbidParindent == 0))
{ {
@@ -809,7 +809,7 @@ void WriteEnvironmentStyles(void)
sprintf(buf, "\\fi%d", ParIndent*20); // Convert points to TWIPS sprintf(buf, "\\fi%d", ParIndent*20); // Convert points to TWIPS
TexOutput(buf); TexOutput(buf);
} }
if (environmentStack.Number() > 0 || (ParIndent > 0)) if (environmentStack.GetCount() > 0 || (ParIndent > 0))
TexOutput("\n"); TexOutput("\n");
} }
@@ -2028,9 +2028,9 @@ void RTFOnMacro(int macroId, int no_args, bool start)
listType = LATEX_DESCRIPTION; listType = LATEX_DESCRIPTION;
int oldIndent = 0; int oldIndent = 0;
wxNode *node = itemizeStack.First(); wxNode *node = itemizeStack.GetFirst();
if (node) if (node)
oldIndent = ((ItemizeStruc *)node->Data())->indentation; oldIndent = ((ItemizeStruc *)node->GetData())->indentation;
int indentSize1 = oldIndent + 20*labelIndentTab; int indentSize1 = oldIndent + 20*labelIndentTab;
int indentSize2 = oldIndent + 20*itemIndentTab; int indentSize2 = oldIndent + 20*itemIndentTab;
@@ -2047,11 +2047,11 @@ void RTFOnMacro(int macroId, int no_args, bool start)
indentLevel --; indentLevel --;
PopEnvironmentStyle(); PopEnvironmentStyle();
if (itemizeStack.First()) if (itemizeStack.GetFirst())
{ {
ItemizeStruc *struc = (ItemizeStruc *)itemizeStack.First()->Data(); ItemizeStruc *struc = (ItemizeStruc *)itemizeStack.GetFirst()->GetData();
delete struc; delete struc;
delete itemizeStack.First(); delete itemizeStack.GetFirst();
} }
/* Change 18/7/97 - don't know why we wish to do this /* Change 18/7/97 - don't know why we wish to do this
if (itemizeStack.Number() == 0) if (itemizeStack.Number() == 0)
@@ -2070,9 +2070,9 @@ void RTFOnMacro(int macroId, int no_args, bool start)
{ {
indentLevel ++; indentLevel ++;
int oldIndent = 0; int oldIndent = 0;
wxNode *node = itemizeStack.First(); wxNode *node = itemizeStack.GetFirst();
if (node) if (node)
oldIndent = ((ItemizeStruc *)node->Data())->indentation; oldIndent = ((ItemizeStruc *)node->GetData())->indentation;
int indentSize = oldIndent + TwoColWidthA; int indentSize = oldIndent + TwoColWidthA;
@@ -2087,11 +2087,11 @@ void RTFOnMacro(int macroId, int no_args, bool start)
{ {
indentLevel --; indentLevel --;
PopEnvironmentStyle(); PopEnvironmentStyle();
if (itemizeStack.First()) if (itemizeStack.GetFirst())
{ {
ItemizeStruc *struc = (ItemizeStruc *)itemizeStack.First()->Data(); ItemizeStruc *struc = (ItemizeStruc *)itemizeStack.GetFirst()->GetData();
delete struc; delete struc;
delete itemizeStack.First(); delete itemizeStack.GetFirst();
} }
/* /*
// JACS June 1997 // JACS June 1997
@@ -2099,7 +2099,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
WriteEnvironmentStyles(); WriteEnvironmentStyles();
*/ */
/* why do we need this? */ /* why do we need this? */
if (itemizeStack.Number() == 0) if (itemizeStack.GetCount() == 0)
{ {
issuedNewParagraph = 0; issuedNewParagraph = 0;
OnMacro(ltPAR, 0, TRUE); OnMacro(ltPAR, 0, TRUE);
@@ -2110,10 +2110,10 @@ void RTFOnMacro(int macroId, int no_args, bool start)
} }
case ltITEM: case ltITEM:
{ {
wxNode *node = itemizeStack.First(); wxNode *node = itemizeStack.GetFirst();
if (node) if (node)
{ {
ItemizeStruc *struc = (ItemizeStruc *)node->Data(); ItemizeStruc *struc = (ItemizeStruc *)node->GetData();
if (!start) if (!start)
{ {
struc->currentItem += 1; struc->currentItem += 1;
@@ -2200,20 +2200,20 @@ void RTFOnMacro(int macroId, int no_args, bool start)
case ltTWOCOLITEM: case ltTWOCOLITEM:
case ltTWOCOLITEMRULED: case ltTWOCOLITEMRULED:
{ {
wxNode *node = itemizeStack.First(); wxNode *node = itemizeStack.GetFirst();
if (node) if (node)
{ {
ItemizeStruc *struc = (ItemizeStruc *)node->Data(); ItemizeStruc *struc = (ItemizeStruc *)node->GetData();
if (start) if (start)
{ {
struc->currentItem += 1; struc->currentItem += 1;
int oldIndent = 0; int oldIndent = 0;
wxNode *node2 = NULL; wxNode *node2 = NULL;
if (itemizeStack.Number() > 1) // TODO: do I actually mean Nth(0) here?? if (itemizeStack.GetCount() > 1) // TODO: do I actually mean Nth(0) here??
node2 = itemizeStack.Nth(1); node2 = itemizeStack.Item(1);
if (node2) if (node2)
oldIndent = ((ItemizeStruc *)node2->Data())->indentation; oldIndent = ((ItemizeStruc *)node2->GetData())->indentation;
TexOutput("\n"); TexOutput("\n");
if (struc->currentItem > 1) if (struc->currentItem > 1)
@@ -4687,9 +4687,9 @@ bool RTFOnArgument(int macroId, int arg_no, bool start)
// indentLevel ++; // indentLevel ++;
// TexOutput("\\fi0\n"); // TexOutput("\\fi0\n");
int oldIndent = 0; int oldIndent = 0;
wxNode *node = itemizeStack.First(); wxNode *node = itemizeStack.GetFirst();
if (node) if (node)
oldIndent = ((ItemizeStruc *)node->Data())->indentation; oldIndent = ((ItemizeStruc *)node->GetData())->indentation;
int indentValue = 20*ParseUnitArgument(GetArgData()); int indentValue = 20*ParseUnitArgument(GetArgData());
int indentSize = indentValue + oldIndent; int indentSize = indentValue + oldIndent;
@@ -4705,13 +4705,13 @@ bool RTFOnArgument(int macroId, int arg_no, bool start)
if (!start && (arg_no == 2)) if (!start && (arg_no == 2))
{ {
PopEnvironmentStyle(); PopEnvironmentStyle();
if (itemizeStack.First()) if (itemizeStack.GetFirst())
{ {
ItemizeStruc *struc = (ItemizeStruc *)itemizeStack.First()->Data(); ItemizeStruc *struc = (ItemizeStruc *)itemizeStack.GetFirst()->GetData();
delete struc; delete struc;
delete itemizeStack.First(); delete itemizeStack.GetFirst();
} }
if (itemizeStack.Number() == 0) if (itemizeStack.GetCount() == 0)
{ {
TexOutput("\\par\\pard\n"); TexOutput("\\par\\pard\n");
issuedNewParagraph = 1; issuedNewParagraph = 1;
@@ -4728,9 +4728,9 @@ bool RTFOnArgument(int macroId, int arg_no, bool start)
if (start && (arg_no == 1)) if (start && (arg_no == 1))
{ {
int oldIndent = 0; int oldIndent = 0;
wxNode *node = itemizeStack.First(); wxNode *node = itemizeStack.GetFirst();
if (node) if (node)
oldIndent = ((ItemizeStruc *)node->Data())->indentation; oldIndent = ((ItemizeStruc *)node->GetData())->indentation;
int boxWidth = 20*ParseUnitArgument(GetArgData()); int boxWidth = 20*ParseUnitArgument(GetArgData());
@@ -4750,11 +4750,11 @@ bool RTFOnArgument(int macroId, int arg_no, bool start)
if (!start && (arg_no == 2)) if (!start && (arg_no == 2))
{ {
PopEnvironmentStyle(); PopEnvironmentStyle();
if (itemizeStack.First()) if (itemizeStack.GetFirst())
{ {
ItemizeStruc *struc = (ItemizeStruc *)itemizeStack.First()->Data(); ItemizeStruc *struc = (ItemizeStruc *)itemizeStack.GetFirst()->GetData();
delete struc; delete struc;
delete itemizeStack.First(); delete itemizeStack.GetFirst();
} }
if (itemizeStack.Number() == 0) if (itemizeStack.Number() == 0)
{ {

View File

@@ -1477,10 +1477,10 @@ int ParseArg(TexChunk *thisArg, wxList& children, char *buffer, int pos, char *e
{ {
int n = buffer[pos] - 48; int n = buffer[pos] - 48;
pos ++; pos ++;
wxNode *node = customMacroArgs->children.Nth(n-1); wxNode *node = customMacroArgs->children.Item(n-1);
if (node) if (node)
{ {
TexChunk *argChunk = (TexChunk *)node->Data(); TexChunk *argChunk = (TexChunk *)node->GetData();
children.Append((wxObject *)new TexChunk(*argChunk)); children.Append((wxObject *)new TexChunk(*argChunk));
} }
} }
@@ -1654,12 +1654,12 @@ int ParseMacroBody(const char *macro_name, TexChunk *parent,
parent->no_args = maxArgs; parent->no_args = maxArgs;
// Tell each argument how many args there are (useful when processing an arg) // Tell each argument how many args there are (useful when processing an arg)
wxNode *node = parent->children.First(); wxNode *node = parent->children.GetFirst();
while (node) while (node)
{ {
TexChunk *chunk = (TexChunk *)node->Data(); TexChunk *chunk = (TexChunk *)node->GetData();
chunk->no_args = maxArgs; chunk->no_args = maxArgs;
node = node->Next(); node = node->GetNext();
} }
return pos; return pos;
} }
@@ -1739,12 +1739,12 @@ TexChunk::TexChunk(TexChunk& toCopy)
value = NULL; value = NULL;
optional = toCopy.optional; optional = toCopy.optional;
wxNode *node = toCopy.children.First(); wxNode *node = toCopy.children.GetFirst();
while (node) while (node)
{ {
TexChunk *child = (TexChunk *)node->Data(); TexChunk *child = (TexChunk *)node->GetData();
children.Append((wxObject *)new TexChunk(*child)); children.Append((wxObject *)new TexChunk(*child));
node = node->Next(); node = node->GetNext();
} }
} }
@@ -1752,12 +1752,12 @@ TexChunk::~TexChunk(void)
{ {
// if (name) delete[] name; // if (name) delete[] name;
if (value) delete[] value; if (value) delete[] value;
wxNode *node = children.First(); wxNode *node = children.GetFirst();
while (node) while (node)
{ {
TexChunk *child = (TexChunk *)node->Data(); TexChunk *child = (TexChunk *)node->GetData();
delete child; delete child;
wxNode *next = node->Next(); wxNode *next = node->GetNext();
delete node; delete node;
node = next; node = next;
} }
@@ -1794,25 +1794,25 @@ void GetArgData1(TexChunk *chunk)
strcat(currentArgData, def->name); strcat(currentArgData, def->name);
} }
wxNode *node = chunk->children.First(); wxNode *node = chunk->children.GetFirst();
while (node) while (node)
{ {
TexChunk *child_chunk = (TexChunk *)node->Data(); TexChunk *child_chunk = (TexChunk *)node->GetData();
strcat(currentArgData, "{"); strcat(currentArgData, "{");
GetArgData1(child_chunk); GetArgData1(child_chunk);
strcat(currentArgData, "}"); strcat(currentArgData, "}");
node = node->Next(); node = node->GetNext();
} }
break; break;
} }
case CHUNK_TYPE_ARG: case CHUNK_TYPE_ARG:
{ {
wxNode *node = chunk->children.First(); wxNode *node = chunk->children.GetFirst();
while (node) while (node)
{ {
TexChunk *child_chunk = (TexChunk *)node->Data(); TexChunk *child_chunk = (TexChunk *)node->GetData();
GetArgData1(child_chunk); GetArgData1(child_chunk);
node = node->Next(); node = node->GetNext();
} }
break; break;
} }
@@ -1885,17 +1885,17 @@ void TraverseFromChunk(TexChunk *chunk, wxNode *thisNode, bool childrenOnly)
if (!childrenOnly) if (!childrenOnly)
OnMacro(chunk->macroId, chunk->no_args, TRUE); OnMacro(chunk->macroId, chunk->no_args, TRUE);
wxNode *node = chunk->children.First(); wxNode *node = chunk->children.GetFirst();
TexChunk *child_chunk = NULL; TexChunk *child_chunk = NULL;
while (node) while (node)
{ {
child_chunk = (TexChunk *)node->Data(); child_chunk = (TexChunk *)node->GetData();
TraverseFromChunk(child_chunk, node); TraverseFromChunk(child_chunk, node);
node = node->Next(); node = node->GetNext();
} }
if (thisNode && thisNode->Next()) if (thisNode && thisNode->GetNext())
nextChunk = (TexChunk *)thisNode->Next()->Data(); nextChunk = (TexChunk *)thisNode->GetNext()->GetData();
if (!childrenOnly) if (!childrenOnly)
OnMacro(chunk->macroId, chunk->no_args, FALSE); OnMacro(chunk->macroId, chunk->no_args, FALSE);
@@ -1912,19 +1912,19 @@ void TraverseFromChunk(TexChunk *chunk, wxNode *thisNode, bool childrenOnly)
if (childrenOnly || OnArgument(chunk->macroId, chunk->argn, TRUE)) if (childrenOnly || OnArgument(chunk->macroId, chunk->argn, TRUE))
{ {
wxNode *node = chunk->children.First(); wxNode *node = chunk->children.GetFirst();
while (node) while (node)
{ {
TexChunk *child_chunk = (TexChunk *)node->Data(); TexChunk *child_chunk = (TexChunk *)node->GetData();
TraverseFromChunk(child_chunk, node); TraverseFromChunk(child_chunk, node);
node = node->Next(); node = node->GetNext();
} }
} }
currentArgument = chunk; currentArgument = chunk;
if (thisNode && thisNode->Next()) if (thisNode && thisNode->GetNext())
nextChunk = (TexChunk *)thisNode->Next()->Data(); nextChunk = (TexChunk *)thisNode->GetNext()->GetData();
isArgOptional = chunk->optional; isArgOptional = chunk->optional;
noArgs = chunk->no_args; noArgs = chunk->no_args;
@@ -2049,13 +2049,13 @@ void TexCleanUp(void)
{ {
/* Don't want to remove custom macros after each pass.*/ /* Don't want to remove custom macros after each pass.*/
SetFontSizes(10); SetFontSizes(10);
wxNode *node = CustomMacroList.First(); wxNode *node = CustomMacroList.GetFirst();
while (node) while (node)
{ {
CustomMacro *macro = (CustomMacro *)node->Data(); CustomMacro *macro = (CustomMacro *)node->GetData();
delete macro; delete macro;
delete node; delete node;
node = CustomMacroList.First(); node = CustomMacroList.GetFirst();
} }
} }
/**/ /**/
@@ -2063,19 +2063,19 @@ void TexCleanUp(void)
wxNode *node = TexReferences.Next(); wxNode *node = TexReferences.Next();
while (node) while (node)
{ {
TexRef *ref = (TexRef *)node->Data(); TexRef *ref = (TexRef *)node->GetData();
delete ref; delete ref;
node = TexReferences.Next(); node = TexReferences.Next();
} }
TexReferences.Clear(); TexReferences.Clear();
node = BibList.First(); node = BibList.GetFirst();
while (node) while (node)
{ {
BibEntry *entry = (BibEntry *)node->Data(); BibEntry *entry = (BibEntry *)node->GetData();
delete entry; delete entry;
delete node; delete node;
node = BibList.First(); node = BibList.GetFirst();
} }
CitationList.Clear(); CitationList.Clear();
ResetTopicCounter(); ResetTopicCounter();

View File

@@ -457,19 +457,19 @@ bool MyApp::OnInit()
#ifndef NO_GUI #ifndef NO_GUI
int MyApp::OnExit() int MyApp::OnExit()
{ {
wxNode *node = CustomMacroList.First(); wxNode *node = CustomMacroList.GetFirst();
while (node) while (node)
{ {
CustomMacro *macro = (CustomMacro *)node->Data(); CustomMacro *macro = (CustomMacro *)node->GetData();
delete macro; delete macro;
delete node; delete node;
node = CustomMacroList.First(); node = CustomMacroList.GetFirst();
} }
MacroDefs.BeginFind(); MacroDefs.BeginFind();
node = MacroDefs.Next(); node = MacroDefs.Next();
while (node) while (node)
{ {
TexMacroDef* def = (TexMacroDef*) node->Data(); TexMacroDef* def = (TexMacroDef*) node->GetData();
delete def; delete def;
node = MacroDefs.Next(); node = MacroDefs.Next();
} }

View File

@@ -24,6 +24,7 @@
#include "wx/log.h" #include "wx/log.h"
#endif #endif
#include "wx/app.h"
#include "wx/hash.h" #include "wx/hash.h"
#ifdef new #ifdef new
@@ -182,16 +183,16 @@ char *FindTopicName(TexChunk *chunk)
if (chunk && (chunk->type == CHUNK_TYPE_MACRO) && if (chunk && (chunk->type == CHUNK_TYPE_MACRO) &&
(chunk->macroId == ltLABEL)) (chunk->macroId == ltLABEL))
{ {
wxNode *node = chunk->children.First(); wxNode *node = chunk->children.GetFirst();
if (node) if (node)
{ {
TexChunk *child = (TexChunk *)node->Data(); TexChunk *child = (TexChunk *)node->GetData();
if (child->type == CHUNK_TYPE_ARG) if (child->type == CHUNK_TYPE_ARG)
{ {
wxNode *snode = child->children.First(); wxNode *snode = child->children.GetFirst();
if (snode) if (snode)
{ {
TexChunk *schunk = (TexChunk *)snode->Data(); TexChunk *schunk = (TexChunk *)snode->GetData();
if (schunk->type == CHUNK_TYPE_STRING) if (schunk->type == CHUNK_TYPE_STRING)
topicName = schunk->value; topicName = schunk->value;
} }
@@ -402,7 +403,7 @@ void WriteTexReferences(char *filename)
while (node) while (node)
{ {
Tex2RTFYield(); Tex2RTFYield();
TexRef *ref = (TexRef *)node->Data(); TexRef *ref = (TexRef *)node->GetData();
ostr << ref->refLabel << " " << (ref->refFile ? ref->refFile : "??") << " "; ostr << ref->refLabel << " " << (ref->refFile ? ref->refFile : "??") << " ";
ostr << (ref->sectionName ? ref->sectionName : "??") << " "; ostr << (ref->sectionName ? ref->sectionName : "??") << " ";
ostr << (ref->sectionNumber ? ref->sectionNumber : "??") << "\n"; ostr << (ref->sectionNumber ? ref->sectionNumber : "??") << "\n";
@@ -988,19 +989,19 @@ void OutputBib(void)
OnMacro(ltPAR, 0, FALSE); OnMacro(ltPAR, 0, FALSE);
} }
wxNode *node = CitationList.First(); wxStringListNode *node = CitationList.GetFirst();
while (node) while (node)
{ {
char *citeKey = (char *)node->Data(); char *citeKey = (char *)node->GetData();
// wxNode *texNode = TexReferences.Find(citeKey); // wxNode *texNode = TexReferences.Find(citeKey);
TexRef *ref = (TexRef *)TexReferences.Get(citeKey); TexRef *ref = (TexRef *)TexReferences.Get(citeKey);
wxNode *bibNode = BibList.Find(citeKey); wxNode *bibNode = BibList.Find(citeKey);
if (bibNode && ref) if (bibNode && ref)
{ {
BibEntry *entry = (BibEntry *)bibNode->Data(); BibEntry *entry = (BibEntry *)bibNode->GetData();
OutputBibItem(ref, entry); OutputBibItem(ref, entry);
} }
node = node->Next(); node = node->GetNext();
} }
} }
@@ -1008,23 +1009,23 @@ static int citeCount = 1;
void ResolveBibReferences(void) void ResolveBibReferences(void)
{ {
if (CitationList.Number() > 0) if (CitationList.GetCount() > 0)
OnInform("Resolving bibliographic references..."); OnInform("Resolving bibliographic references...");
citeCount = 1; citeCount = 1;
char buf[200]; char buf[200];
wxNode *node = CitationList.First(); wxStringListNode *node = CitationList.GetFirst();
while (node) while (node)
{ {
Tex2RTFYield(); Tex2RTFYield();
char *citeKey = (char *)node->Data(); char *citeKey = (char *)node->GetData();
// wxNode *texNode = TexReferences.Find(citeKey); // wxNode *texNode = TexReferences.Find(citeKey);
TexRef *ref = (TexRef *)TexReferences.Get(citeKey); TexRef *ref = (TexRef *)TexReferences.Get(citeKey);
wxNode *bibNode = BibList.Find(citeKey); wxNode *bibNode = BibList.Find(citeKey);
if (bibNode && ref) if (bibNode && ref)
{ {
// Unused Variable // Unused Variable
//BibEntry *entry = (BibEntry *)bibNode->Data(); //BibEntry *entry = (BibEntry *)bibNode->GetData();
if (ref->sectionNumber) delete[] ref->sectionNumber; if (ref->sectionNumber) delete[] ref->sectionNumber;
sprintf(buf, "[%d]", citeCount); sprintf(buf, "[%d]", citeCount);
ref->sectionNumber = copystring(buf); ref->sectionNumber = copystring(buf);
@@ -1035,7 +1036,7 @@ void ResolveBibReferences(void)
sprintf(buf, "Warning: bib ref %s not resolved.", citeKey); sprintf(buf, "Warning: bib ref %s not resolved.", citeKey);
OnInform(buf); OnInform(buf);
} }
node = node->Next(); node = node->GetNext();
} }
} }
@@ -1412,7 +1413,7 @@ CustomMacro *FindCustomMacro(char *name)
wxNode *node = CustomMacroList.Find(name); wxNode *node = CustomMacroList.Find(name);
if (node) if (node)
{ {
CustomMacro *macro = (CustomMacro *)node->Data(); CustomMacro *macro = (CustomMacro *)node->GetData();
return macro; return macro;
} }
return NULL; return NULL;
@@ -1421,7 +1422,7 @@ CustomMacro *FindCustomMacro(char *name)
// Display custom macros // Display custom macros
void ShowCustomMacros(void) void ShowCustomMacros(void)
{ {
wxNode *node = CustomMacroList.First(); wxNode *node = CustomMacroList.GetFirst();
if (!node) if (!node)
{ {
OnInform("No custom macros loaded.\n"); OnInform("No custom macros loaded.\n");
@@ -1431,11 +1432,11 @@ void ShowCustomMacros(void)
char buf[400]; char buf[400];
while (node) while (node)
{ {
CustomMacro *macro = (CustomMacro *)node->Data(); CustomMacro *macro = (CustomMacro *)node->GetData();
sprintf(buf, "\\%s[%d]\n {%s}", macro->macroName, macro->noArgs, sprintf(buf, "\\%s[%d]\n {%s}", macro->macroName, macro->noArgs,
macro->macroBody ? macro->macroBody : ""); macro->macroBody ? macro->macroBody : "");
OnInform(buf); OnInform(buf);
node = node->Next(); node = node->GetNext();
} }
} }
@@ -1505,7 +1506,7 @@ void AddColour(const char *theName, unsigned int r, unsigned int g, unsigned i
wxNode *node = ColourTable.Find(theName); wxNode *node = ColourTable.Find(theName);
if (node) if (node)
{ {
ColourTableEntry *entry = (ColourTableEntry *)node->Data(); ColourTableEntry *entry = (ColourTableEntry *)node->GetData();
if (entry->red == r || entry->green == g || entry->blue == b) if (entry->red == r || entry->green == g || entry->blue == b)
return; return;
else else
@@ -1521,14 +1522,14 @@ void AddColour(const char *theName, unsigned int r, unsigned int g, unsigned i
int FindColourPosition(char *theName) int FindColourPosition(char *theName)
{ {
int i = 0; int i = 0;
wxNode *node = ColourTable.First(); wxNode *node = ColourTable.GetFirst();
while (node) while (node)
{ {
ColourTableEntry *entry = (ColourTableEntry *)node->Data(); ColourTableEntry *entry = (ColourTableEntry *)node->GetData();
if (strcmp(theName, entry->name) == 0) if (strcmp(theName, entry->name) == 0)
return i; return i;
i ++; i ++;
node = node->Next(); node = node->GetNext();
} }
return -1; return -1;
} }
@@ -1538,10 +1539,10 @@ extern void DecToHex(int, char *);
bool FindColourHTMLString(char *theName, char *buf) bool FindColourHTMLString(char *theName, char *buf)
{ {
int i = 0; int i = 0;
wxNode *node = ColourTable.First(); wxNode *node = ColourTable.GetFirst();
while (node) while (node)
{ {
ColourTableEntry *entry = (ColourTableEntry *)node->Data(); ColourTableEntry *entry = (ColourTableEntry *)node->GetData();
if (strcmp(theName, entry->name) == 0) if (strcmp(theName, entry->name) == 0)
{ {
strcpy(buf, "#"); strcpy(buf, "#");
@@ -1557,7 +1558,7 @@ bool FindColourHTMLString(char *theName, char *buf)
return TRUE; return TRUE;
} }
i ++; i ++;
node = node->Next(); node = node->GetNext();
} }
return FALSE; return FALSE;
} }
@@ -1637,7 +1638,7 @@ void ClearKeyWordTable(void)
wxNode *node = TopicTable.Next(); wxNode *node = TopicTable.Next();
while (node) while (node)
{ {
TexTopic *texTopic = (TexTopic *)node->Data(); TexTopic *texTopic = (TexTopic *)node->GetData();
delete texTopic; delete texTopic;
node = TopicTable.Next(); node = TopicTable.Next();
} }

View File

@@ -348,21 +348,21 @@ void XLPOnMacro(int macroId, int no_args, bool start)
{ {
indentLevel --; indentLevel --;
if (itemizeStack.First()) if (itemizeStack.GetFirst())
{ {
ItemizeStruc *struc = (ItemizeStruc *)itemizeStack.First()->Data(); ItemizeStruc *struc = (ItemizeStruc *)itemizeStack.GetFirst()->GetData();
delete struc; delete struc;
delete itemizeStack.First(); delete itemizeStack.GetFirst();
} }
} }
break; break;
} }
case ltITEM: case ltITEM:
{ {
wxNode *node = itemizeStack.First(); wxNode *node = itemizeStack.GetFirst();
if (node) if (node)
{ {
ItemizeStruc *struc = (ItemizeStruc *)node->Data(); ItemizeStruc *struc = (ItemizeStruc *)node->GetData();
if (!start) if (!start)
{ {
struc->currentItem += 1; struc->currentItem += 1;
@@ -1176,18 +1176,18 @@ bool XLPGo(void)
contentsString ? contentsString : "WXHELPCONTENTS"); contentsString ? contentsString : "WXHELPCONTENTS");
TraverseDocument(); TraverseDocument();
wxNode *node = hyperLinks.First(); wxNode *node = hyperLinks.GetFirst();
while (node) while (node)
{ {
long from = node->GetKeyInteger(); long from = node->GetKeyInteger();
char *label = (char *)node->Data(); char *label = (char *)node->GetData();
wxNode *otherNode = hyperLabels.Find(label); wxNode *otherNode = hyperLabels.Find(label);
if (otherNode) if (otherNode)
{ {
long to = (long)otherNode->Data(); long to = (long)otherNode->GetData();
fprintf(Index, "%ld %ld\n", from, to); fprintf(Index, "%ld %ld\n", from, to);
} }
node = node->Next(); node = node->GetNext();
} }
fprintf(Index, "}\n"); fprintf(Index, "}\n");