Use the Span structure also for scopes.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5115 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2011-08-04 13:14:26 +00:00
parent e9d9ba92b0
commit 04a0dafe25
7 changed files with 97 additions and 68 deletions

View File

@@ -186,3 +186,27 @@ const char* GetObjFileName (const ObjData* O)
struct Section* GetObjSection (ObjData* O, unsigned Id)
/* Get a section from an object file checking for a valid index */
{
if (Id >= CollCount (&O->Sections)) {
Error ("Invalid section index (%u) in module `%s'",
Id, GetObjFileName (O));
}
return CollAtUnchecked (&O->Sections, Id);
}
struct Scope* GetObjScope (ObjData* O, unsigned Id)
/* Get a scope from an object file checking for a valid index */
{
if (Id >= CollCount (&O->Scopes)) {
Error ("Invalid scope index (%u) in module `%s'",
Id, GetObjFileName (O));
}
return CollAtUnchecked (&O->Scopes, Id);
}