1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-25 13:29:41 +00:00

Renamed GT_GetArraySize to GT_GetElementCount.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5267 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz 2011-08-23 18:01:23 +00:00
parent 25171465d3
commit d225866449
2 changed files with 17 additions and 11 deletions

View File

@ -34,6 +34,7 @@
/* common */
#include "check.h"
#include "gentype.h"
#include "strbuf.h"
@ -72,9 +73,11 @@ void GT_AddArray (StrBuf* Type, unsigned ArraySize)
unsigned GT_GetArraySize (StrBuf* Type)
/* Retrieve the size of an array stored in Type at the current index position.
* The index position will get moved past the array size.
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.
*/
{
/* Get the number of bytes for the element count */
@ -123,6 +126,3 @@ const char* GT_AsString (const StrBuf* Type, StrBuf* String)

View File

@ -74,22 +74,26 @@
#define GT_SIZE_3 0x02U
#define GT_SIZE_4 0x03U
#define GT_SIZE_MASK 0x07U
#define GT_GET_SIZE(x) (((x) & GT_SIZE_MASK) + 1U)
/* Sign of the data type */
#define GT_UNSIGNED 0x00U
#define GT_SIGNED 0x08U
#define GT_SIGN_MASK 0x08U
#define GT_HAS_SIGN(x) (((x) & GT_SIZE_MASK) == GT_SIGNED)
/* Byte order */
#define GT_LITTLE_ENDIAN 0x00U
#define GT_BIG_ENDIAN 0x10U
#define GT_BYTEORDER_MASK 0x10U
#define GT_IS_LITTLE_ENDIAN(x) (((x) & GT_BYTEORDER_MASK) == GT_LITTLE_ENDIAN)
#define GT_IS_BIG_ENDIAN(x) (((x) & GT_BYTEORDER_MASK) == GT_BIG_ENDIAN)
/* Type of the data. */
#define GT_TYPE_VOID 0x00U
#define GT_TYPE_INT 0x20U
#define GT_TYPE_PTR 0x40U
#define GT_TYPE_FLOAT 0x60U
@ -98,6 +102,7 @@
#define GT_TYPE_STRUCT 0xC0U
#define GT_TYPE_UNION 0xE0U
#define GT_TYPE_MASK 0xE0U
#define GT_GET_TYPE(x) ((x) & GT_TYPE_MASK)
#define GT_IS_INTEGER(x) (GT_GET_TYPE(x) == GT_TYPE_INTEGER)
#define GT_IS_POINTER(x) (GT_GET_TYPE(x) == GT_TYPE_POINTER)
@ -108,6 +113,7 @@
#define GT_IS_UNION(x) (GT_GET_TYPE(x) == GT_TYPE_UNION)
/* Combined values for the 6502 family */
#define GT_VOID (GT_TYPE_VOID)
#define GT_BYTE (GT_TYPE_INT | GT_LITTLE_ENDIAN | GT_UNSIGNED | GT_SIZE_1)
#define GT_WORD (GT_TYPE_INT | GT_LITTLE_ENDIAN | GT_UNSIGNED | GT_SIZE_2)
#define GT_DWORD (GT_TYPE_INT | GT_LITTLE_ENDIAN | GT_UNSIGNED | GT_SIZE_4)
@ -129,11 +135,11 @@ void GT_AddArray (StrBuf* Type, unsigned ArraySize);
* NOT add the element type!
*/
unsigned GT_GetArraySize (StrBuf* Type);
/* Retrieve the size 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.
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.
*/
const char* GT_AsString (const StrBuf* Type, StrBuf* String);