Some improvements for spans.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5134 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2011-08-07 20:01:40 +00:00
parent bf8f23d5f4
commit 472c21d7ff
4 changed files with 112 additions and 92 deletions

View File

@@ -53,6 +53,7 @@
/* Span definition */
typedef struct Span Span;
struct Span{
unsigned Id; /* Span id */
struct Segment* Seg; /* Pointer to segment */
unsigned long Start; /* Start of range */
unsigned long End; /* End of range */
@@ -66,11 +67,6 @@ struct Span{
Span* NewSpan (struct Segment* Seg);
/* Create a new span. The segment is set to Seg, Start and End are set to the
* current PC of the segment.
*/
#if defined(HAVE_INLINE)
INLINE unsigned long GetSpanSize (const Span* R)
/* Return the span size in bytes */
@@ -81,9 +77,10 @@ INLINE unsigned long GetSpanSize (const Span* R)
# define GetSpanSize(R) ((R)->End - (R)->Start)
#endif
void AddSpans (Collection* Spans);
/* Add a span for all existing segments to the given collection of spans. The
* currently active segment will be inserted first with all others following.
void OpenSpans (Collection* Spans);
/* Open a list of spans for all existing segments to the given collection of
* spans. The currently active segment will be inserted first with all others
* following.
*/
void CloseSpans (Collection* Spans);