From: Todd O. <to...@us...> - 2006-04-11 20:34:38
|
Update of /cvsroot/yassl/yassl/mySTL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26097/mySTL Modified Files: helpers.hpp list.hpp vector.hpp Log Message: merge updates from Magnus with current Index: list.hpp =================================================================== RCS file: /cvsroot/yassl/yassl/mySTL/list.hpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** list.hpp 28 Mar 2006 23:56:39 -0000 1.1.1.1 --- list.hpp 11 Apr 2006 20:34:30 -0000 1.2 *************** *** 165,169 **** void* mem = malloc(sizeof(node)); if (!mem) abort(); ! node* add = new (mem) node(t); if (head_) { --- 165,169 ---- void* mem = malloc(sizeof(node)); if (!mem) abort(); ! node* add = new (reinterpret_cast<yassl_pointer>(mem)) node(t); if (head_) { Index: vector.hpp =================================================================== RCS file: /cvsroot/yassl/yassl/mySTL/vector.hpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** vector.hpp 28 Mar 2006 23:56:39 -0000 1.1.1.1 --- vector.hpp 11 Apr 2006 20:34:30 -0000 1.2 *************** *** 46,50 **** vector_base(size_t n) { ! start_ = static_cast<T*>(malloc(n * sizeof(T))); if (!start_) abort(); finish_ = start_; --- 46,51 ---- vector_base(size_t n) { ! // Don't allow malloc(0), if n is 0 use 1 ! start_ = static_cast<T*>(malloc((n ? n : 1) * sizeof(T))); if (!start_) abort(); finish_ = start_; Index: helpers.hpp =================================================================== RCS file: /cvsroot/yassl/yassl/mySTL/helpers.hpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** helpers.hpp 28 Mar 2006 23:56:39 -0000 1.1.1.1 --- helpers.hpp 11 Apr 2006 20:34:30 -0000 1.2 *************** *** 29,40 **** #include <stdlib.h> ! #include <new> // placement new ! ! - #ifdef __IBMCPP__ /* Workaround for the lack of operator new(size_t, void*) in IBM VA C++ 6.0 */ struct Dummy {}; --- 29,38 ---- #include <stdlib.h> ! #include <new> /* Workaround for the lack of operator new(size_t, void*) in IBM VA C++ 6.0 + Also used as a workaround to avoid including <new> */ struct Dummy {}; *************** *** 46,53 **** typedef Dummy* yassl_pointer; - #else - typedef void* yassl_pointer; - #endif - namespace mySTL { --- 44,47 ---- |