Added white space trimming program to toolkit. Trimmed whitespace off toolkit. Minor cleanup to extraext.

This commit is contained in:
n-a-c-h
2005-06-02 00:13:26 +00:00
parent 97690f8d3f
commit b13fbb8f41
6 changed files with 127 additions and 19 deletions

View File

@@ -33,7 +33,7 @@ using namespace std;
void handle_file(const char *filename)
{
enum sections { sec_unknown, sec_bss, sec_data, sec_text };
enum sections { sec_unknown, sec_bss, sec_data, sec_text };
ifstream file(filename, ios::in);
if (file)
@@ -45,20 +45,20 @@ void handle_file(const char *filename)
if (!strcasecmp(line, "SECTION .BSS")) { cur_section = sec_bss; }
if (!strcasecmp(line, "SECTION .DATA")) { cur_section = sec_data; }
if (!strcasecmp(line, "SECTION .text")) { cur_section = sec_text; }
if ((cur_section != sec_bss) &&
if ((cur_section != sec_bss) &&
(strstr(line, " resd ") || strstr(line, " resw ") || strstr(line, " resb ") ||
(strstr(line, ",resd ") || strstr(line, ",resw ") || strstr(line, ",resb ")) ))
{
cout << filename << ": line " << i << ": Error, resx in non BSS section. \"" << line << "\"" << endl;
}
if ((cur_section != sec_data) &&
if ((cur_section != sec_data) &&
(strstr(line, " dd ") || strstr(line, " dw ") || strstr(line, " db ") ||
(strstr(line, ",dd ") || strstr(line, ",dw ") || strstr(line, ",db ")) ))
{
cout << filename << ": line " << i << ": Error, dx in non DATA section. \"" << line << "\"" << endl;
}
}
}
}
else