void GT_AddArray (StrBuf* Type, unsigned ArraySize)
/* Add an array with the given size to the type string in Type. This will
- * NOT add the element type!
- */
+** NOT add the element type!
+*/
{
unsigned SizeBytes;
/* Remember the current position */
- char* A = SB_GetBuf (Type) + SB_GetLen (Type);
+ unsigned Pos = SB_GetLen (Type);
/* Add a dummy array token */
SB_AppendChar (Type, GT_TYPE_ARRAY);
} while (ArraySize);
/* Write the correct array token */
- *A = GT_ARRAY (SizeBytes);
+ SB_GetBuf (Type)[Pos] = GT_ARRAY (SizeBytes);
}
unsigned GT_GetElementCount (StrBuf* Type)
/* Retrieve the element count of an array stored in Type at the current index
- * position. Note: Index must point to the array token itself, since the size
- * of the element count is encoded there. The index position will get moved
- * past the array.
- */
+** position. Note: Index must point to the array token itself, since the size
+** of the element count is encoded there. The index position will get moved
+** past the array.
+*/
{
/* Get the number of bytes for the element count */
unsigned SizeBytes = GT_GET_SIZE (SB_Get (Type));
const char* GT_AsString (const StrBuf* Type, StrBuf* String)
/* Convert the type into a readable representation. The target string buffer
- * will be zero terminated and a pointer to the contents are returned.
- */
+** will be zero terminated and a pointer to the contents are returned.
+*/
{
static const char HexTab[16] = "0123456789ABCDEF";
unsigned I;
/* Convert Type into readable hex. String will have twice then length
- * plus a terminator.
- */
+ ** plus a terminator.
+ */
SB_Realloc (String, 2 * SB_GetLen (Type) + 1);
SB_Clear (String);
/* Return the contents of String */
return SB_GetConstBuf (String);
}
-
-
-