66
77/* Test: test_increment_int */
88
9- EXPORT void increment_int (int * ptr ) {
9+ EXPORT void increment_int (int32_t * ptr ) {
1010 * ptr += 1 ;
1111}
1212
1313/* Test: test_init_int */
1414
15- EXPORT void init_int (int * ptr , int val ) {
15+ EXPORT void init_int (int32_t * ptr , int32_t val ) {
1616 * ptr = val ;
1717}
1818
1919/* Test: test_init_array */
2020
21- EXPORT void init_array (int * array , size_t len , int val ) {
21+ EXPORT void init_array (int32_t * array , size_t len , int32_t val ) {
2222 for (size_t i = 0 ; i < len ; i ++ ) {
2323 array [i ] = val ;
2424 }
@@ -27,83 +27,83 @@ EXPORT void init_array(int *array, size_t len, int val) {
2727/* Test: test_init_static_inner */
2828
2929typedef struct SyncPtr {
30- int * ptr ;
30+ int32_t * ptr ;
3131} SyncPtr ;
3232
33- EXPORT void init_static_inner (const SyncPtr * s_ptr , int val ) {
33+ EXPORT void init_static_inner (const SyncPtr * s_ptr , int32_t val ) {
3434 * (s_ptr -> ptr ) = val ;
3535}
3636
3737/* Tests: test_exposed, test_pass_dangling */
3838
39- EXPORT void ignore_ptr (__attribute__((unused )) const int * ptr ) {
39+ EXPORT void ignore_ptr (__attribute__((unused )) const int32_t * ptr ) {
4040 return ;
4141}
4242
4343/* Test: test_expose_int */
44- EXPORT void expose_int (const int * int_ptr , const int * * pptr ) {
44+ EXPORT void expose_int (const int32_t * int_ptr , const int32_t * * pptr ) {
4545 * pptr = int_ptr ;
4646}
4747
4848/* Test: test_swap_ptr */
4949
50- EXPORT void swap_ptr (const int * * pptr0 , const int * * pptr1 ) {
51- const int * tmp = * pptr0 ;
50+ EXPORT void swap_ptr (const int32_t * * pptr0 , const int32_t * * pptr1 ) {
51+ const int32_t * tmp = * pptr0 ;
5252 * pptr0 = * pptr1 ;
5353 * pptr1 = tmp ;
5454}
5555
5656/* Test: test_swap_ptr_tuple */
5757
5858typedef struct Tuple {
59- int * ptr0 ;
60- int * ptr1 ;
59+ int32_t * ptr0 ;
60+ int32_t * ptr1 ;
6161} Tuple ;
6262
6363EXPORT void swap_ptr_tuple (Tuple * t_ptr ) {
64- int * tmp = t_ptr -> ptr0 ;
64+ int32_t * tmp = t_ptr -> ptr0 ;
6565 t_ptr -> ptr0 = t_ptr -> ptr1 ;
6666 t_ptr -> ptr1 = tmp ;
6767}
6868
6969/* Test: test_overwrite_dangling */
7070
71- EXPORT void overwrite_ptr (const int * * pptr ) {
71+ EXPORT void overwrite_ptr (const int32_t * * pptr ) {
7272 * pptr = NULL ;
7373}
7474
7575/* Test: test_swap_ptr_triple_dangling */
7676
7777typedef struct Triple {
78- int * ptr0 ;
79- int * ptr1 ;
80- int * ptr2 ;
78+ int32_t * ptr0 ;
79+ int32_t * ptr1 ;
80+ int32_t * ptr2 ;
8181} Triple ;
8282
8383EXPORT void swap_ptr_triple_dangling (Triple * t_ptr ) {
84- int * tmp = t_ptr -> ptr0 ;
84+ int32_t * tmp = t_ptr -> ptr0 ;
8585 t_ptr -> ptr0 = t_ptr -> ptr2 ;
8686 t_ptr -> ptr2 = tmp ;
8787}
8888
89- EXPORT const int * return_ptr (const int * ptr ) {
89+ EXPORT const int32_t * return_ptr (const int32_t * ptr ) {
9090 return ptr ;
9191}
9292
9393/* Test: test_pass_ptr_as_int */
9494
95- EXPORT void pass_ptr_as_int (uintptr_t ptr , int set_to_val ) {
96- * (int * )ptr = set_to_val ;
95+ EXPORT void pass_ptr_as_int (uintptr_t ptr , int32_t set_to_val ) {
96+ * (int32_t * )ptr = set_to_val ;
9797}
9898
9999/* Test: test_pass_ptr_via_previously_shared_mem */
100100
101- int * * shared_place ;
101+ int32_t * * shared_place ;
102102
103- EXPORT void set_shared_mem (int * * ptr ) {
103+ EXPORT void set_shared_mem (int32_t * * ptr ) {
104104 shared_place = ptr ;
105105}
106106
107- EXPORT void init_ptr_stored_in_shared_mem (int val ) {
107+ EXPORT void init_ptr_stored_in_shared_mem (int32_t val ) {
108108 * * shared_place = val ;
109109}
0 commit comments