mirror of
				https://github.com/eledio-devices/thirdparty-tinyexpr.git
				synced 2025-10-31 08:42:39 +01:00 
			
		
		
		
	Make the te_expr struct valid C++ code.
This commit is contained in:
		| @@ -66,7 +66,7 @@ typedef struct state { | |||||||
| static te_expr *new_expr(const int type, const te_expr *parameters[]) { | static te_expr *new_expr(const int type, const te_expr *parameters[]) { | ||||||
|     const int arity = ARITY(type); |     const int arity = ARITY(type); | ||||||
|     const int psize = sizeof(void*) * arity; |     const int psize = sizeof(void*) * arity; | ||||||
|     const int size = sizeof(te_expr) + psize + (IS_CLOSURE(type) ? sizeof(void*) : 0); |     const int size = (sizeof(te_expr) - sizeof(void*)) + psize + (IS_CLOSURE(type) ? sizeof(void*) : 0); | ||||||
|     te_expr *ret = malloc(size); |     te_expr *ret = malloc(size); | ||||||
|     memset(ret, 0, size); |     memset(ret, 0, size); | ||||||
|     if (arity && parameters) { |     if (arity && parameters) { | ||||||
|   | |||||||
| @@ -35,7 +35,7 @@ extern "C" { | |||||||
| typedef struct te_expr { | typedef struct te_expr { | ||||||
|     int type; |     int type; | ||||||
|     union {double value; const double *bound; const void *function;}; |     union {double value; const double *bound; const void *function;}; | ||||||
|     void *parameters[]; |     void *parameters[1]; | ||||||
| } te_expr; | } te_expr; | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user