git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@6926 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2000-03-24 19:26:56 +00:00
parent dc25e1d304
commit 7f4bca30df

View File

@@ -673,20 +673,20 @@ void wxExpr::WriteClause(FILE* stream) // Write this expression as a top-level
if (node) if (node)
{ {
node->WriteExpr(stream); node->WriteExpr(stream);
wxFprintf( stream, wxT("(") ); fprintf( stream, "(" );
node = node->next; node = node->next;
bool first = TRUE; bool first = TRUE;
while (node) while (node)
{ {
if (!first) if (!first)
wxFprintf( stream, wxT(" ") ); fprintf( stream, " " );
node->WriteExpr(stream); node->WriteExpr(stream);
node = node->next; node = node->next;
if (node) if (node)
wxFprintf( stream, wxT(",\n") ); fprintf( stream, ",\n" );
first = FALSE; first = FALSE;
} }
wxFprintf( stream, wxT(").\n\n") ); fprintf( stream, ").\n\n" );
} }
} }
@@ -699,40 +699,40 @@ void wxExpr::WriteExpr(FILE* stream) // Write as any other subexpression
// I don't want to turn optimization off since it's needed // I don't want to turn optimization off since it's needed
// for reading in files quickly. // for reading in files quickly.
#if defined(__WATCOMC__) #if defined(__WATCOMC__)
wxChar buf[2]; char buf[2];
wxSprintf(buf, wxT("")); sprintf(buf, "");
#endif #endif
switch (type) switch (type)
{ {
case wxExprInteger: case wxExprInteger:
{ {
wxFprintf( stream, wxT("%ld"), value.integer ); fprintf( stream, "%ld", value.integer );
break; break;
} }
case wxExprReal: case wxExprReal:
{ {
double f = value.real; double f = value.real;
wxFprintf( stream, wxT("%.6g"), f); fprintf( stream, "%.6g", f);
break; break;
} }
case wxExprString: case wxExprString:
{ {
wxFprintf( stream, wxT("\"") ); fprintf( stream, "\"" );
size_t i; size_t i;
const wxWX2MBbuf val = wxConvLibc.cWX2MB(value.string); const wxWX2MBbuf val = wxConvLibc.cWX2MB(value.string);
size_t len = strlen(val); size_t len = strlen(val);
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
{ {
wxChar ch = val[i]; char ch = val[i];
if (ch == wxT('"') || ch == wxT('\\')) if (ch == '"' || ch == '\\')
wxFprintf( stream, wxT("\\") ); fprintf( stream, "\\" );
wxChar tmp[2]; char tmp[2];
tmp[0] = ch; tmp[0] = ch;
tmp[1] = 0; tmp[1] = 0;
wxFprintf( stream, tmp ); fprintf( stream, tmp );
} }
wxFprintf( stream, wxT("\"") ); fprintf( stream, "\"" );
break; break;
} }
case wxExprWord: case wxExprWord:
@@ -752,12 +752,12 @@ void wxExpr::WriteExpr(FILE* stream) // Write as any other subexpression
} }
if (quote_it) if (quote_it)
wxFprintf( stream ,wxT("'") ); fprintf( stream ,"'" );
wxFprintf( stream, (const wxChar*) val ); fprintf( stream, val );
if (quote_it) if (quote_it)
wxFprintf( stream, wxT("'") ); fprintf( stream, "'" );
break; break;
} }
@@ -774,20 +774,20 @@ void wxExpr::WriteExpr(FILE* stream) // Write as any other subexpression
wxExpr *arg1 = expr->next; wxExpr *arg1 = expr->next;
wxExpr *arg2 = arg1->next; wxExpr *arg2 = arg1->next;
arg1->WriteExpr(stream); arg1->WriteExpr(stream);
wxFprintf( stream, wxT(" = ") ); fprintf( stream, " = " );
arg2->WriteExpr(stream); arg2->WriteExpr(stream);
} }
else else
{ {
wxFprintf( stream, wxT("[") ); fprintf( stream, "[" );
while (expr) while (expr)
{ {
expr->WriteExpr(stream); expr->WriteExpr(stream);
expr = expr->next; expr = expr->next;
if (expr) if (expr)
wxFprintf( stream, wxT(", ") ); fprintf( stream, ", " );
} }
wxFprintf( stream, wxT("]") ); fprintf( stream, "]" );
} }
} }
break; break;