MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / new_expr

Function new_expr

extern/tinyexpr/tinyexpr.c:84–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82#define NEW_EXPR(type, ...) new_expr((type), (const te_expr*[]){__VA_ARGS__})
83
84static te_expr *new_expr(const int type, const te_expr *parameters[]) {
85 const int arity = ARITY(type);
86 const int psize = sizeof(void*) * arity;
87 const int size = (sizeof(te_expr) - sizeof(void*)) + psize + (IS_CLOSURE(type) ? sizeof(void*) : 0);
88 te_expr *ret = malloc(size);
89 memset(ret, 0, size);
90 if (arity && parameters) {
91 memcpy(ret->parameters, parameters, psize);
92 }
93 ret->type = type;
94 ret->bound = 0;
95 return ret;
96}
97
98
99void te_free_parameters(te_expr *n) {

Callers 1

baseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected