Use a separate structure for file infos instead of just the name.
git-svn-id: svn://svn.cc65.org/cc65/trunk@749 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
|
||||
|
||||
/* common */
|
||||
#include "check.h"
|
||||
#include "xmalloc.h"
|
||||
|
||||
/* ld65 */
|
||||
@@ -55,6 +56,7 @@ static LineInfo* NewLineInfo (void)
|
||||
LineInfo* LI = xmalloc (sizeof (LineInfo));
|
||||
|
||||
/* Initialize the fields */
|
||||
LI->File = 0;
|
||||
InitFilePos (&LI->Pos);
|
||||
InitCollection (&LI->Fragments);
|
||||
|
||||
@@ -73,6 +75,10 @@ LineInfo* ReadLineInfo (FILE* F, ObjData* O)
|
||||
/* Read the file position */
|
||||
ReadFilePos (F, &LI->Pos);
|
||||
|
||||
/* Resolve the file index to a pointer to FileInfo struct */
|
||||
CHECK (LI->Pos.Name < O->FileCount);
|
||||
LI->File = O->Files[LI->Pos.Name];
|
||||
|
||||
/* Return the new LineInfo */
|
||||
return LI;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user