mirror of
https://github.com/autc04/Retro68.git
synced 2024-11-24 23:32:06 +00:00
ConvertObj: insist on proper "first" record and version
This commit is contained in:
parent
2cf217fb64
commit
3327705fb3
@ -282,7 +282,33 @@ int main(int argc, char* argv[])
|
||||
std::shared_ptr<Module> module;
|
||||
std::vector<std::shared_ptr<Module>> modules;
|
||||
|
||||
std::cout << "\t.text\n\t.align 2\n";
|
||||
|
||||
{
|
||||
int firstRecord = byte(in);
|
||||
/*int flags =*/ byte(in);
|
||||
int version = word(in);
|
||||
|
||||
if(firstRecord != kFirst)
|
||||
{
|
||||
std::cerr << "Not an MPW object file.\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(version > 3)
|
||||
{
|
||||
std::cerr << "Unknown/invalid MPW object file version "
|
||||
<< version << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(verbose)
|
||||
{
|
||||
std::cerr << "First\n";
|
||||
std::cerr << "Version: " << version << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << "\t.text\n\t.align 2\n";
|
||||
|
||||
for(bool endOfObject = false; !endOfObject;) {
|
||||
if(verbose)
|
||||
@ -304,17 +330,6 @@ int main(int argc, char* argv[])
|
||||
if(verbose)
|
||||
std::cerr << "Pad\n";
|
||||
break;
|
||||
case kFirst:
|
||||
{
|
||||
/*int flags =*/ byte(in);
|
||||
int version = word(in);
|
||||
if(verbose)
|
||||
{
|
||||
std::cerr << "First\n";
|
||||
std::cerr << "Version: " << version << std::endl;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case kComment:
|
||||
{
|
||||
/*int flags =*/ byte(in);
|
||||
|
Loading…
Reference in New Issue
Block a user