summaryrefslogtreecommitdiff
path: root/tools/preproc/asm_file.cpp
diff options
context:
space:
mode:
authorYamaArashi <shadow962@live.com>2016-04-30 04:19:00 -0700
committerYamaArashi <shadow962@live.com>2016-04-30 04:19:00 -0700
commit1e6eb4f81296eca9c2f1f373c19716939f9b6be6 (patch)
treeffd770e2b6447120c513cf75ef059d588beff112 /tools/preproc/asm_file.cpp
parent000e34c6f29655aa20034e390e4e2a6c1f7a1258 (diff)
use compiled libgcc
Diffstat (limited to 'tools/preproc/asm_file.cpp')
-rw-r--r--tools/preproc/asm_file.cpp22
1 files changed, 7 insertions, 15 deletions
diff --git a/tools/preproc/asm_file.cpp b/tools/preproc/asm_file.cpp
index 0b42d9ab2..e2f6d81c9 100644
--- a/tools/preproc/asm_file.cpp
+++ b/tools/preproc/asm_file.cpp
@@ -77,15 +77,14 @@ AsmFile::~AsmFile()
void AsmFile::RemoveComments()
{
long pos = 0;
- bool inString = false;
- char stringChar;
+ char stringChar = 0;
for (;;)
{
if (m_buffer[pos] == 0)
return;
- if (inString)
+ if (stringChar != 0)
{
if (m_buffer[pos] == '\\' && m_buffer[pos + 1] == stringChar)
{
@@ -94,7 +93,7 @@ void AsmFile::RemoveComments()
else
{
if (m_buffer[pos] == stringChar)
- inString = false;
+ stringChar = 0;
pos++;
}
}
@@ -108,15 +107,14 @@ void AsmFile::RemoveComments()
m_buffer[pos++] = ' ';
m_buffer[pos++] = ' ';
- bool inCommentString = false;
- char commentStringChar;
+ char commentStringChar = 0;
for (;;)
{
if (m_buffer[pos] == 0)
return;
- if (inCommentString)
+ if (commentStringChar != 0)
{
if (m_buffer[pos] == '\\' && m_buffer[pos + 1] == commentStringChar)
{
@@ -126,7 +124,7 @@ void AsmFile::RemoveComments()
else
{
if (m_buffer[pos] == commentStringChar)
- inCommentString = false;
+ commentStringChar = 0;
if (m_buffer[pos] != '\n')
m_buffer[pos] = ' ';
pos++;
@@ -143,10 +141,7 @@ void AsmFile::RemoveComments()
else
{
if (m_buffer[pos] == '"' || m_buffer[pos] == '\'')
- {
commentStringChar = m_buffer[pos];
- inCommentString = true;
- }
if (m_buffer[pos] != '\n')
m_buffer[pos] = ' ';
pos++;
@@ -157,10 +152,7 @@ void AsmFile::RemoveComments()
else
{
if (m_buffer[pos] == '"' || m_buffer[pos] == '\'')
- {
stringChar = m_buffer[pos];
- inString = true;
- }
pos++;
}
}
@@ -553,7 +545,7 @@ do \
void AsmFile::RaiseError(const char* format, ...)
{
DO_REPORT("error");
- exit(1);
+ std::exit(1);
}
// Reports a warning diagnostic.