summaryrefslogtreecommitdiff
path: root/tools/preproc/asm_file.cpp
diff options
context:
space:
mode:
authorJaceCearK1 <JaceCearK1@users.noreply.github.com>2017-07-01 21:04:18 +0200
committerGitHub <noreply@github.com>2017-07-01 21:04:18 +0200
commit0dd804a99e5455a0eac8ff6ed87d9de16c7380b7 (patch)
tree7b3567978b63ee6548a7b945e075ea8ba37bef51 /tools/preproc/asm_file.cpp
parentf1344efd2aff92292f58f7323bd9297a38fe9b02 (diff)
parent8d82578d3a101b06f9d2ced31738021007c4e533 (diff)
Merge pull request #1 from pret/master
Update fork to match main fork.
Diffstat (limited to 'tools/preproc/asm_file.cpp')
-rw-r--r--tools/preproc/asm_file.cpp39
1 files changed, 8 insertions, 31 deletions
diff --git a/tools/preproc/asm_file.cpp b/tools/preproc/asm_file.cpp
index 7deaccc8a..bb296b78b 100644
--- a/tools/preproc/asm_file.cpp
+++ b/tools/preproc/asm_file.cpp
@@ -111,45 +111,22 @@ void AsmFile::RemoveComments()
m_buffer[pos++] = ' ';
m_buffer[pos++] = ' ';
- char commentStringChar = 0;
-
for (;;)
{
if (m_buffer[pos] == 0)
return;
- if (commentStringChar != 0)
+ if (m_buffer[pos] == '*' && m_buffer[pos + 1] == '/')
{
- if (m_buffer[pos] == '\\' && m_buffer[pos + 1] == commentStringChar)
- {
- m_buffer[pos++] = ' ';
- m_buffer[pos++] = ' ';
- }
- else
- {
- if (m_buffer[pos] == commentStringChar)
- commentStringChar = 0;
- if (m_buffer[pos] != '\n')
- m_buffer[pos] = ' ';
- pos++;
- }
+ m_buffer[pos++] = ' ';
+ m_buffer[pos++] = ' ';
+ break;
}
else
{
- if (m_buffer[pos] == '*' && m_buffer[pos + 1] == '/')
- {
- m_buffer[pos++] = ' ';
- m_buffer[pos++] = ' ';
- break;
- }
- else
- {
- if (m_buffer[pos] == '"' || m_buffer[pos] == '\'')
- commentStringChar = m_buffer[pos];
- if (m_buffer[pos] != '\n')
- m_buffer[pos] = ' ';
- pos++;
- }
+ if (m_buffer[pos] != '\n')
+ m_buffer[pos] = ' ';
+ pos++;
}
}
}
@@ -517,7 +494,7 @@ bool AsmFile::IsAtEnd()
// Output the current location to set gas's logical file and line numbers.
void AsmFile::OutputLocation()
{
- printf("# %ld \"%s\"\n", m_lineNum, m_filename.c_str());
+ std::printf("# %ld \"%s\"\n", m_lineNum, m_filename.c_str());
}
// Reports a diagnostic message.