Changeset db19e1d for libcfa/prelude


Ignore:
Timestamp:
Sep 3, 2024, 12:08:09 PM (5 weeks ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
737bf73
Parents:
cdbb909
Message:

Changed the interpritation of () to be no parameters instead of any parameters. This had a lot of little changes because of this and some nearby clean-up. This includes some changes, including changing some generated functions to be fixed-args instead of variable-args, stripping out the place holder void parameter earlier, but it still shows up earlier in some cases that examine the parser directly. Also had to update the function generation tools. Have only tested with one --arch. Hopefully this all works out.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/prelude/prototypes.awk

    rcdbb909 rdb19e1d  
    103103
    104104        for ( prototype in prototypes ) {
    105                 # printf( "//\"%s\"\n", prototype )
    106105                if ( index( "BT_LAST", prototype ) == 1 ) {
    107106                        continue
     
    126125
    127126                # generate function parameter types as macro
    128                 if ( index( prototype, "VAR" ) != 2 ) {                 # C-style empty parameters ?
    129                         for ( p = 0; length( prototype ) > 0; p += 1 ) { # until all parameters types are removed
    130                                 sub( "_", "", prototype)                                # remove "_"
    131                                 printf( ", ", type )
    132                                 temp = prototype
    133                                 for ( t = 0; t < N; t += 1 ) {                  # find longest match
    134                                         type = types[t];
    135                                         if ( index( prototype, type ) == 1 ) { # found match
    136                                                 printf( "BT_%s", type )
    137                                                 sub( type, "", prototype )
    138                                                 break;
    139                                         } # if
    140                                 } # for
    141                                 if ( temp == prototype ) {                              # no match found for parameter in macro table
    142                                         printf( "\n********** MISSING TYPE \"%s\" **********\n", prototype )
    143                                         exit 0
     127                for ( p = 0; length( prototype ) > 0; p += 1 ) { # until all parameters types are removed
     128                        sub( "_", "", prototype)                                # remove "_"
     129                        printf( ", ", type )
     130                        temp = prototype
     131                        for ( t = 0; t < N; t += 1 ) {                  # find longest match
     132                                type = types[t];
     133                                if ( index( prototype, type ) == 1 ) { # found match
     134                                        printf( "BT_%s", type )
     135                                        sub( type, "", prototype )
     136                                        break;
    144137                                } # if
    145138                        } # for
    146                 } # if
     139                        if ( temp == prototype ) {                              # no match found for parameter in macro table
     140                                printf( "\n********** MISSING TYPE \"%s\" **********\n", prototype )
     141                                exit 0
     142                        } # if
     143                } # for
    147144                printf( ")\n" )
    148145        } # for
Note: See TracChangeset for help on using the changeset viewer.