Changeset 4040425 for src/libcfa


Ignore:
Timestamp:
Mar 2, 2016, 6:15:02 PM (8 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
36ebd03, b63e376
Parents:
8f610e85
Message:

change keyword type to otype and context to trait

Location:
src/libcfa
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/iostream

    r8f610e85 r4040425  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Mar  2 16:44:32 2016
    13 // Update Count     : 81
     12// Last Modified On : Wed Mar  2 18:05:27 2016
     13// Update Count     : 85
    1414//
    1515
     
    1919#include "iterator"
    2020
    21 context ostream( dtype ostype ) {
     21trait ostream( dtype ostype ) {
    2222        _Bool sepPrt( ostype * );
    2323        void sepOn( ostype * );
     
    3535};
    3636
    37 context writeable( type T ) {
     37trait writeable( otype T ) {
    3838        forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, T );
    3939};
     
    6969
    7070// writes the range [begin, end) to the given stream
    71 forall( type elt_type | writeable( elt_type ), type iterator_type | iterator( iterator_type, elt_type ), dtype os_type | ostream( os_type ) )
     71forall( otype elt_type | writeable( elt_type ), otype iterator_type | iterator( iterator_type, elt_type ), dtype os_type | ostream( os_type ) )
    7272void write( iterator_type begin, iterator_type end, os_type *os );
    7373
    74 forall( type elt_type | writeable( elt_type ), type iterator_type | iterator( iterator_type, elt_type ), dtype os_type | ostream( os_type ) )
     74forall( otype elt_type | writeable( elt_type ), otype iterator_type | iterator( iterator_type, elt_type ), dtype os_type | ostream( os_type ) )
    7575void write_reverse( iterator_type begin, iterator_type end, os_type *os );
    7676
    7777//---------------------------------------
    7878
    79 context istream( dtype istype ) {
     79trait istream( dtype istype ) {
    8080        int fail( istype * );
    8181        int eof( istype * );
     
    8787};
    8888
    89 context readable( type T ) {
     89trait readable( otype T ) {
    9090        forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, T );
    9191};
  • src/libcfa/iostream.c

    r8f610e85 r4040425  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Mar  2 16:20:57 2016
    13 // Update Count     : 207
     12// Last Modified On : Wed Mar  2 18:06:35 2016
     13// Update Count     : 208
    1414//
    1515
     
    185185//---------------------------------------
    186186
    187 forall( type elttype | writeable( elttype ), type iteratortype | iterator( iteratortype, elttype ), dtype ostype | ostream( ostype ) )
     187forall( otype elttype | writeable( elttype ), otype iteratortype | iterator( iteratortype, elttype ), dtype ostype | ostream( ostype ) )
    188188void write( iteratortype begin, iteratortype end, ostype *os ) {
    189189        void print( elttype i ) { os | i; }
     
    191191} // ?|?
    192192
    193 forall( type elttype | writeable( elttype ), type iteratortype | iterator( iteratortype, elttype ), dtype ostype | ostream( ostype ) )
     193forall( otype elttype | writeable( elttype ), otype iteratortype | iterator( iteratortype, elttype ), dtype ostype | ostream( ostype ) )
    194194void write_reverse( iteratortype begin, iteratortype end, ostype *os ) {
    195195        void print( elttype i ) { os | i; }
  • src/libcfa/iterator

    r8f610e85 r4040425  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jan 27 23:49:13 2016
    13 // Update Count     : 7
     12// Last Modified On : Wed Mar  2 18:06:05 2016
     13// Update Count     : 9
    1414//
    1515
     
    1818
    1919// An iterator can be used to traverse a data structure.
    20 context iterator( type iterator_type, type elt_type ) {
     20trait iterator( otype iterator_type, otype elt_type ) {
    2121        // point to the next element
    2222//      iterator_type ?++( iterator_type * );
     
    3232};
    3333
    34 context iterator_for( type iterator_type, type collection_type, type elt_type | iterator( iterator_type, elt_type ) ) {
     34trait iterator_for( otype iterator_type, otype collection_type, otype elt_type | iterator( iterator_type, elt_type ) ) {
    3535//      [ iterator_type begin, iterator_type end ] get_iterators( collection_type );
    3636        iterator_type begin( collection_type );
     
    3838};
    3939
    40 forall( type iterator_type, type elt_type | iterator( iterator_type, elt_type ) )
     40forall( otype iterator_type, otype elt_type | iterator( iterator_type, elt_type ) )
    4141void for_each( iterator_type begin, iterator_type end, void (*func)( elt_type ) );
    4242
    43 forall( type iterator_type, type elt_type | iterator( iterator_type, elt_type ) )
     43forall( otype iterator_type, otype elt_type | iterator( iterator_type, elt_type ) )
    4444void for_each_reverse( iterator_type begin, iterator_type end, void (*func)( elt_type ) );
    4545
  • src/libcfa/iterator.c

    r8f610e85 r4040425  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jan 26 17:16:07 2016
    13 // Update Count     : 26
     12// Last Modified On : Wed Mar  2 18:08:11 2016
     13// Update Count     : 27
    1414//
    1515
    1616#include "iterator"
    1717
    18 forall( type iterator_type, type elt_type | iterator( iterator_type, elt_type ) )
     18forall( otype iterator_type, otype elt_type | iterator( iterator_type, elt_type ) )
    1919void for_each( iterator_type begin, iterator_type end, void (*func)( elt_type ) ) {
    2020        for ( iterator_type i = begin; i != end; ++i ) {
     
    2323}
    2424
    25 forall( type iterator_type, type elt_type | iterator( iterator_type, elt_type ) )
     25forall( otype iterator_type, otype elt_type | iterator( iterator_type, elt_type ) )
    2626void for_each_reverse( iterator_type begin, iterator_type end, void (*func)( elt_type ) ) {
    2727        for ( iterator_type i = end; i != begin; ) {
  • src/libcfa/prelude.cf

    r8f610e85 r4040425  
     1# 2 "prelude.cf"  // needed for error messages from this file
    12//                               -*- Mode: C -*-
    23//
     
    89// Created On       : Sat Nov 29 07:23:41 2014
    910// Last Modified By : Peter A. Buhr
    10 // Last Modified On : Mon Jan  4 11:13:26 2016
    11 // Update Count     : 81
     11// Last Modified On : Wed Mar  2 18:03:41 2016
     12// Update Count     : 89
    1213//
    1314
     
    6364long double _Complex    ?--( long double _Complex * ),          ?--( volatile long double _Complex * );
    6465
    65 forall( type T ) T *                     ?++(                T ** );
    66 forall( type T ) const T *               ?++( const          T ** );
    67 forall( type T ) volatile T *            ?++(       volatile T ** );
    68 forall( type T ) const volatile T *      ?++( const volatile T ** );
    69 forall( type T ) T *                     ?--(                T ** );
    70 forall( type T ) const T *               ?--( const          T ** );
    71 forall( type T ) volatile T *            ?--(       volatile T ** );
    72 forall( type T ) const volatile T *      ?--( const volatile T ** );
    73 
    74 forall( type T ) lvalue T                ?[?](                T *,          ptrdiff_t );
    75 forall( type T ) const lvalue T          ?[?]( const          T *,          ptrdiff_t );
    76 forall( type T ) volatile lvalue T       ?[?](       volatile T *,          ptrdiff_t );
    77 forall( type T ) const volatile lvalue T ?[?]( const volatile T *,          ptrdiff_t );
    78 forall( type T ) lvalue T                ?[?](          ptrdiff_t,                T * );
    79 forall( type T ) const lvalue T          ?[?](          ptrdiff_t, const          T * );
    80 forall( type T ) volatile lvalue T       ?[?](          ptrdiff_t,       volatile T * );
    81 forall( type T ) const volatile lvalue T ?[?](          ptrdiff_t, const volatile T * );
     66forall( otype T ) T *                    ?++(                T ** );
     67forall( otype T ) const T *              ?++( const          T ** );
     68forall( otype T ) volatile T *           ?++(       volatile T ** );
     69forall( otype T ) const volatile T *     ?++( const volatile T ** );
     70forall( otype T ) T *                    ?--(                T ** );
     71forall( otype T ) const T *              ?--( const          T ** );
     72forall( otype T ) volatile T *           ?--(       volatile T ** );
     73forall( otype T ) const volatile T *     ?--( const volatile T ** );
     74
     75forall( otype T ) lvalue T               ?[?](                T *,          ptrdiff_t );
     76forall( otype T ) const lvalue T         ?[?]( const          T *,          ptrdiff_t );
     77forall( otype T ) volatile lvalue T      ?[?](       volatile T *,          ptrdiff_t );
     78forall( otype T ) const volatile lvalue T ?[?]( const volatile T *,         ptrdiff_t );
     79forall( otype T ) lvalue T               ?[?](          ptrdiff_t,                T * );
     80forall( otype T ) const lvalue T         ?[?](          ptrdiff_t, const          T * );
     81forall( otype T ) volatile lvalue T      ?[?](          ptrdiff_t,       volatile T * );
     82forall( otype T ) const volatile lvalue T ?[?](         ptrdiff_t, const volatile T * );
    8283
    8384// ------------------------------------------------------------
     
    101102long double _Complex    ++?( long double _Complex * ),          --?( long double _Complex * );
    102103
    103 forall( type T ) T *                     ++?(                T ** );
    104 forall( type T ) const T *               ++?( const          T ** );
    105 forall( type T ) volatile T *            ++?(       volatile T ** );
    106 forall( type T ) const volatile T *      ++?( const volatile T ** );
    107 forall( type T ) T *                     --?(                T ** );
    108 forall( type T ) const T *               --?( const          T ** );
    109 forall( type T ) volatile T *            --?(       volatile T ** );
    110 forall( type T ) const volatile T *      --?( const volatile T ** );
    111 
    112 forall( type T ) lvalue T                *?(                 T * );
    113 forall( type T ) const lvalue T          *?( const           T * );
    114 forall( type T ) volatile lvalue T       *?(       volatile  T * );
    115 forall( type T ) const volatile lvalue T *?( const volatile  T * );
     104forall( otype T ) T *                    ++?(                T ** );
     105forall( otype T ) const T *              ++?( const          T ** );
     106forall( otype T ) volatile T *           ++?(       volatile T ** );
     107forall( otype T ) const volatile T *     ++?( const volatile T ** );
     108forall( otype T ) T *                    --?(                T ** );
     109forall( otype T ) const T *              --?( const          T ** );
     110forall( otype T ) volatile T *           --?(       volatile T ** );
     111forall( otype T ) const volatile T *     --?( const volatile T ** );
     112
     113forall( otype T ) lvalue T               *?(                 T * );
     114forall( otype T ) const lvalue T                 *?( const           T * );
     115forall( otype T ) volatile lvalue T      *?(       volatile  T * );
     116forall( otype T ) const volatile lvalue T *?( const volatile  T * );
    116117forall( ftype FT ) lvalue FT             *?( FT * );
    117118
     
    183184long double _Complex    ?+?( long double _Complex, long double _Complex ),      ?-?( long double _Complex, long double _Complex );
    184185
    185 forall( type T ) T *                    ?+?(                T *,          ptrdiff_t );
    186 forall( type T ) T *                    ?+?(          ptrdiff_t,                T * );
    187 forall( type T ) const T *              ?+?( const          T *,          ptrdiff_t );
    188 forall( type T ) const T *              ?+?(          ptrdiff_t, const          T * );
    189 forall( type T ) volatile T *           ?+?(       volatile T *,          ptrdiff_t );
    190 forall( type T ) volatile T *           ?+?(          ptrdiff_t,       volatile T * );
    191 forall( type T ) const volatile T *     ?+?( const volatile T *,          ptrdiff_t );
    192 forall( type T ) const volatile T *     ?+?(          ptrdiff_t, const volatile T * );
    193 forall( type T ) T *                    ?-?(                T *,          ptrdiff_t );
    194 forall( type T ) const T *              ?-?( const          T *,          ptrdiff_t );
    195 forall( type T ) volatile T *           ?-?(       volatile T *,          ptrdiff_t );
    196 forall( type T ) const volatile T *     ?-?( const volatile T *,          ptrdiff_t );
    197 forall( type T ) ptrdiff_t              ?-?( const volatile T *, const volatile T * );
     186forall( otype T ) T *                   ?+?(                T *,          ptrdiff_t );
     187forall( otype T ) T *                   ?+?(          ptrdiff_t,                T * );
     188forall( otype T ) const T *             ?+?( const          T *,          ptrdiff_t );
     189forall( otype T ) const T *             ?+?(          ptrdiff_t, const          T * );
     190forall( otype T ) volatile T *          ?+?(       volatile T *,          ptrdiff_t );
     191forall( otype T ) volatile T *          ?+?(          ptrdiff_t,       volatile T * );
     192forall( otype T ) const volatile T *    ?+?( const volatile T *,          ptrdiff_t );
     193forall( otype T ) const volatile T *    ?+?(          ptrdiff_t, const volatile T * );
     194forall( otype T ) T *                   ?-?(                T *,          ptrdiff_t );
     195forall( otype T ) const T *             ?-?( const          T *,          ptrdiff_t );
     196forall( otype T ) volatile T *          ?-?(       volatile T *,          ptrdiff_t );
     197forall( otype T ) const volatile T *    ?-?( const volatile T *,          ptrdiff_t );
     198forall( otype T ) ptrdiff_t             ?-?( const volatile T *, const volatile T * );
    198199
    199200// ------------------------------------------------------------
     
    431432forall( ftype FT ) FT *                 ?=?( FT * volatile *, forall( ftype FT2 ) FT2 * );
    432433
    433 forall( type T ) T *                    ?+=?(                T *          *, ptrdiff_t );
    434 forall( type T ) T *                    ?+=?(                T * volatile *, ptrdiff_t );
    435 forall( type T ) const T *              ?+=?( const          T *          *, ptrdiff_t );
    436 forall( type T ) const T *              ?+=?( const          T * volatile *, ptrdiff_t );
    437 forall( type T ) volatile T *           ?+=?(       volatile T *          *, ptrdiff_t );
    438 forall( type T ) volatile T *           ?+=?(       volatile T * volatile *, ptrdiff_t );
    439 forall( type T ) const volatile T *     ?+=?( const volatile T *          *, ptrdiff_t );
    440 forall( type T ) const volatile T *     ?+=?( const volatile T * volatile *, ptrdiff_t );
    441 forall( type T ) T *                    ?-=?(                T *          *, ptrdiff_t );
    442 forall( type T ) T *                    ?-=?(                T * volatile *, ptrdiff_t );
    443 forall( type T ) const T *              ?-=?( const          T *          *, ptrdiff_t );
    444 forall( type T ) const T *              ?-=?( const          T * volatile *, ptrdiff_t );
    445 forall( type T ) volatile T *           ?-=?(       volatile T *          *, ptrdiff_t );
    446 forall( type T ) volatile T *           ?-=?(       volatile T * volatile *, ptrdiff_t );
    447 forall( type T ) const volatile T *     ?-=?( const volatile T *          *, ptrdiff_t );
    448 forall( type T ) const volatile T *     ?-=?( const volatile T * volatile *, ptrdiff_t );
     434forall( otype T ) T *                   ?+=?(                T *          *, ptrdiff_t );
     435forall( otype T ) T *                   ?+=?(                T * volatile *, ptrdiff_t );
     436forall( otype T ) const T *             ?+=?( const          T *          *, ptrdiff_t );
     437forall( otype T ) const T *             ?+=?( const          T * volatile *, ptrdiff_t );
     438forall( otype T ) volatile T *          ?+=?(       volatile T *          *, ptrdiff_t );
     439forall( otype T ) volatile T *          ?+=?(       volatile T * volatile *, ptrdiff_t );
     440forall( otype T ) const volatile T *    ?+=?( const volatile T *          *, ptrdiff_t );
     441forall( otype T ) const volatile T *    ?+=?( const volatile T * volatile *, ptrdiff_t );
     442forall( otype T ) T *                   ?-=?(                T *          *, ptrdiff_t );
     443forall( otype T ) T *                   ?-=?(                T * volatile *, ptrdiff_t );
     444forall( otype T ) const T *             ?-=?( const          T *          *, ptrdiff_t );
     445forall( otype T ) const T *             ?-=?( const          T * volatile *, ptrdiff_t );
     446forall( otype T ) volatile T *          ?-=?(       volatile T *          *, ptrdiff_t );
     447forall( otype T ) volatile T *          ?-=?(       volatile T * volatile *, ptrdiff_t );
     448forall( otype T ) const volatile T *    ?-=?( const volatile T *          *, ptrdiff_t );
     449forall( otype T ) const volatile T *    ?-=?( const volatile T * volatile *, ptrdiff_t );
    449450
    450451_Bool                   ?=?( _Bool *, _Bool ),                                  ?=?( volatile _Bool *, _Bool );
  • src/libcfa/stdlib

    r8f610e85 r4040425  
    1010// Created On       : Thu Jan 28 17:12:35 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Mar  2 16:52:25 2016
    13 // Update Count     : 63
     12// Last Modified On : Wed Mar  2 17:38:21 2016
     13// Update Count     : 64
    1414//
    1515
     
    2020} // extern "C"
    2121
    22 forall( type T ) T * memset( T * ptr, unsigned char fill ); // use default value '\0' for fill
    23 forall( type T ) T * memset( T * ptr );                                 // remove when default value available
     22forall( otype T ) T * memset( T * ptr, unsigned char fill ); // use default value '\0' for fill
     23forall( otype T ) T * memset( T * ptr );                                        // remove when default value available
    2424
    25 forall( type T ) T * malloc( void );
    26 forall( type T ) T * malloc( char fill );
    27 forall( type T ) T * malloc( T * ptr, size_t size );
    28 forall( type T ) T * malloc( T * ptr, size_t size, unsigned char fill );
    29 forall( type T ) T * calloc( size_t size );
    30 forall( type T ) T * realloc( T * ptr, size_t size );
    31 forall( type T ) T * realloc( T * ptr, size_t size, unsigned char fill );
     25forall( otype T ) T * malloc( void );
     26forall( otype T ) T * malloc( char fill );
     27forall( otype T ) T * malloc( T * ptr, size_t size );
     28forall( otype T ) T * malloc( T * ptr, size_t size, unsigned char fill );
     29forall( otype T ) T * calloc( size_t size );
     30forall( otype T ) T * realloc( T * ptr, size_t size );
     31forall( otype T ) T * realloc( T * ptr, size_t size, unsigned char fill );
    3232
    33 forall( type T ) T * aligned_alloc( size_t alignment );
    34 forall( type T ) T * memalign( size_t alignment );              // deprecated
    35 forall( type T ) int posix_memalign( T ** ptr, size_t alignment );
     33forall( otype T ) T * aligned_alloc( size_t alignment );
     34forall( otype T ) T * memalign( size_t alignment );             // deprecated
     35forall( otype T ) int posix_memalign( T ** ptr, size_t alignment );
    3636
    3737//---------------------------------------
     
    6565//---------------------------------------
    6666
    67 forall( type T | { int ?<?( T, T ); } )
     67forall( otype T | { int ?<?( T, T ); } )
    6868T * bsearch( const T key, const T * arr, size_t dimension );
    6969
    70 forall( type T | { int ?<?( T, T ); } )
     70forall( otype T | { int ?<?( T, T ); } )
    7171void qsort( const T * arr, size_t dimension );
    7272
    7373//---------------------------------------
    7474
    75 forall( type T | { T ?/?( T, T ); T ?%?( T, T ); } )
     75forall( otype T | { T ?/?( T, T ); T ?%?( T, T ); } )
    7676[ T, T ] div( T t1, T t2 );
    7777
     
    107107//---------------------------------------
    108108
    109 forall( type T | { int ?<?( T, T ); } )
     109forall( otype T | { int ?<?( T, T ); } )
    110110T min( const T t1, const T t2 );
    111111
    112 forall( type T | { int ?>?( T, T ); } )
     112forall( otype T | { int ?>?( T, T ); } )
    113113T max( const T t1, const T t2 );
    114114
    115 forall( type T )
     115forall( otype T )
    116116void swap( T * t1, T * t2 );
    117117
  • src/libcfa/stdlib.c

    r8f610e85 r4040425  
    1010// Created On       : Thu Jan 28 17:10:29 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Feb 23 21:02:54 2016
    13 // Update Count     : 142
     12// Last Modified On : Wed Mar  2 17:38:47 2016
     13// Update Count     : 143
    1414//
    1515
     
    2727} // extern "C"
    2828
    29 forall( type T ) T * memset( T * ptr, unsigned char fill ) { // use default value '\0' for fill
     29forall( otype T ) T * memset( T * ptr, unsigned char fill ) { // use default value '\0' for fill
    3030        printf( "memset1\n" );
    3131    return (T *)memset( ptr, (int)fill, malloc_usable_size( ptr ) );
    3232} // memset
    33 forall( type T ) T * memset( T * ptr ) {                                // remove when default value available
     33forall( otype T ) T * memset( T * ptr ) {                               // remove when default value available
    3434        printf( "memset2\n" );
    3535    return (T *)memset( ptr, 0, malloc_usable_size( ptr ) );
    3636} // memset
    3737
    38 forall( type T ) T * malloc( void ) {
     38forall( otype T ) T * malloc( void ) {
    3939        printf( "malloc1\n" );
    4040    return (T *)malloc( sizeof(T) );
    4141} // malloc
    42 forall( type T ) T * malloc( size_t size ) {
     42forall( otype T ) T * malloc( size_t size ) {
    4343        printf( "malloc2\n" );
    4444    return (T *)(void *)malloc( size );
    4545} // malloc
    46 forall( type T ) T * malloc( char fill ) {
     46forall( otype T ) T * malloc( char fill ) {
    4747        printf( "malloc3\n" );
    4848        T * ptr = (T *)malloc( sizeof(T) );
     
    5050} // malloc
    5151
    52 forall( type T ) T * calloc( size_t size ) {
     52forall( otype T ) T * calloc( size_t size ) {
    5353        printf( "calloc\n" );
    5454    return (T *)calloc( size, sizeof(T) );
    5555} // calloc
    5656
    57 forall( type T ) T * realloc( T * ptr, size_t size ) {
     57forall( otype T ) T * realloc( T * ptr, size_t size ) {
    5858        printf( "realloc1\n" );
    5959    return (T *)(void *)realloc( (void *)ptr, size );
    6060} // realloc
    61 forall( type T ) T * realloc( T * ptr, size_t size, unsigned char fill ) {
     61forall( otype T ) T * realloc( T * ptr, size_t size, unsigned char fill ) {
    6262        printf( "realloc2\n" );
    6363    char * nptr = (T *)(void *)realloc( (void *)ptr, size );
     
    6767} // realloc
    6868
    69 forall( type T ) T * malloc( T * ptr, size_t size ) {
     69forall( otype T ) T * malloc( T * ptr, size_t size ) {
    7070        printf( "malloc4\n" );
    7171    return (T *)realloc( ptr, size );
    7272} // malloc
    73 forall( type T ) T * malloc( T * ptr, size_t size, unsigned char fill ) {
     73forall( otype T ) T * malloc( T * ptr, size_t size, unsigned char fill ) {
    7474        printf( "malloc5\n" );
    7575    return (T *)realloc( ptr, size, fill );
    7676} // malloc
    7777
    78 forall( type T ) T * aligned_alloc( size_t alignment ) {
     78forall( otype T ) T * aligned_alloc( size_t alignment ) {
    7979        printf( "aligned_alloc\n" );
    8080    return (T *)memalign( alignment, sizeof(T) );
    8181} // aligned_alloc
    8282
    83 forall( type T ) T * memalign( size_t alignment ) {
     83forall( otype T ) T * memalign( size_t alignment ) {
    8484        printf( "memalign\n" );
    8585    return (T *)memalign( alignment, sizeof(T) );
    8686} // memalign
    8787
    88 forall( type T ) int posix_memalign( T ** ptr, size_t alignment ) {
     88forall( otype T ) int posix_memalign( T ** ptr, size_t alignment ) {
    8989        printf( "posix_memalign\n" );
    9090    return posix_memalign( (void **)ptr, alignment, sizeof(T) );
     
    212212//---------------------------------------
    213213
    214 forall( type T | { int ?<?( T, T ); } )
     214forall( otype T | { int ?<?( T, T ); } )
    215215T * bsearch( const T key, const T * arr, size_t dimension ) {
    216216        int comp( const void * t1, const void * t2 ) { return *(T *)t1 < *(T *)t2 ? -1 : *(T *)t2 < *(T *)t1 ? 1 : 0; }
     
    218218} // bsearch
    219219
    220 forall( type T | { int ?<?( T, T ); } )
     220forall( otype T | { int ?<?( T, T ); } )
    221221void qsort( const T * arr, size_t dimension ) {
    222222        int comp( const void * t1, const void * t2 ) { return *(T *)t1 < *(T *)t2 ? -1 : *(T *)t2 < *(T *)t1 ? 1 : 0; }
     
    226226//---------------------------------------
    227227
    228 forall( type T | { T ?/?( T, T ); T ?%?( T, T ); } )
     228forall( otype T | { T ?/?( T, T ); T ?%?( T, T ); } )
    229229[ T, T ] div( T t1, T t2 ) { /* return [ t1 / t2, t1 % t2 ]; */ }
    230230
     
    257257//---------------------------------------
    258258
    259 forall( type T | { int ?<?( T, T ); } )
     259forall( otype T | { int ?<?( T, T ); } )
    260260T min( const T t1, const T t2 ) {
    261261        return t1 < t2 ? t1 : t2;
    262262} // min
    263263
    264 forall( type T | { int ?>?( T, T ); } )
     264forall( otype T | { int ?>?( T, T ); } )
    265265T max( const T t1, const T t2 ) {
    266266        return t1 > t2 ? t1 : t2;
    267267} // max
    268268
    269 forall( type T )
     269forall( otype T )
    270270void swap( T * t1, T * t2 ) {
    271271        T temp = *t1;
Note: See TracChangeset for help on using the changeset viewer.