Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tests/init_once.c

    r2afec66 r72e9222  
    6060        return -1;
    6161}
    62 void ?{}(array & arr) {
    63         memset(arr.elems, 0, sizeof(arr.elems));
    64         arr.length = 0;
     62void ?{}(array * arr) {
     63        memset(arr->elems, 0, sizeof(arr->elems));
     64        arr->length = 0;
    6565}
    6666array constructed;
    6767array destructed;
    6868
    69 void ?{}(init_once & x) {
    70         assert( find( &constructed, &x ) == -1 );
    71         remove( &destructed, &x );
    72         insert( &constructed, &x );
     69void ?{}(init_once * x) {
     70        assert( find( &constructed, x ) == -1 );
     71        remove( &destructed, x );
     72        insert( &constructed, x );
    7373
    74         x.x = malloc(sizeof(int));
     74        x->x = malloc(sizeof(int));
    7575}
    7676
    77 void ?{}(init_once & x, init_once other) {
     77void ?{}(init_once * x, init_once other) {
    7878        x{};  // reuse default ctor
    7979}
    8080
    81 void ^?{}(init_once & x) {
    82         assert( find( &destructed, &x ) == -1 );
    83         remove( &constructed, &x );
    84         insert( &destructed, &x );
     81void ^?{}(init_once * x) {
     82        assert( find( &destructed, x ) == -1 );
     83        remove( &constructed, x );
     84        insert( &destructed, x );
    8585
    86         free(x.x);
     86        free(x->x);
    8787}
    8888//*** end setup
     
    125125                                init_once x;
    126126                                init_once y = x;
    127                                 x{}; // ensure this doesn't execute
     127                                (&x) {}; // ensure this doesn't execute
    128128                                break;
    129129                        }
Note: See TracChangeset for help on using the changeset viewer.