Ignore:
Timestamp:
Aug 25, 2017, 10:38:34 AM (8 years ago)
Author:
Thierry Delisle <tdelisle@…>
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:
800d275
Parents:
af08051 (diff), 3eab308c (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
  • src/tests/avltree/avl1.c

    raf08051 r28e58fd  
    11#include "avl.h"
    22// #include "cwrap.h"
     3#include <stdlib>
    34
    45forall(otype K | Comparable(K), otype V)
    5 void ?{}(tree(K, V) *t, K key, V value){
    6   (&t->key) { key };
    7   (&t->value) { value };
    8   t->parent = NULL;
    9   t->left = NULL;
    10   t->right = NULL;
    11   t->balance = 0;
     6void ?{}(tree(K, V) &t, K key, V value){
     7  (t.key) { key };
     8  (t.value) { value };
     9  t.parent = NULL;
     10  t.left = NULL;
     11  t.right = NULL;
     12  t.balance = 0;
    1213}
    1314
    1415forall(otype K, otype V)
    15 void ^?{}(tree(K, V) * t){
    16   delete(t->left);
    17   delete(t->right);
    18   ^(&t->key){};
    19   ^(&t->value){};
     16void ^?{}(tree(K, V) & t){
     17  delete(t.left);
     18  delete(t.right);
     19  ^(t.key){};
     20  ^(t.value){};
    2021}
    2122
     
    2425  // infinite loop trying to resolve ... t = malloc();
    2526  tree(K, V) * t = malloc(sizeof(tree(K,V)));
    26   t { key, value };
     27  (*t){ key, value };
    2728  return t;
    2829}
Note: See TracChangeset for help on using the changeset viewer.