diff options
Diffstat (limited to 'tools/preproc')
-rw-r--r-- | tools/preproc/asm_file.cpp | 2 | ||||
-rw-r--r-- | tools/preproc/c_file.cpp | 16 | ||||
-rw-r--r-- | tools/preproc/preproc.cpp | 14 |
3 files changed, 16 insertions, 16 deletions
diff --git a/tools/preproc/asm_file.cpp b/tools/preproc/asm_file.cpp index 49c9e3c66..bb296b78b 100644 --- a/tools/preproc/asm_file.cpp +++ b/tools/preproc/asm_file.cpp @@ -494,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. diff --git a/tools/preproc/c_file.cpp b/tools/preproc/c_file.cpp index a2f178623..5bfdee086 100644 --- a/tools/preproc/c_file.cpp +++ b/tools/preproc/c_file.cpp @@ -247,23 +247,23 @@ bool CFile::CheckIdentifier(const std::string& ident) std::unique_ptr<unsigned char[]> CFile::ReadWholeFile(const std::string& path, int& size) { - FILE* fp = fopen(path.c_str(), "rb"); + FILE* fp = std::fopen(path.c_str(), "rb"); if (fp == nullptr) RaiseError("Failed to open \"%s\" for reading.\n", path.c_str()); - fseek(fp, 0, SEEK_END); + std::fseek(fp, 0, SEEK_END); - size = ftell(fp); + size = std::ftell(fp); std::unique_ptr<unsigned char[]> buffer = std::unique_ptr<unsigned char[]>(new unsigned char[size]); - rewind(fp); + std::rewind(fp); - if (fread(buffer.get(), size, 1, fp) != 1) + if (std::fread(buffer.get(), size, 1, fp) != 1) RaiseError("Failed to read \"%s\".\n", path.c_str()); - fclose(fp); + std::fclose(fp); return buffer; } @@ -379,9 +379,9 @@ void CFile::TryConvertIncbin() offset += size; if (isSigned) - printf("%d,", data); + std::printf("%d,", data); else - printf("%uu,", data); + std::printf("%uu,", data); } std::printf("}"); diff --git a/tools/preproc/preproc.cpp b/tools/preproc/preproc.cpp index b51861580..8320a2d27 100644 --- a/tools/preproc/preproc.cpp +++ b/tools/preproc/preproc.cpp @@ -31,15 +31,15 @@ void PrintAsmBytes(unsigned char *s, int length) { if (length > 0) { - printf("\t.byte "); + std::printf("\t.byte "); for (int i = 0; i < length; i++) { - printf("0x%02X", s[i]); + std::printf("0x%02X", s[i]); if (i < length - 1) - printf(", "); + std::printf(", "); } - putchar('\n'); + std::putchar('\n'); } } @@ -89,8 +89,8 @@ void PreprocAsmFile(std::string filename) if (globalLabel.length() != 0) { - printf("\t.global %s\n", globalLabel.c_str()); - printf("%s:\n", globalLabel.c_str()); + std::printf("\t.global %s\n", globalLabel.c_str()); + std::printf("%s:\n", globalLabel.c_str()); } else { @@ -134,7 +134,7 @@ int main(int argc, char **argv) { if (argc != 3) { - fprintf(stderr, "Usage: %s SRC_FILE CHARMAP_FILE", argv[0]); + std::fprintf(stderr, "Usage: %s SRC_FILE CHARMAP_FILE", argv[0]); return 1; } |