Ignore:
Timestamp:
Jul 26, 2021, 2:42:34 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
0a061c0
Parents:
c86ee4c (diff), 98233b3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/prelude/builtins.c

    rc86ee4c rd83b266  
    1010// Created On       : Fri Jul 21 16:21:03 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Apr 13 17:26:32 2021
    13 // Update Count     : 117
     12// Last Modified On : Wed Jul 21 13:31:34 2021
     13// Update Count     : 129
    1414//
    1515
     
    7777// implicit increment, decrement if += defined, and implicit not if != defined
    7878
     79// C11 reference manual Section 6.5.16 (page101): "An assignment expression has the value of the left operand after the
     80// assignment, but is not an lvalue." Hence, return a value not a reference.
    7981static inline {
    80         forall( DT & | { DT & ?+=?( DT &, one_t ); } )
    81         DT & ++?( DT & x ) { return x += 1; }
     82        forall( T | { T ?+=?( T &, one_t ); } )
     83        T ++?( T & x ) { return x += 1; }
    8284
    83         forall( DT & | sized(DT) | { void ?{}( DT &, DT ); void ^?{}( DT & ); DT & ?+=?( DT &, one_t ); } )
    84         DT & ?++( DT & x ) { DT tmp = x; x += 1; return tmp; }
     85        forall( T | { T ?+=?( T &, one_t ); } )
     86        T ?++( T & x ) { T tmp = x; x += 1; return tmp; }
    8587
    86         forall( DT & | { DT & ?-=?( DT &, one_t ); } )
    87         DT & --?( DT & x ) { return x -= 1; }
     88        forall( T | { T ?-=?( T &, one_t ); } )
     89        T --?( T & x ) { return x -= 1; }
    8890
    89         forall( DT & | sized(DT) | { void ?{}( DT &, DT ); void ^?{}( DT & ); DT & ?-=?( DT &, one_t ); } )
    90         DT & ?--( DT & x ) { DT tmp = x; x -= 1; return tmp; }
     91        forall( T | { T ?-=?( T &, one_t ); } )
     92        T ?--( T & x ) { T tmp = x; x -= 1; return tmp; }
    9193
    92         forall( DT & | { int ?!=?( const DT &, zero_t ); } )
    93         int !?( const DT & x ) { return !( x != 0 ); }
     94        forall( T | { int ?!=?( T, zero_t ); } )
     95        int !?( T & x ) { return !( x != 0 ); }
    9496} // distribution
    9597
Note: See TracChangeset for help on using the changeset viewer.