Store the encoded file name in a QString.

This commit is contained in:
Roberto Raggi
2009-05-27 15:34:13 +02:00
parent b3bccbc2e8
commit bdf6c3d0be
6 changed files with 15 additions and 16 deletions

View File

@@ -108,7 +108,7 @@ const char *MacroExpander::expand(const char *__first, const char *__last,
__result->append(QByteArray::number(env->currentLine));
__result->append(' ');
__result->append('"');
__result->append(env->currentFile);
__result->append(env->currentFile.toUtf8());
__result->append('"');
__result->append('\n');
++lines;
@@ -244,16 +244,14 @@ const char *MacroExpander::expand(const char *__first, const char *__last,
{
if (fast_name == "__LINE__")
{
char buf [16];
const size_t count = qsnprintf (buf, 16, "%d", env->currentLine + lines);
__result->append(buf, count);
__result->append(QByteArray::number(env->currentLine + lines));
continue;
}
else if (fast_name == "__FILE__")
{
__result->append('"');
__result->append(env->currentFile);
__result->append(env->currentFile.toUtf8());
__result->append('"');
continue;
}