Changeset 14f6bb39
- Timestamp:
- Feb 28, 2017, 3:20:59 PM (8 years ago)
- 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:
- 1e6b350, f37147b
- Parents:
- fd061ed3
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/prelude/prelude.cf
rfd061ed3 r14f6bb39 131 131 !?( float _Complex ), !?( double _Complex ), !?( long double _Complex ); 132 132 133 forall ( dtype DT ) int !?( DT * ); 134 forall ( dtype DT ) int !?( const DT * ); 135 forall ( dtype DT ) int !?( volatile DT * ); 133 136 forall ( dtype DT ) int !?( const volatile DT * ); 134 137 forall ( ftype FT ) int !?( FT * ); … … 235 238 ?>?( long double, long double ), ?>=?( long double, long double ); 236 239 240 forall( dtype DT ) signed int ?<?( DT *, DT * ); 241 forall( dtype DT ) signed int ?<?( const DT *, const DT * ); 242 forall( dtype DT ) signed int ?<?( volatile DT *, volatile DT * ); 237 243 forall( dtype DT ) signed int ?<?( const volatile DT *, const volatile DT * ); 244 245 forall( dtype DT ) signed int ?>?( DT *, DT * ); 246 forall( dtype DT ) signed int ?>?( const DT *, const DT * ); 247 forall( dtype DT ) signed int ?>?( volatile DT *, volatile DT * ); 238 248 forall( dtype DT ) signed int ?>?( const volatile DT *, const volatile DT * ); 249 250 forall( dtype DT ) signed int ?<=?( DT *, DT * ); 251 forall( dtype DT ) signed int ?<=?( const DT *, const DT * ); 252 forall( dtype DT ) signed int ?<=?( volatile DT *, volatile DT * ); 239 253 forall( dtype DT ) signed int ?<=?( const volatile DT *, const volatile DT * ); 254 255 forall( dtype DT ) signed int ?>=?( DT *, DT * ); 256 forall( dtype DT ) signed int ?>=?( const DT *, const DT * ); 257 forall( dtype DT ) signed int ?>=?( volatile DT *, volatile DT * ); 240 258 forall( dtype DT ) signed int ?>=?( const volatile DT *, const volatile DT * ); 241 259 -
src/tests/avltree/avl_test.c
rfd061ed3 r14f6bb39 36 36 37 37 // char* -> char* 38 int ?<?(char *a, char *b) { 39 return strcmp(a,b) < 0; 38 struct c_str { char *str; }; // wraps a C string 39 int ?<?(c_str a, c_str b) { 40 return strcmp(a.str,b.str) < 0; 40 41 } 41 tree(c har *, char *) * ssmap = create("queso", "cheese");42 insert(&ssmap, "foo", "bar");43 insert(&ssmap, "hello", "world");42 tree(c_str, char *) * ssmap = create((c_str){"queso"}, "cheese"); 43 insert(&ssmap, (c_str){"foo"}, "bar"); 44 insert(&ssmap, (c_str){"hello"}, "world"); 44 45 assert( height(ssmap) == 2 ); 45 46 46 printf("%s %s %s\n", *find(ssmap, "hello"), *find(ssmap, "foo"), *find(ssmap, "queso"));47 printf("%s %s %s\n", *find(ssmap, (c_str){"hello"}), *find(ssmap, (c_str){"foo"}), *find(ssmap, (c_str){"queso"})); 47 48 48 remove(&ssmap, "foo");49 remove(&ssmap, (c_str){"foo"}); 49 50 delete(ssmap); 50 51 }
Note: See TracChangeset
for help on using the changeset viewer.