X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fcc65%2Fcodeseg.h;h=cde8c4ff1c4fc53550dfd003805c7ea94e3e7903;hb=9fc71c5e93f7e8270dd6f8fc3810b7b731bf1259;hp=3ddf24ada5ffd0396edd0169c888a3d4b942a108;hpb=1647c6783f98c7ca74f1f49a7f3eb3c60bdf95d0;p=cc65 diff --git a/src/cc65/codeseg.h b/src/cc65/codeseg.h index 3ddf24ada..cde8c4ff1 100644 --- a/src/cc65/codeseg.h +++ b/src/cc65/codeseg.h @@ -6,9 +6,9 @@ /* */ /* */ /* */ -/* (C) 2001-2002 Ullrich von Bassewitz */ -/* Wacholderweg 14 */ -/* D-70597 Stuttgart */ +/* (C) 2001-2004 Ullrich von Bassewitz */ +/* Römerstrasse 52 */ +/* D-70794 Filderstadt */ /* EMail: uz@cc65.org */ /* */ /* */ @@ -161,7 +161,7 @@ INLINE struct CodeEntry* CS_GetEntry (CodeSeg* S, unsigned Index) return CollAt (&S->Entries, Index); } #else -# define CS_GetEntry(S, Index) CollAt(&(S)->Entries, (Index)) +# define CS_GetEntry(S, Index) ((struct CodeEntry*) CollAt(&(S)->Entries, (Index))) #endif struct CodeEntry* CS_GetPrevEntry (CodeSeg* S, unsigned Index); @@ -189,6 +189,18 @@ int CS_RangeHasLabel (CodeSeg* S, unsigned Start, unsigned Count); * possible span instead. */ +#if defined(HAVE_INLINE) +INLINE int CS_HavePendingLabel (const CodeSeg* S) +/* Return true if there are open labels that will get attached to the next + * instruction that is added. + */ +{ + return (CollCount (&S->Labels) > 0); +} +#else +# define CS_HavePendingLabel(S) (CollCount (&(S)->Labels) > 0) +#endif + CodeLabel* CS_AddLabel (CodeSeg* S, const char* Name); /* Add a code label for the next instruction to follow */ @@ -263,7 +275,7 @@ void CS_OutputEpilogue (const CodeSeg* S, FILE* F); * assembler epilogue into the file. That is: Close the local function scope. */ -void CS_Output (const CodeSeg* S, FILE* F); +void CS_Output (CodeSeg* S, FILE* F); /* Output the code segment data to a file */ void CS_FreeRegInfo (CodeSeg* S);