Implementation of StringPool has changed.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5242 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2011-08-21 13:21:11 +00:00
parent 4461988fd1
commit 77110021ab
3 changed files with 26 additions and 12 deletions

View File

@@ -49,7 +49,7 @@
extern StringPool StrPool;
extern StringPool* StrPool;
@@ -63,45 +63,48 @@ extern StringPool StrPool;
INLINE unsigned GetStrBufId (const StrBuf* S)
/* Return the id of the given string buffer */
{
return SP_Add (&StrPool, S);
return SP_Add (StrPool, S);
}
#else
# define GetStrBufId(S) SP_Add (&StrPool, (S))
# define GetStrBufId(S) SP_Add (StrPool, (S))
#endif
#if defined(HAVE_INLINE)
INLINE unsigned GetStringId (const char* S)
/* Return the id of the given string */
{
return SP_AddStr (&StrPool, S);
return SP_AddStr (StrPool, S);
}
#else
# define GetStringId(S) SP_AddStr (&StrPool, (S))
# define GetStringId(S) SP_AddStr (StrPool, (S))
#endif
#if defined(HAVE_INLINE)
INLINE const StrBuf* GetStrBuf (unsigned Index)
/* Convert a string index into a string */
{
return SP_Get (&StrPool, Index);
return SP_Get (StrPool, Index);
}
#else
# define GetStrBuf(Index) SP_Get (&StrPool, (Index))
# define GetStrBuf(Index) SP_Get (StrPool, (Index))
#endif
#if defined(HAVE_INLINE)
INLINE const char* GetString (unsigned Index)
/* Convert a string index into a string */
{
return SB_GetConstBuf (SP_Get (&StrPool, Index));
return SB_GetConstBuf (SP_Get (StrPool, Index));
}
#else
# define GetString(Index) SB_GetConstBuf (SP_Get (&StrPool, (Index)))
# define GetString(Index) SB_GetConstBuf (SP_Get (StrPool, (Index)))
#endif
void WriteStrPool (void);
/* Write the string pool to the object file */
void InitStrPool (void);
/* Initialize the string pool */
/* End of spool.h */