Mercurial > pub > dyncall > dyncall
diff test/call_suite/globals.c @ 436:23b12c7ad462
- call_suite cleanup (no change in functionality): removal of unused decl, freeing memory at end, func renaming for clarity, static for tu-local symbols, ...
author | Tassilo Philipp |
---|---|
date | Wed, 26 Jan 2022 11:37:57 +0100 |
parents | 8e22b70d3ee4 |
children | 94c7904977aa |
line wrap: on
line diff
--- a/test/call_suite/globals.c Mon Jan 24 12:41:27 2022 +0100 +++ b/test/call_suite/globals.c Wed Jan 26 11:37:57 2022 +0100 @@ -6,7 +6,7 @@ Description: License: - Copyright (c) 2011-2018 Daniel Adler <dadler@uni-goettingen.de>, + Copyright (c) 2011-2022 Daniel Adler <dadler@uni-goettingen.de>, Tassilo Philipp <tphilipp@potion-studios.com> Permission to use, copy, modify, and distribute this software for any @@ -31,9 +31,9 @@ DEF_TYPES #undef X -double rand_d() { return ( ( (double) rand() ) / ( (double) RAND_MAX ) ); } +static double rand_d() { return ( ( (double) rand() ) / ( (double) RAND_MAX ) ); } -void init_K() +void init_test_data() { int i; #define X(CH,T) V_##CH = (T*) malloc(sizeof(T)*(G_maxargs+1)); K_##CH = (T*) malloc(sizeof(T)*(G_maxargs+1)); @@ -61,3 +61,9 @@ } } +void deinit_test_data() +{ +#define X(CH,T) free(V_##CH); free(K_##CH); +DEF_TYPES +#undef X +}