Changeset fd061ed3


Ignore:
Timestamp:
Feb 28, 2017, 1:49:12 PM (7 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
14f6bb39
Parents:
31868da (diff), cc7f4b1 (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

Files:
1 deleted
16 edited

Legend:

Unmodified
Added
Removed
  • Jenkinsfile

    r31868da rfd061ed3  
    173173
    174174def notify_server() {
    175         sh 'curl --silent -X POST http://plg2:8082/jenkins/notify > /dev/null'
     175        sh 'curl --silent -X POST http://plg2:8082/jenkins/notify > /dev/null || true'
    176176        return
    177177}
     
    320320
    321321                //Then publish the results
    322                 sh 'curl --silent --data @bench.csv http://plg2:8082/jenkins/publish > /dev/null'
     322                sh 'curl --silent --data @bench.csv http://plg2:8082/jenkins/publish > /dev/null || true'
    323323}
    324324
  • src/Parser/DeclarationNode.cc

    r31868da rfd061ed3  
    1010// Created On       : Sat May 16 12:34:05 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb 23 15:45:02 2017
    13 // Update Count     : 759
     12// Last Modified On : Thu Feb 23 22:21:06 2017
     13// Update Count     : 775
    1414//
    1515
     
    607607                                        type->aggInst.aggregate = o->type;
    608608                                        if ( o->type->kind == TypeData::Aggregate ) {
     609                                                type->aggInst.hoistType = o->type->aggregate.body;
    609610                                                type->aggInst.params = maybeClone( o->type->aggregate.actuals );
     611                                        } else {
     612                                                type->aggInst.hoistType = o->type->enumeration.body;
    610613                                        } // if
    611614                                        type->qualifiers |= o->type->qualifiers;
     
    881884                                newType->aggInst.aggregate->aggregate.fields = nullptr;
    882885                        } // if
     886                        // don't hoist twice
     887                        newType->aggInst.hoistType = false;
    883888                } // if
    884889
     
    941946        SemanticError errors;
    942947        std::back_insert_iterator< std::list< DeclarationWithType * > > out( outputList );
    943        
     948
    944949        for ( const DeclarationNode * cur = firstNode; cur; cur = dynamic_cast< DeclarationNode * >( cur->get_next() ) ) {
    945950                try {
     
    953958                                        auto obj = new ObjectDecl( "", DeclarationNode::NoStorageClass, linkage, nullptr, inst, nullptr );
    954959                                        obj->location = cur->location;
    955                                         * out++ = obj; 
     960                                        * out++ = obj;
    956961                                        delete agg;
    957962                                } else if ( UnionDecl * agg = dynamic_cast< UnionDecl * >( decl ) ) {
     
    10351040
    10361041        switch ( type->kind ) {
    1037           case TypeData::Enum: {
    1038                   if ( type->enumeration.body ) {
    1039                           EnumDecl * typedecl = buildEnum( type, attributes );
    1040                           return new EnumInstType( buildQualifiers( type ), typedecl );
    1041                   } else {
    1042                           return new EnumInstType( buildQualifiers( type ), *type->enumeration.name );
    1043                   }
    1044           }
     1042          case TypeData::Enum:
    10451043          case TypeData::Aggregate: {
    1046                   ReferenceToType * ret;
    1047                   if ( type->aggregate.body ) {
    1048                           AggregateDecl * typedecl = buildAggregate( type, attributes );
    1049                           switch ( type->aggregate.kind ) {
    1050                                 case DeclarationNode::Struct:
    1051                                   ret = new StructInstType( buildQualifiers( type ), (StructDecl *)typedecl );
    1052                                   break;
    1053                                 case DeclarationNode::Union:
    1054                                   ret = new UnionInstType( buildQualifiers( type ), (UnionDecl *)typedecl );
    1055                                   break;
    1056                                 case DeclarationNode::Trait:
    1057                                   assert( false );
    1058                                   //ret = new TraitInstType( buildQualifiers( type ), (TraitDecl *)typedecl );
    1059                                   break;
    1060                                 default:
    1061                                   assert( false );
    1062                           } // switch
    1063                   } else {
    1064                           switch ( type->aggregate.kind ) {
    1065                                 case DeclarationNode::Struct:
    1066                                   ret = new StructInstType( buildQualifiers( type ), *type->aggregate.name );
    1067                                   break;
    1068                                 case DeclarationNode::Union:
    1069                                   ret = new UnionInstType( buildQualifiers( type ), *type->aggregate.name );
    1070                                   break;
    1071                                 case DeclarationNode::Trait:
    1072                                   assert( false );
    1073                                   //ret = new TraitInstType( buildQualifiers( type ), (TraitDecl *)typedecl );
    1074                                   break;
    1075                                 default:
    1076                                   assert( false );
    1077                           } // switch
    1078                   } // if
     1044                  ReferenceToType * ret = buildComAggInst( type, attributes );
    10791045                  buildList( type->aggregate.actuals, ret->get_parameters() );
    10801046                  return ret;
  • src/Parser/ParseNode.h

    r31868da rfd061ed3  
    109109        ExpressionNode( const ExpressionNode &other );
    110110        virtual ~ExpressionNode() {}
    111         virtual ExpressionNode * clone() const { return expr ? new ExpressionNode( expr->clone() ) : nullptr; }
     111        virtual ExpressionNode * clone() const override { return expr ? new ExpressionNode( expr->clone() ) : nullptr; }
    112112
    113113        bool get_extension() const { return extension; }
     
    259259        DeclarationNode();
    260260        ~DeclarationNode();
    261         DeclarationNode * clone() const;
     261        DeclarationNode * clone() const override;
    262262
    263263        DeclarationNode * addQualifiers( DeclarationNode * );
  • src/Parser/TypeData.cc

    r31868da rfd061ed3  
    1010// Created On       : Sat May 16 15:12:51 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb 23 16:26:39 2017
    13 // Update Count     : 477
     12// Last Modified On : Thu Feb 23 21:48:55 2017
     13// Update Count     : 485
    1414//
    1515
     
    6262                aggInst.aggregate = nullptr;
    6363                aggInst.params = nullptr;
     64                aggInst.hoistType = false;;
    6465                break;
    6566          case Enum:
     
    195196                newtype->aggInst.aggregate = maybeClone( aggInst.aggregate );
    196197                newtype->aggInst.params = maybeClone( aggInst.params );
     198                newtype->aggInst.hoistType = aggInst.hoistType;
    197199                break;
    198200          case Enum:
     
    644646} // buildAggregate
    645647
     648ReferenceToType * buildComAggInst( const TypeData * type, std::list< Attribute * > attributes ) {
     649        switch ( type->kind ) {
     650          case TypeData::Enum: {
     651                  if ( type->enumeration.body ) {
     652                          EnumDecl * typedecl = buildEnum( type, attributes );
     653                          return new EnumInstType( buildQualifiers( type ), typedecl );
     654                  } else {
     655                          return new EnumInstType( buildQualifiers( type ), *type->enumeration.name );
     656                  } // if
     657          }
     658          case TypeData::Aggregate: {
     659                  ReferenceToType * ret;
     660                  if ( type->aggregate.body ) {
     661                          AggregateDecl * typedecl = buildAggregate( type, attributes );
     662                          switch ( type->aggregate.kind ) {
     663                                case DeclarationNode::Struct:
     664                                  ret = new StructInstType( buildQualifiers( type ), (StructDecl *)typedecl );
     665                                  break;
     666                                case DeclarationNode::Union:
     667                                  ret = new UnionInstType( buildQualifiers( type ), (UnionDecl *)typedecl );
     668                                  break;
     669                                case DeclarationNode::Trait:
     670                                  assert( false );
     671                                  //ret = new TraitInstType( buildQualifiers( type ), (TraitDecl *)typedecl );
     672                                  break;
     673                                default:
     674                                  assert( false );
     675                          } // switch
     676                  } else {
     677                          switch ( type->aggregate.kind ) {
     678                                case DeclarationNode::Struct:
     679                                  ret = new StructInstType( buildQualifiers( type ), *type->aggregate.name );
     680                                  break;
     681                                case DeclarationNode::Union:
     682                                  ret = new UnionInstType( buildQualifiers( type ), *type->aggregate.name );
     683                                  break;
     684                                case DeclarationNode::Trait:
     685                                  ret = new TraitInstType( buildQualifiers( type ), *type->aggregate.name );
     686                                  break;
     687                                default:
     688                                  assert( false );
     689                          } // switch
     690                  } // if
     691                  return ret;
     692          }
     693          default:
     694                assert( false );
     695        } // switch
     696} // buildAggInst
     697
    646698ReferenceToType * buildAggInst( const TypeData * td ) {
    647699        assert( td->kind == TypeData::AggregateInst );
    648700
    649         ReferenceToType * ret;
    650         if ( td->aggInst.aggregate->kind == TypeData::Enum ) {
    651                 ret = new EnumInstType( buildQualifiers( td ), *td->aggInst.aggregate->enumeration.name );
    652         } else {
    653                 assert( td->aggInst.aggregate->kind == TypeData::Aggregate );
    654                 switch ( td->aggInst.aggregate->aggregate.kind ) {
    655                   case DeclarationNode::Struct:
    656                         assert( td->aggInst.aggregate->aggregate.name );
    657                         ret = new StructInstType( buildQualifiers( td ), *td->aggInst.aggregate->aggregate.name );
    658                         break;
    659                   case DeclarationNode::Union:
    660                         ret = new UnionInstType( buildQualifiers( td ), *td->aggInst.aggregate->aggregate.name );
    661                         break;
    662                   case DeclarationNode::Trait:
    663                         ret = new TraitInstType( buildQualifiers( td ), *td->aggInst.aggregate->aggregate.name );
    664                         break;
    665                   default:
    666                         assert( false );
    667                 } // switch
    668         } // if
     701        // ReferenceToType * ret = buildComAggInst( td->aggInst.aggregate, std::list< Attribute * >() );
     702        ReferenceToType * ret = nullptr;
     703        TypeData * type = td->aggInst.aggregate;
     704        switch ( type->kind ) {
     705          case TypeData::Enum: {
     706                  return new EnumInstType( buildQualifiers( type ), *type->enumeration.name );
     707          }
     708          case TypeData::Aggregate: {
     709                  switch ( type->aggregate.kind ) {
     710                        case DeclarationNode::Struct:
     711                          ret = new StructInstType( buildQualifiers( type ), *type->aggregate.name );
     712                          break;
     713                        case DeclarationNode::Union:
     714                          ret = new UnionInstType( buildQualifiers( type ), *type->aggregate.name );
     715                          break;
     716                        case DeclarationNode::Trait:
     717                          ret = new TraitInstType( buildQualifiers( type ), *type->aggregate.name );
     718                          break;
     719                        default:
     720                          assert( false );
     721                  } // switch
     722          }
     723          break;
     724          default:
     725                assert( false );
     726        } // switch
     727
     728        ret->set_hoistType( td->aggInst.hoistType );
    669729        buildList( td->aggInst.params, ret->get_parameters() );
    670730        buildForall( td->forall, ret->get_forall() );
  • src/Parser/TypeData.h

    r31868da rfd061ed3  
    1010// Created On       : Sat May 16 15:18:36 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb 23 15:16:18 2017
    13 // Update Count     : 155
     12// Last Modified On : Thu Feb 23 17:14:46 2017
     13// Update Count     : 158
    1414//
    1515
     
    3838                TypeData * aggregate;
    3939                ExpressionNode * params;
     40                bool hoistType;
    4041        };
    4142
     
    104105ArrayType * buildArray( const TypeData * );
    105106AggregateDecl * buildAggregate( const TypeData *, std::list< Attribute * > );
     107ReferenceToType * buildComAggInst( const TypeData *, std::list< Attribute * > attributes );
    106108ReferenceToType * buildAggInst( const TypeData * );
    107109NamedTypeDecl * buildSymbolic( const TypeData *, const std::string &name, DeclarationNode::StorageClass sc );
  • src/SymTab/Validate.cc

    r31868da rfd061ed3  
    1010// Created On       : Sun May 17 21:50:04 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb  2 17:47:54 2017
    13 // Update Count     : 312
     12// Last Modified On : Thu Feb 23 21:33:55 2017
     13// Update Count     : 318
    1414//
    1515
     
    629629                } else {
    630630                        TypeDeclMap::const_iterator base = typedeclNames.find( typeInst->get_name() );
    631                         assertf( base != typedeclNames.end(), "Can't find name %s", typeInst->get_name().c_str() );
     631                        assertf( base != typedeclNames.end(), "Can't find typedecl name %s", typeInst->get_name().c_str() );
    632632                        typeInst->set_baseType( base->second );
    633633                } // if
     
    660660                // Note, qualifiers on the typedef are superfluous for the forward declaration.
    661661                if ( StructInstType *aggDecl = dynamic_cast< StructInstType * >( tyDecl->get_base() ) ) {
    662                         return new StructDecl( aggDecl->get_name() );
     662                        return aggDecl->get_baseStruct() ? Mutator::mutate( aggDecl->get_baseStruct() ) : new StructDecl( aggDecl->get_name() );
    663663                } else if ( UnionInstType *aggDecl = dynamic_cast< UnionInstType * >( tyDecl->get_base() ) ) {
    664                         return new UnionDecl( aggDecl->get_name() );
     664                        return aggDecl->get_baseUnion() ? Mutator::mutate( aggDecl->get_baseUnion() ) : new UnionDecl( aggDecl->get_name() );
    665665                } else if ( EnumInstType *enumDecl = dynamic_cast< EnumInstType * >( tyDecl->get_base() ) ) {
    666666                        return new EnumDecl( enumDecl->get_name() );
     
    732732        }
    733733
    734         // there may be typedefs nested within aggregates in order for everything to work properly, these should be removed
     734        // there may be typedefs nested within aggregates. in order for everything to work properly, these should be removed
    735735        // as well
    736736        template<typename AggDecl>
  • src/SynTree/ReferenceToType.cc

    r31868da rfd061ed3  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb  2 17:45:07 2017
    13 // Update Count     : 23
     12// Last Modified On : Thu Feb 23 16:38:54 2017
     13// Update Count     : 24
    1414//
    1515
     
    2323#include "Common/utility.h"
    2424
    25 ReferenceToType::ReferenceToType( const Type::Qualifiers &tq, const std::string &name, const std::list< Attribute * > & attributes ) : Type( tq, attributes ), name( name ) {
     25ReferenceToType::ReferenceToType( const Type::Qualifiers &tq, const std::string &name, const std::list< Attribute * > & attributes ) : Type( tq, attributes ), name( name ), hoistType( false ) {
    2626}
    2727
    28 ReferenceToType::ReferenceToType( const ReferenceToType &other ) : Type( other ), name( other.name ) {
     28ReferenceToType::ReferenceToType( const ReferenceToType &other ) : Type( other ), name( other.name ), hoistType( other.hoistType ) {
    2929        cloneAll( other.parameters, parameters );
    3030}
  • src/SynTree/Type.h

    r31868da rfd061ed3  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb  2 17:43:01 2017
    13 // Update Count     : 33
     12// Last Modified On : Thu Feb 23 16:38:53 2017
     13// Update Count     : 34
    1414//
    1515
     
    240240        void set_name( std::string newValue ) { name = newValue; }
    241241        std::list< Expression* >& get_parameters() { return parameters; }
     242        bool get_hoistType() const { return hoistType; }
     243        void set_hoistType( bool newValue ) { hoistType = newValue; }
    242244
    243245        virtual ReferenceToType *clone() const = 0;
     
    250252        std::string name;
    251253  private:
     254        bool hoistType;
    252255};
    253256
  • src/libcfa/concurrency/invoke.h

    r31868da rfd061ed3  
    6060
    6161      struct coStack_t {
    62             unsigned int size;          // size of stack
    63             void *storage;                      // pointer to stack
    64             void *limit;                        // stack grows towards stack limit
    65             void *base;                         // base of stack
    66             void *context;                      // address of cfa_context_t
    67             void *top;                          // address of top of storage
     62            unsigned int size;                // size of stack
     63            void *storage;                            // pointer to stack
     64            void *limit;                              // stack grows towards stack limit
     65            void *base;                               // base of stack
     66            void *context;                            // address of cfa_context_t
     67            void *top;                                // address of top of storage
    6868            bool userStack;     
    6969      };
     
    7373      struct coroutine {
    7474            struct coStack_t stack;
    75             const char *name;                   // textual name for coroutine/task, initialized by uC++ generated code
    76             int errno_;                         // copy of global UNIX variable errno
    77             enum coroutine_state state; // current execution status for coroutine
    78             struct coroutine *starter;  // first coroutine to resume this one
    79             struct coroutine *last;             // last coroutine to resume this one
     75            const char *name;                         // textual name for coroutine/task, initialized by uC++ generated code
     76            int errno_;                               // copy of global UNIX variable errno
     77            enum coroutine_state state;       // current execution status for coroutine
     78            struct coroutine *starter;        // first coroutine to resume this one
     79            struct coroutine *last;                   // last coroutine to resume this one
    8080      };
    8181
    8282      struct thread {
    83             struct coroutine c;           // coroutine body used to store context
    84             struct signal_once terminated;// indicate if execuation state is not halted
    85             struct thread * next;         // instrusive link field for threads
     83            struct coroutine c;                 // coroutine body used to store context
     84            struct signal_once terminated;      // indicate if execuation state is not halted
     85            struct thread * next;               // instrusive link field for threads
    8686      };
    8787
  • src/libcfa/concurrency/monitor

    r31868da rfd061ed3  
    2121#include "invoke.h"
    2222
    23 struct monitor {
     23struct __monitor_t {
    2424        spinlock lock;
    25         thread * holder;
     25        thread * owner;
    2626        simple_thread_list entry_queue;
     27        unsigned int recursion;
    2728};
    2829
    29 void enter(monitor *);
    30 void leave(monitor *);
     30static inline void ?{}(__monitor_t * this) {
     31        this->owner = 0;
     32        this->recursion = 0;
     33}
    3134
    32 struct monitor_guard {
    33         monitor * m;
     35void enter(__monitor_t *);
     36void leave(__monitor_t *);
     37
     38struct monitor_guard_t {
     39        __monitor_t * m;
    3440};
    3541
    36 static inline void ?{}( monitor_guard * this, monitor * m ) {
     42static inline void ?{}( monitor_guard_t * this, __monitor_t * m ) {
    3743        this->m = m;
    3844        enter( this->m );
    3945}
    4046
    41 static inline void ^?{}( monitor_guard * this ) {
     47static inline void ^?{}( monitor_guard_t * this ) {
    4248        leave( this->m );
    4349}
  • src/libcfa/concurrency/monitor.c

    r31868da rfd061ed3  
    66// file "LICENCE" distributed with Cforall.
    77//
    8 // monitor.c --
     8// __monitor_t.c --
    99//
    1010// Author           : Thierry Delisle
     
    1919#include "kernel_private.h"
    2020
    21 void enter(monitor * this) {
     21void enter(__monitor_t * this) {
    2222        lock( &this->lock );
    2323        thread * thrd = this_thread();
    2424
    25         if( this->holder ) {
     25        if( !this->owner ) {
     26                //No one has the monitor, just take it
     27                this->owner = thrd;
     28                this->recursion = 1;
     29        }
     30        else if( this->owner == thrd) {
     31                //We already have the monitor, just not how many times we took it
     32                assert( this->recursion > 0 );
     33                this->recursion += 1;
     34        }
     35        else {
     36                //Some one else has the monitor, wait in line for it
    2637                append( &this->entry_queue, thrd );
    2738                ScheduleInternal( &this->lock );
    28                 return;
    29         }
    30         else {
    31                 this->holder = thrd;
     39
     40                //ScheduleInternal will unlock spinlock, no need to unlock ourselves
     41                return;
    3242        }
    3343
     
    3545}
    3646
    37 void leave(monitor * this) {
     47void leave(__monitor_t * this) {
    3848        lock( &this->lock );
    3949
    4050        thread * thrd = this_thread();
    41         assert( thrd == this->holder );
     51        assert( thrd == this->owner );
    4252
    43         this->holder = pop_head( &this->entry_queue );
     53        //Leaving a recursion level, decrement the counter
     54        this->recursion -= 1;
     55
     56        //If we left the last level of recursion it means we are changing who owns the monitor
     57        thread * new_owner = 0;
     58        if( this->recursion == 0) {
     59                //Get the next thread in the list
     60                new_owner = this->owner = pop_head( &this->entry_queue );
     61
     62                //We are passing the monitor to someone else, which means recursion level is not 0
     63                this->recursion = new_owner ? 1 : 0;
     64        }       
    4465
    4566        unlock( &this->lock );
    4667
    47         if( this->holder ) ScheduleThread( this->holder );
     68        //If we have a new owner, we need to wake-up the thread
     69        if( new_owner ) {
     70                ScheduleThread( new_owner );
     71        }
    4872}
  • src/libcfa/iostream

    r31868da rfd061ed3  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jul 12 18:01:09 2016
    13 // Update Count     : 93
     12// Last Modified On : Fri Feb 24 21:09:09 2017
     13// Update Count     : 94
    1414//
    1515
     
    4545
    4646forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, char );
     47forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, signed char );
     48forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, unsigned char );
    4749
    4850forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, short int );
  • src/libcfa/iostream.c

    r31868da rfd061ed3  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jul 12 18:01:39 2016
    13 // Update Count     : 306
     12// Last Modified On : Fri Feb 24 21:09:59 2017
     13// Update Count     : 307
    1414//
    1515
     
    2626ostype * ?|?( ostype *os, char c ) {
    2727        prtfmt( os, "%c", c );
     28        sepOff( os );
     29        return os;
     30} // ?|?
     31
     32forall( dtype ostype | ostream( ostype ) )
     33ostype * ?|?( ostype *os, signed char c ) {
     34        prtfmt( os, "%hhd", c );
     35        sepOff( os );
     36        return os;
     37} // ?|?
     38
     39forall( dtype ostype | ostream( ostype ) )
     40ostype * ?|?( ostype *os, unsigned char c ) {
     41        prtfmt( os, "%hhu", c );
    2842        sepOff( os );
    2943        return os;
  • src/libcfa/stdlib

    r31868da rfd061ed3  
    1010// Created On       : Thu Jan 28 17:12:35 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb 23 14:11:47 2017
    13 // Update Count     : 100
     12// Last Modified On : Fri Feb 24 21:07:16 2017
     13// Update Count     : 101
    1414//
    1515
     
    9595//---------------------------------------
    9696
    97 char abs( char );
     97unsigned char abs( signed char );
    9898extern "C" { int abs( int ); }                                                  // use default C routine for int
    99 long int abs( long int );
    100 long long int abs( long long int );
     99unsigned long int abs( long int );
     100unsigned long long int abs( long long int );
    101101float abs( float );
    102102double abs( double );
  • src/libcfa/stdlib.c

    r31868da rfd061ed3  
    1010// Created On       : Thu Jan 28 17:10:29 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb 23 14:11:29 2017
    13 // Update Count     : 170
     12// Last Modified On : Fri Feb 24 21:08:11 2017
     13// Update Count     : 171
    1414//
    1515
     
    240240//---------------------------------------
    241241
    242 char abs( char v ) { return abs( (int)v ); }
    243 long int abs( long int v ) { return labs( v ); }
    244 long long int abs( long long int v ) { return llabs( v ); }
     242unsigned char abs( signed char v ) { return abs( (int)v ); }
     243unsigned long int abs( long int v ) { return labs( v ); }
     244unsigned long long int abs( long long int v ) { return llabs( v ); }
    245245float abs( float x ) { return fabsf( x ); }
    246246double abs( double x ) { return fabs( x ); }
  • src/tests/monitor.c

    r31868da rfd061ed3  
    66struct global_t {
    77        int value;
    8         monitor m;
     8        __monitor_t m;
    99};
    1010
     
    1616
    1717void increment( /*mutex*/ global_t * this ) {
    18         monitor_guard g = { &this->m };
    19         this->value += 1;
     18        monitor_guard_t g1 = { &this->m };
     19        {
     20                monitor_guard_t g2 = { &this->m };
     21                {
     22                        monitor_guard_t g3 = { &this->m };
     23                        this->value += 1;
     24                }
     25        }
    2026}
    2127
Note: See TracChangeset for help on using the changeset viewer.