Ignore:
Timestamp:
Aug 23, 2017, 6:22:07 PM (8 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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:
87e08e24, cb811ac
Parents:
9f07232 (diff), bd37119 (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 plg2:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/rational.c

    r9f07232 rd3e4d6c  
    1 // 
     1//
    22// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
    33//
    44// The contents of this file are covered under the licence agreement in the
    55// file "LICENCE" distributed with Cforall.
    6 // 
    7 // rational.c -- 
    8 // 
     6//
     7// rational.c --
     8//
    99// Author           : Peter A. Buhr
    1010// Created On       : Wed Apr  6 17:54:28 2016
     
    1212// Last Modified On : Tue May 16 18:35:36 2017
    1313// Update Count     : 150
    14 // 
     14//
    1515
    1616#include "rational"
     
    4747
    4848forall( otype RationalImpl | arithmetic( RationalImpl ) )
    49 void ?{}( Rational(RationalImpl) * r ) {
     49void ?{}( Rational(RationalImpl) & r ) {
    5050        r{ (RationalImpl){0}, (RationalImpl){1} };
    5151} // rational
    5252
    5353forall( otype RationalImpl | arithmetic( RationalImpl ) )
    54 void ?{}( Rational(RationalImpl) * r, RationalImpl n ) {
     54void ?{}( Rational(RationalImpl) & r, RationalImpl n ) {
    5555        r{ n, (RationalImpl){1} };
    5656} // rational
    5757
    5858forall( otype RationalImpl | arithmetic( RationalImpl ) )
    59 void ?{}( Rational(RationalImpl) * r, RationalImpl n, RationalImpl d ) {
     59void ?{}( Rational(RationalImpl) & r, RationalImpl n, RationalImpl d ) {
    6060        RationalImpl t = simplify( &n, &d );                            // simplify
    61         r->numerator = n / t;
    62         r->denominator = d / t;
     61        r.numerator = n / t;
     62        r.denominator = d / t;
    6363} // rational
    6464
     
    7777
    7878forall( otype RationalImpl | arithmetic( RationalImpl ) )
    79 [ RationalImpl, RationalImpl ] ?=?( * [ RationalImpl, RationalImpl ] dest, Rational(RationalImpl) src ) {
    80         return *dest = src.[ numerator, denominator ];
     79[ RationalImpl, RationalImpl ] ?=?( & [ RationalImpl, RationalImpl ] dest, Rational(RationalImpl) src ) {
     80        return dest = src.[ numerator, denominator ];
    8181}
    8282
Note: See TracChangeset for help on using the changeset viewer.