Make much more usage of dynamic strings (StrBufs) instead of char* and
friends. Since names and other strings are now StrBufs in many places, code for output had to be changed. Added support for string literals to StrBuf. git-svn-id: svn://svn.cc65.org/cc65/trunk@3825 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -6,8 +6,8 @@
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/* (C) 1998-2003 Ullrich von Bassewitz */
|
||||
/* R<EFBFBD>merstra<EFBFBD>e 52 */
|
||||
/* (C) 1998-2008 Ullrich von Bassewitz */
|
||||
/* Roemerstrasse 52 */
|
||||
/* D-70794 Filderstadt */
|
||||
/* EMail: uz@cc65.org */
|
||||
/* */
|
||||
@@ -104,15 +104,18 @@ void EmitPCRel (unsigned char OPC, ExprNode* Expr, unsigned Size)
|
||||
|
||||
|
||||
|
||||
void EmitData (const unsigned char* Data, unsigned Size)
|
||||
void EmitData (const void* D, unsigned Size)
|
||||
/* Emit data into the current segment */
|
||||
{
|
||||
/* Make a useful pointer from Data */
|
||||
const unsigned char* Data = D;
|
||||
|
||||
/* Create lots of fragments for the data */
|
||||
while (Size) {
|
||||
Fragment* F;
|
||||
Fragment* F;
|
||||
|
||||
/* Determine the length of the next fragment */
|
||||
unsigned Len = Size;
|
||||
/* Determine the length of the next fragment */
|
||||
unsigned Len = Size;
|
||||
if (Len > sizeof (F->V.Data)) {
|
||||
Len = sizeof (F->V.Data);
|
||||
}
|
||||
@@ -132,6 +135,15 @@ void EmitData (const unsigned char* Data, unsigned Size)
|
||||
|
||||
|
||||
|
||||
void EmitStrBuf (const StrBuf* Data)
|
||||
/* Emit a string into the current segment */
|
||||
{
|
||||
/* Use EmitData to output the data */
|
||||
EmitData (SB_GetConstBuf (Data), SB_GetLen (Data));
|
||||
}
|
||||
|
||||
|
||||
|
||||
void EmitByte (ExprNode* Expr)
|
||||
/* Emit one byte */
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user