Predefined type strings for inlined std function parameters.
This commit is contained in:
@@ -72,6 +72,12 @@ const Type type_size_t[] = { TYPE(T_SIZE_T), TYPE(T_END) };
|
|||||||
const Type type_float[] = { TYPE(T_FLOAT), TYPE(T_END) };
|
const Type type_float[] = { TYPE(T_FLOAT), TYPE(T_END) };
|
||||||
const Type type_double[] = { TYPE(T_DOUBLE), TYPE(T_END) };
|
const Type type_double[] = { TYPE(T_DOUBLE), TYPE(T_END) };
|
||||||
|
|
||||||
|
/* More predefined type strings */
|
||||||
|
const Type type_char_p[] = { TYPE(T_PTR), TYPE(T_CHAR), TYPE(T_END) };
|
||||||
|
const Type type_c_char_p[] = { TYPE(T_PTR), TYPE(T_C_CHAR), TYPE(T_END) };
|
||||||
|
const Type type_void_p[] = { TYPE(T_PTR), TYPE(T_VOID), TYPE(T_END) };
|
||||||
|
const Type type_c_void_p[] = { TYPE(T_PTR), TYPE(T_C_VOID), TYPE(T_END) };
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|||||||
@@ -146,6 +146,10 @@ enum {
|
|||||||
T_PTR = T_TYPE_PTR | T_CLASS_PTR | T_SIGN_NONE | T_SIZE_NONE,
|
T_PTR = T_TYPE_PTR | T_CLASS_PTR | T_SIGN_NONE | T_SIZE_NONE,
|
||||||
T_FUNC = T_TYPE_FUNC | T_CLASS_FUNC | T_SIGN_NONE | T_SIZE_NONE,
|
T_FUNC = T_TYPE_FUNC | T_CLASS_FUNC | T_SIGN_NONE | T_SIZE_NONE,
|
||||||
|
|
||||||
|
/* More types for convenience */
|
||||||
|
T_C_CHAR = T_CHAR | T_QUAL_CONST,
|
||||||
|
T_C_VOID = T_VOID | T_QUAL_CONST,
|
||||||
|
|
||||||
/* Aliases */
|
/* Aliases */
|
||||||
T_SIZE_T = T_UINT,
|
T_SIZE_T = T_UINT,
|
||||||
};
|
};
|
||||||
@@ -211,6 +215,12 @@ extern const Type type_size_t[];
|
|||||||
extern const Type type_float[];
|
extern const Type type_float[];
|
||||||
extern const Type type_double[];
|
extern const Type type_double[];
|
||||||
|
|
||||||
|
/* More predefined type strings */
|
||||||
|
extern const Type type_char_p[];
|
||||||
|
extern const Type type_c_char_p[];
|
||||||
|
extern const Type type_void_p[];
|
||||||
|
extern const Type type_c_void_p[];
|
||||||
|
|
||||||
/* Forward for the SymEntry struct */
|
/* Forward for the SymEntry struct */
|
||||||
struct SymEntry;
|
struct SymEntry;
|
||||||
|
|
||||||
|
|||||||
@@ -212,9 +212,9 @@ static void StdFunc_memcpy (FuncDesc* F attribute ((unused)), ExprDesc* Expr)
|
|||||||
/* Handle the memcpy function */
|
/* Handle the memcpy function */
|
||||||
{
|
{
|
||||||
/* Argument types: (void*, const void*, size_t) */
|
/* Argument types: (void*, const void*, size_t) */
|
||||||
static const Type Arg1Type[] = { TYPE(T_PTR), TYPE(T_VOID), TYPE(T_END) };
|
static const Type* Arg1Type = type_void_p;
|
||||||
static const Type Arg2Type[] = { TYPE(T_PTR), TYPE(T_VOID|T_QUAL_CONST), TYPE(T_END) };
|
static const Type* Arg2Type = type_c_void_p;
|
||||||
static const Type Arg3Type[] = { TYPE(T_SIZE_T), TYPE(T_END) };
|
static const Type* Arg3Type = type_size_t;
|
||||||
|
|
||||||
ArgDesc Arg1, Arg2, Arg3;
|
ArgDesc Arg1, Arg2, Arg3;
|
||||||
unsigned ParamSize = 0;
|
unsigned ParamSize = 0;
|
||||||
@@ -556,9 +556,9 @@ static void StdFunc_memset (FuncDesc* F attribute ((unused)), ExprDesc* Expr)
|
|||||||
/* Handle the memset function */
|
/* Handle the memset function */
|
||||||
{
|
{
|
||||||
/* Argument types: (void*, int, size_t) */
|
/* Argument types: (void*, int, size_t) */
|
||||||
static const Type Arg1Type[] = { TYPE(T_PTR), TYPE(T_VOID), TYPE(T_END) };
|
static const Type* Arg1Type = type_void_p;
|
||||||
static const Type Arg2Type[] = { TYPE(T_INT), TYPE(T_END) };
|
static const Type* Arg2Type = type_int;
|
||||||
static const Type Arg3Type[] = { TYPE(T_SIZE_T), TYPE(T_END) };
|
static const Type* Arg3Type = type_size_t;
|
||||||
|
|
||||||
ArgDesc Arg1, Arg2, Arg3;
|
ArgDesc Arg1, Arg2, Arg3;
|
||||||
int MemSet = 1; /* Use real memset if true */
|
int MemSet = 1; /* Use real memset if true */
|
||||||
@@ -782,8 +782,8 @@ static void StdFunc_strcmp (FuncDesc* F attribute ((unused)), ExprDesc* Expr)
|
|||||||
/* Handle the strcmp function */
|
/* Handle the strcmp function */
|
||||||
{
|
{
|
||||||
/* Argument types: (const char*, const char*) */
|
/* Argument types: (const char*, const char*) */
|
||||||
static const Type Arg1Type[] = { TYPE(T_PTR), TYPE(T_CHAR|T_QUAL_CONST), TYPE(T_END) };
|
static const Type* Arg1Type = type_c_char_p;
|
||||||
static const Type Arg2Type[] = { TYPE(T_PTR), TYPE(T_CHAR|T_QUAL_CONST), TYPE(T_END) };
|
static const Type* Arg2Type = type_c_char_p;
|
||||||
|
|
||||||
ArgDesc Arg1, Arg2;
|
ArgDesc Arg1, Arg2;
|
||||||
unsigned ParamSize = 0;
|
unsigned ParamSize = 0;
|
||||||
@@ -983,8 +983,8 @@ static void StdFunc_strcpy (FuncDesc* F attribute ((unused)), ExprDesc* Expr)
|
|||||||
/* Handle the strcpy function */
|
/* Handle the strcpy function */
|
||||||
{
|
{
|
||||||
/* Argument types: (char*, const char*) */
|
/* Argument types: (char*, const char*) */
|
||||||
static const Type Arg1Type[] = { TYPE(T_PTR), TYPE(T_CHAR), TYPE(T_END) };
|
static const Type* Arg1Type = type_char_p;
|
||||||
static const Type Arg2Type[] = { TYPE(T_PTR), TYPE(T_CHAR|T_QUAL_CONST), TYPE(T_END) };
|
static const Type* Arg2Type = type_c_char_p;
|
||||||
|
|
||||||
ArgDesc Arg1, Arg2;
|
ArgDesc Arg1, Arg2;
|
||||||
unsigned ParamSize = 0;
|
unsigned ParamSize = 0;
|
||||||
@@ -1180,7 +1180,7 @@ ExitPoint:
|
|||||||
static void StdFunc_strlen (FuncDesc* F attribute ((unused)), ExprDesc* Expr)
|
static void StdFunc_strlen (FuncDesc* F attribute ((unused)), ExprDesc* Expr)
|
||||||
/* Handle the strlen function */
|
/* Handle the strlen function */
|
||||||
{
|
{
|
||||||
static const Type ArgType[] = { TYPE(T_PTR), TYPE(T_CHAR|T_QUAL_CONST), TYPE(T_END) };
|
static const Type* ArgType = type_c_char_p;
|
||||||
ExprDesc Arg;
|
ExprDesc Arg;
|
||||||
int IsArray;
|
int IsArray;
|
||||||
int IsPtr;
|
int IsPtr;
|
||||||
|
|||||||
Reference in New Issue
Block a user