Ignore:
Timestamp:
Apr 24, 2025, 6:35:41 PM (5 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
6b33e89, f85de47
Parents:
f632bd50
Message:

proofreading intro and background chapters, capitalize section titles, update backtick calls to regular calls

Location:
doc/theses/mike_brooks_MMath/programs
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/mike_brooks_MMath/programs/bkgd-carray-mdim.c

    rf632bd50 rb195498  
    1414
    1515int main() {
    16         float ar[3][10];
    17         static_assert( sizeof(float) == 4 );    $\C{// floats (atomic elements) are 4 bytes}$
    18         static_assert( sizeof(void*) == 8 );    $\C{// pointers are 8 bytes}$
     16        float mx[3][10];
     17        static_assert( sizeof(float) == 4 );    $\C[3.25in]{// floats (atomic elements) are 4 bytes}$
     18        static_assert( sizeof(void *) == 8 );   $\C{// pointers are 8 bytes}$
    1919
    20         static_assert( sizeof(ar) == 120 );             $\C{// the array, float[3][10]}$
    21         static_assert( sizeof(ar[0]) == 40 );   $\C{// its first element, float[10]}$
    22         static_assert( sizeof(ar[0][0]) == 4 ); $\C{// its first grand element, float}$
     20        static_assert( sizeof(mx) == 120 );             $\C{// the array, float[3][10]}$
     21        static_assert( sizeof(mx[0]) == 40 );   $\C{// its first element, float[10]}$
     22        static_assert( sizeof(mx[0][0]) == 4 ); $\C{// its first grand element, float}$
    2323
    24         static_assert( sizeof(&(ar)) == 8 );    $\C{// pointer to the array, float(*)[3][10]}$
    25         static_assert( sizeof(&(ar[0])) == 8 ); $\C{// pointer to its first element, float(*)[10]}$
    26         static_assert( sizeof(&(ar[0][0])) == 8 );      $\C{// pointer to its first grand-element, float*}$
     24        static_assert( sizeof(&(mx)) == 8 );    $\C{// pointer to the array, float(*)[3][10]}$
     25        static_assert( sizeof(&(mx[0])) == 8 ); $\C{// pointer to its first element, float(*)[10]}$
     26        static_assert( sizeof(&(mx[0][0])) == 8 );      $\C{// pointer to its first grand-element, float*}\CRT$
    2727
    28         float (*pa)[3][10] = &(ar);
    29         float (*pa0)[10] = &(ar[0]);
    30         float *pa00 = &(ar[0][0]);
     28        float (*pm)[3][10] = &(mx);
     29        float (*pm0)[10] = &(mx[0]);
     30        float *pm00 = &(mx[0][0]);
    3131
    32         static_assert( (void*)&ar == (void*)&(ar[0] ) );
    33         static_assert( (void*)&ar == (void*)&(ar[0][0]) );
     32        static_assert( (void *)&mx == (void *)&(mx[0] ) );
     33        static_assert( (void *)&mx == (void *)&(mx[0][0]) );
    3434
    35         assert( (void *) pa == (void *) pa0 );
    36         assert( (void *) pa == (void *) pa00 );
     35        assert( (void *) pm == (void *) pm0 );
     36        assert( (void *) pm == (void *) pm00 );
    3737
    3838//      float (*b[3])[10];
    39         float *b[3];
     39        float * b[3];
    4040        for (int i = 0; i < 3; i ++) {
    4141                b[i] = malloc(sizeof(float[10]));
    4242        }
    43         ar[2][3];
     43        mx[2][3];
    4444        b[2][3];
    4545/*
  • doc/theses/mike_brooks_MMath/programs/lst-features-intro.run.cfa

    rf632bd50 rb195498  
    5050
    5151
    52 while( req & cur = reqs`elems; cur`moveNext )
     52        while( req & cur = iter( reqs ); advance( cur ) )
    5353        printf("{%d %d} ", cur.pri, cur.rqr);
    5454printf("\n");
  • doc/theses/mike_brooks_MMath/programs/lst-features-multidir.run.cfa

    rf632bd50 rb195498  
    7979
    8080with(DLINK_VIA(req, req.by_pri)) {
    81         while( req & cur = reqs_pri_global`elems; cur`moveNext )
     81        while( req & cur = iter( reqs_pri_global ); advance( cur ) )
    8282                printf("{%d %d} ", cur.pri, cur.rqr);
    8383        printf("| ");
     
    8585
    8686with(DLINK_VIA(req, req.by_rqr)) {
    87         while( req & cur = reqs_rqr_42`elems; cur`moveNext )
     87        while( req & cur = iter( reqs_rqr_42 ); advance( cur ) )
    8888                printf("{%d %d} ", cur.pri, cur.rqr);
    8989        printf("| ");
    90         while( req & cur = reqs_rqr_17`elems; cur`moveNext )
     90        while( req & cur = iter( reqs_rqr_17 ); advance( cur ) )
    9191                printf("{%d %d} ", cur.pri, cur.rqr);
    9292        printf("| ");
    93         while( req & cur = reqs_rqr_99`elems; cur`moveNext )
     93        while( req & cur = iter( reqs_rqr_99 ); advance( cur ) )
    9494                printf("{%d %d} ", cur.pri, cur.rqr);
    9595        printf("\n");
Note: See TracChangeset for help on using the changeset viewer.