Changes in / [d32c4e2:7fe4cc3e]
- Location:
- src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/FixInit.cc
rd32c4e2 r7fe4cc3e 449 449 FunctionDecl * dtorCaller = new FunctionDecl( objDecl->get_mangleName() + "_dtor_atexit", DeclarationNode::NoStorageClass, LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ), false, false ); 450 450 dtorCaller->fixUniqueId(); 451 dtorCaller->get_statements()->get_kids().push_back( ctorInit->get_dtor() ->clone());451 dtorCaller->get_statements()->get_kids().push_back( ctorInit->get_dtor() ); 452 452 453 453 // on_exit(dtor_atexit); -
src/libcfa/containers/vector
rd32c4e2 r7fe4cc3e 40 40 41 41 forall(otype T, otype allocator_t | allocator_c(T, allocator_t)) 42 static inline size_tsize(vector(T, allocator_t) *const this)42 static inline bool size(vector(T, allocator_t) *const this) 43 43 { 44 44 return this->size; -
src/tests/.expect/libcfa_vector.txt
rd32c4e2 r7fe4cc3e 1 0 2 1 3 2 4 3 5 0 1 CFA Version 1.0.0 (debug) 2 libcfa_vector.c:3:29: fatal error: containers/vector: No such file or directory 3 #include <containers/vector> 4 ^ 5 compilation terminated. 6 make: *** [libcfa_vector] Error 1 -
src/tests/libcfa_vector.c
rd32c4e2 r7fe4cc3e 1 1 #include <stdlib> 2 3 extern "C" {4 #include <stdio.h>5 }6 2 7 3 #include <containers/vector> 8 4 9 #define assert(x) do {\10 if(!(x)) {\11 printf("CHECK failed : %s at %s:%i\n", #x, __FILE__, __LINE__);\12 abort();\13 }}while(0 == 1)\14 15 5 int main(int argc, char const *argv[]) { 16 vector(int, heap_allocator(int)) iv; 17 ctor(&iv); 18 19 assert(empty(&iv)); 20 assert(size(&iv) == 0); 21 printf("%d\n", size(&iv)); 6 vector(int) iv; 22 7 23 8 push_back(&iv, 1); 24 printf("%d\n", size(&iv));25 assert(size(&iv) == 1);26 9 push_back(&iv, 2); 27 printf("%d\n", size(&iv));28 assert(size(&iv) == 2);29 10 push_back(&iv, 3); 30 printf("%d\n", size(&iv));31 assert(size(&iv) == 3);32 11 33 12 assert(!empty(&iv)); 34 13 assert(size(&iv) == 3); 14 assert(iv[0] == 1); 35 15 assert(at(&iv, 0) == 1); 36 assert( (&iv)[0] == 1);16 assert(iv[1] == 2); 37 17 assert(at(&iv, 1) == 2); 38 assert( (&iv)[1] == 2);18 assert(iv[2] == 3); 39 19 assert(at(&iv, 2) == 3); 40 assert((&iv)[2] == 3);41 20 42 21 clear(&iv); … … 44 23 assert(empty(&iv)); 45 24 assert(size(&iv) == 0); 46 printf("%d\n", size(&iv));47 25 48 26 return 0;
Note: See TracChangeset
for help on using the changeset viewer.