From: uz Date: Thu, 18 Aug 2011 12:35:43 +0000 (+0000) Subject: Don't use a separate Count field for the line info type. X-Git-Tag: V2.13.3~253 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=862c0ba70ea202a2356f68a9f9c2911c8e718240;p=cc65 Don't use a separate Count field for the line info type. git-svn-id: svn://svn.cc65.org/cc65/trunk@5209 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/ca65/lineinfo.c b/src/ca65/lineinfo.c index 7d8e33fe0..ad5cb8f35 100644 --- a/src/ca65/lineinfo.c +++ b/src/ca65/lineinfo.c @@ -79,8 +79,7 @@ static int HT_Compare (const void* Key1, const void* Key2); typedef struct LineInfoKey LineInfoKey; struct LineInfoKey { FilePos Pos; /* File position */ - unsigned short Type; /* Type of line info */ - unsigned short Count; /* Recursion counter */ + unsigned Type; /* Type/count of line info */ }; /* Structure that holds line info */ @@ -153,15 +152,12 @@ static int HT_Compare (const void* Key1, const void* Key2) const LineInfoKey* K1 = Key1; const LineInfoKey* K2 = Key2; - /* Compare line number, then file and type, then count */ + /* Compare line number, then file and type */ int Res = (int)K2->Pos.Line - (int)K1->Pos.Line; if (Res == 0) { Res = (int)K2->Pos.Name - (int)K1->Pos.Name; if (Res == 0) { Res = (int)K2->Type - (int)K1->Type; - if (Res == 0) { - Res = (int)K2->Count - (int)K1->Count; - } } } @@ -310,8 +306,7 @@ LineInfo* StartLine (const FilePos* Pos, unsigned Type, unsigned Count) /* Prepare the key struct */ Key.Pos = *Pos; - Key.Type = Type; - Key.Count = Count; + Key.Type = LI_MAKE_TYPE (Type, Count); /* Try to find a line info with this position and type in the hash table. * If so, reuse it. Otherwise create a new one. @@ -320,8 +315,6 @@ LineInfo* StartLine (const FilePos* Pos, unsigned Type, unsigned Count) if (LI == 0) { /* Allocate a new LineInfo */ LI = NewLineInfo (&Key); - } else { - Key.Count = 2; } /* Open the spans for this line info */ @@ -456,9 +449,9 @@ void WriteLineInfos (void) ObjWritePos (&LI->Key.Pos); /* Write the type and count of the line info */ - ObjWriteVar (LI_MAKE_TYPE (LI->Key.Type, LI->Key.Count)); + ObjWriteVar (LI->Key.Type); - /* Spans are only added to the debug file if debug information is + /* Spans are only added to the debug file if debug information is * requested. Otherwise we write an empty list. */ if (DbgSyms) {