Ignore:
Timestamp:
Jun 30, 2016, 4:32:56 PM (9 years ago)
Author:
Thierry Delisle <tdelisle@…>
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, with_gc
Children:
ea29e73
Parents:
1b5c81ed (diff), 84d4d6f (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' into gc_noraii

Conflicts:

Jenkinsfile
src/SymTab/Validate.cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/examples/sum.c

    r1b5c81ed rf80e0218  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // sum.c --
     7// sum.c -- test resolvers ability to deal with many variables with the same name and to use the minimum number of casts
     8//    necessary to disambiguate overloaded variable names.
    89//
    910// Author           : Peter A. Buhr
    1011// Created On       : Wed May 27 17:56:53 2015
    1112// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Mar  4 15:06:47 2016
    13 // Update Count     : 196
     13// Last Modified On : Thu May 26 09:25:42 2016
     14// Update Count     : 201
    1415//
    1516
     
    4849        } // for
    4950        sout | "sum from" | low | "to" | High | "is"
    50                  | (int)sum( size, a ) | "" | ", check" | (int)s | endl;
     51                 | (int)sum( size, a ) | ", check" | (int)s | endl;
    5152
    5253        int s = 0, a[size], v = low;
     
    5657        } // for
    5758        sout | "sum from" | low | "to" | High | "is"
    58                  | sum( size, (int *)a ) | "" | ", check" | (int)s | endl;
     59                 | sum( size, (int *)a ) | ", check" | (int)s | endl;
    5960
    6061        float s = 0.0, a[size], v = low / 10.0;
     
    6465        } // for
    6566        sout | "sum from" | low / 10.0 | "to" | High / 10.0 | "is"
    66                  | sum( size, (float *)a ) | "" | ", check" | (float)s | endl;
     67                 | sum( size, (float *)a ) | ", check" | (float)s | endl;
    6768
    6869        double s = 0, a[size], v = low / 10.0;
     
    7273        } // for
    7374        sout | "sum from" | low / 10.0 | "to" | High / 10.0 | "is"
    74                  | sum( size, (double *)a ) | "" | ", check" | (double)s | endl;
     75                 | sum( size, (double *)a ) | ", check" | (double)s | endl;
    7576
    7677        struct S { int i, j; } 0 = { 0, 0 }, 1 = { 1, 1 };
    77         S ?+?( S t1, S t2 ) { S s = { t1.i + t2.i, t1.j + t2.j }; return s; }
     78        S ?+?( S t1, S t2 ) { return (S){ t1.i + t2.i, t1.j + t2.j }; }
    7879        S ?+=?( S *t1, S t2 ) { *t1 = *t1 + t2; return *t1; }
    7980        S ++?( S *t ) { *t += 1; return *t; }
     
    8788        } // for
    8889        sout | "sum from" | low | "to" | High | "is"
    89                  | sum( size, (S *)a ) | "" | ", check" | (S)s | endl;
     90                 | sum( size, (S *)a ) | ", check" | (S)s | endl;
    9091} // main
    9192
Note: See TracChangeset for help on using the changeset viewer.