From d38e80ee04afe582e70150d3884e56c05f3fd7a8 Mon Sep 17 00:00:00 2001 From: pixel Date: Sat, 27 Nov 2004 21:44:44 +0000 Subject: Large dos2unix commit... --- bin2c.cpp | 80 +++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 40 insertions(+), 40 deletions(-) (limited to 'bin2c.cpp') diff --git a/bin2c.cpp b/bin2c.cpp index 61f9618..69561a1 100644 --- a/bin2c.cpp +++ b/bin2c.cpp @@ -1,40 +1,40 @@ -#include -#include -#include - -CODE_BEGINS -virtual int startup() throw (GeneralException) { - int i; - - if (argc != 4) { - printm(M_BARE, "Usage: %s \n", argv[0]); - exit(-1); - } - - printm(M_BARE, "Starting converting %s to %s:\n", argv[1], argv[2]); - - Input binfile(argv[1]); - Output cfile(argv[2]); - - unsigned char * map = (unsigned char *) binfile.mmap(); - - cfile << "int " << argv[3] << "_size = " << binfile.GetSize() << ";\n"; - cfile << "unsigned char " << argv[3] << "[] = {"; - - for (i = 0; i < binfile.GetSize(); i++) { - String s; - - s.set("0x%02x, ", map[i]); - if (!(i % 16)) { - cfile << "\n\t"; - printm(M_BARE, "%5.2f%%\r", i * 100.0 / binfile.GetSize()); - } - cfile << s; - } - - cfile << "\n};\n"; - printm(M_BARE, "Done! \n"); - - return 0; -} -CODE_ENDS +#include +#include +#include + +CODE_BEGINS +virtual int startup() throw (GeneralException) { + int i; + + if (argc != 4) { + printm(M_BARE, "Usage: %s \n", argv[0]); + exit(-1); + } + + printm(M_BARE, "Starting converting %s to %s:\n", argv[1], argv[2]); + + Input binfile(argv[1]); + Output cfile(argv[2]); + + unsigned char * map = (unsigned char *) binfile.mmap(); + + cfile << "int " << argv[3] << "_size = " << binfile.GetSize() << ";\n"; + cfile << "unsigned char " << argv[3] << "[] = {"; + + for (i = 0; i < binfile.GetSize(); i++) { + String s; + + s.set("0x%02x, ", map[i]); + if (!(i % 16)) { + cfile << "\n\t"; + printm(M_BARE, "%5.2f%%\r", i * 100.0 / binfile.GetSize()); + } + cfile << s; + } + + cfile << "\n};\n"; + printm(M_BARE, "Done! \n"); + + return 0; +} +CODE_ENDS -- cgit v1.2.3