[uClibc-cvs] CVS uClibc++/src

CVS User gkajmowi gkajmowi at codepoet.org
Sat Dec 18 22:00:53 UTC 2004


Update of /var/cvs/uClibc++/src
In directory nail:/tmp/cvs-serv311/src

Modified Files:
	Makefile bitset.cpp fstream.cpp ios.cpp istream.cpp 
	ostream.cpp sstream.cpp string.cpp vector.cpp 
Removed Files:
	forcefunction.cpp 
Log Message:
Convert to ifdef based forced compilation and use of template library for common values.  Merge helper files into main file is optimal.
Split string into two files to address problems with ostream as it was.

--- /var/cvs/uClibc++/src/Makefile	2004/11/30 17:38:11	1.8
+++ /var/cvs/uClibc++/src/Makefile	2004/12/18 22:00:48	1.9
@@ -31,8 +31,7 @@
 	numeric.cpp \
 	sstream.cpp \
 	bitset.cpp \
-	valarray.cpp \
-	forcefunction.cpp
+	valarray.cpp
 
 
 EXOBJS	=\
@@ -63,8 +62,7 @@
 	numeric.o \
 	sstream.o \
 	bitset.o \
-	valarray.o \
-	forcefunction.o
+	valarray.o
 
 ALLOBJS	=	$(EXOBJS)
 ALLBIN	=	libuClibc++.so.$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL) libuClibc++.a
--- /var/cvs/uClibc++/src/bitset.cpp	2004/09/01 16:39:31	1.1
+++ /var/cvs/uClibc++/src/bitset.cpp	2004/12/18 22:00:48	1.2
@@ -23,10 +23,4 @@
 
 
 
-
-
-
-
-
-
 }
--- /var/cvs/uClibc++/src/fstream.cpp	2004/09/01 16:39:31	1.3
+++ /var/cvs/uClibc++/src/fstream.cpp	2004/12/18 22:00:48	1.4
@@ -17,14 +17,38 @@
 	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
+#define __UCLIBCXX_COMPILE_FSTREAM__ 1
+
 #include <fstream>
 
 namespace std{
 
+#ifdef __UCLIBCXX_EXPAND_FSTREAM_CHAR__
+
+	template basic_filebuf<char, char_traits<char> >::~basic_filebuf();
+
+	template basic_filebuf<char, char_traits<char> >::int_type basic_filebuf<char, char_traits<char> >::
+		pbackfail(basic_filebuf<char, char_traits<char> >::int_type c);
+
+	template basic_filebuf<char, char_traits<char> > * basic_filebuf<char, char_traits<char> >::
+		open(const char* s, ios_base::openmode mode);
+
+	template basic_ofstream<char, char_traits<char> >::~basic_ofstream();
+
+	template basic_filebuf<char, char_traits<char> >::int_type basic_filebuf<char, char_traits<char> >::
+		overflow (basic_filebuf<char, char_traits<char> >::int_type);
+
+	template basic_filebuf<char, char_traits<char> >::int_type
+		basic_filebuf<char, char_traits<char> >::underflow ();
 
+	template basic_streambuf<char, char_traits<char> >*
+		basic_filebuf<char, char_traits<char> >::
+		setbuf(char * s, streamsize n);
 
+	template streamsize basic_filebuf<char, char_traits<char> >::xsputn(const char* s, streamsize n);
 
 
+#endif
 
 
 }
--- /var/cvs/uClibc++/src/ios.cpp	2004/09/01 16:39:31	1.4
+++ /var/cvs/uClibc++/src/ios.cpp	2004/12/18 22:00:48	1.5
@@ -94,11 +94,6 @@
 	}
 
 
-
-
-
-
-
 }
 
 
--- /var/cvs/uClibc++/src/istream.cpp	2004/09/01 16:39:31	1.4
+++ /var/cvs/uClibc++/src/istream.cpp	2004/12/18 22:00:48	1.5
@@ -18,6 +18,8 @@
 
 */
 
+#define __UCLIBCXX_COMPILE_ISTREAM__ 1
+
 #include <istream>
 
 
@@ -25,86 +27,17 @@
 
 #ifdef __UCLIBCXX_EXPAND_ISTREAM_CHAR__
 
-	template <> basic_istream<char, char_traits<char> >&
-		basic_istream<char, char_traits<char> >::operator>>(short& n)
-	{
-		sentry(*this);
-		__istream_readin<char_traits<char>, char, short>::readin(*this, n);
-		return *this;
-	}
-
-	template <> basic_istream<char, char_traits<char> >&
-		basic_istream<char, char_traits<char> >::operator>>(unsigned short& n)
-	{
-		sentry(*this);
-		__istream_readin<char_traits<char>, char, unsigned short>::readin(*this, n);
-		return *this;
-	}
-
-	template <> basic_istream<char, char_traits<char> >&
-		basic_istream<char, char_traits<char> >::operator>>(int& n)
-	{
-		sentry(*this);
-		__istream_readin<char_traits<char>, char, int>::readin(*this, n);
-		return *this;
-	}
-
-	template <> basic_istream<char, char_traits<char> >&
-		basic_istream<char, char_traits<char> >::operator>>(unsigned int& n)
-	{
-		sentry(*this);
-		__istream_readin<char_traits<char>, char, unsigned int>::readin(*this, n);
-		return *this;
-	}
-
-	template <> basic_istream<char, char_traits<char> >&
-		basic_istream<char, char_traits<char> >::operator>>(long int& n)
-	{
-		sentry(*this);
-		__istream_readin<char_traits<char>, char, long int>::readin(*this, n);
-		return *this;
-	}
-
-	template <> basic_istream<char, char_traits<char> >&
-		basic_istream<char, char_traits<char> >::operator>>(unsigned long int& n)
-	{
-		sentry(*this);
-		__istream_readin<char_traits<char>, char, unsigned long int>::readin(*this, n);
-		return *this;
-	}
-
-	template <> basic_istream<char, char_traits<char> >&
-		basic_istream<char, char_traits<char> >::operator>>(float& n)
-	{
-		sentry(*this);
-		__istream_readin<char_traits<char>, char, float>::readin(*this, n);
-		return *this;
-	}
-
-	template <> basic_istream<char, char_traits<char> >&
-		basic_istream<char, char_traits<char> >::operator>>(double& n)
-	{
-		sentry(*this);
-		__istream_readin<char_traits<char>, char, double>::readin(*this, n);
-		return *this;
-	}
-
-	template <> basic_istream<char, char_traits<char> >&
-		basic_istream<char, char_traits<char> >::operator>>(long double& n)
-	{
-		sentry(*this);
-		__istream_readin<char_traits<char>, char, long double>::readin(*this, n);
-		return *this;
-	}
-
-	template <> basic_istream<char, char_traits<char> >&
-		basic_istream<char, char_traits<char> >::operator>>(void *& n)
-	{
-		sentry(*this);
-		__istream_readin<char_traits<char>, char, void*>::readin(*this, n);
-		return *this;
-	}
-
+	template basic_istream<char,char_traits<char> > & basic_istream<char, char_traits<char> >::operator>>(bool &n);
+	template basic_istream<char,char_traits<char> > & basic_istream<char, char_traits<char> >::operator>>(short &n);
+	template basic_istream<char,char_traits<char> > & basic_istream<char, char_traits<char> >::operator>>(unsigned short &n);
+	template basic_istream<char,char_traits<char> > & basic_istream<char, char_traits<char> >::operator>>(int &n);
+	template basic_istream<char,char_traits<char> > & basic_istream<char, char_traits<char> >::operator>>(unsigned int &n);
+	template basic_istream<char,char_traits<char> > & basic_istream<char, char_traits<char> >::operator>>(long unsigned &n);
+	template basic_istream<char,char_traits<char> > & basic_istream<char, char_traits<char> >::operator>>(long int &n);
+	template basic_istream<char,char_traits<char> > & basic_istream<char, char_traits<char> >::operator>>(float &f);
+	template basic_istream<char,char_traits<char> > & basic_istream<char, char_traits<char> >::operator>>(double &f);
+	template basic_istream<char,char_traits<char> > & basic_istream<char, char_traits<char> >::operator>>(long double &f);
+	template basic_istream<char,char_traits<char> > & basic_istream<char, char_traits<char> >::operator>>(void *& p);
 
 #endif
 
--- /var/cvs/uClibc++/src/ostream.cpp	2004/09/01 16:39:31	1.4
+++ /var/cvs/uClibc++/src/ostream.cpp	2004/12/18 22:00:48	1.5
@@ -17,6 +17,8 @@
 	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
+#define __UCLIBCXX_COMPILE_OSTREAM__ 1
+
 #include <ostream>
 
 namespace std{
@@ -24,110 +26,28 @@
 
 #ifdef __UCLIBCXX_EXPAND_OSTREAM_CHAR__
 
-template <> basic_ostream<char,char_traits<char> > & basic_ostream<char, char_traits<char> >::operator<<(bool n){
-	sentry s(*this);
-	__ostream_printout<char_traits<char>, char, bool>::printout(*this, n);
-	return *this;
-}
-
-template <> basic_ostream<char, char_traits<char> >& basic_ostream<char, char_traits<char> >::operator<<(short int n){
-	sentry s(*this);
-	__ostream_printout<char_traits<char>, char, int>::printout(*this, n);
-	return *this;
-}
-
-
-template <> basic_ostream<char,char_traits<char> >& basic_ostream<char, char_traits<char> >::operator<<(unsigned short int n){
-	sentry s(*this);
-	__ostream_printout<char_traits<char>, char, unsigned int>::printout(*this, n);
-	return *this;
-}
-
-template <> basic_ostream<char, char_traits<char> >& basic_ostream<char, char_traits<char> >::operator<<(int n){
-	sentry s(*this);
-	__ostream_printout<char_traits<char>, char, int>::printout(*this, n);
-	return *this;
-}
-
-
-template <> basic_ostream<char,char_traits<char> >& basic_ostream<char, char_traits<char> >::operator<<(unsigned int n){
-	sentry s(*this);
-	__ostream_printout<char_traits<char>, char, unsigned int>::printout(*this, n);
-	return *this;
-}
-
-template <> basic_ostream<char, char_traits<char> >& basic_ostream<char, char_traits<char> >::operator<<(long n){
-	sentry s(*this);
-	__ostream_printout<char_traits<char>, char, long int>::printout(*this, n);
-	return *this;
-}
-
-
-template <> basic_ostream<char, char_traits<char> >&
-                basic_ostream<char, char_traits<char> >::operator<<(unsigned long n)
-{
-	sentry s(*this);
-	__ostream_printout<char_traits<char>, char, unsigned long int>::printout(*this, n);
-	return *this;
-}
-
-template <> basic_ostream<char,char_traits<char> >& basic_ostream<char, char_traits<char> >::operator<<(float f){
-	sentry s(*this);
-	__ostream_printout<char_traits<char>, char, double>::printout(*this, f);
-	return *this;
-}
-
-template <> basic_ostream<char,char_traits<char> >& basic_ostream<char, char_traits<char> >::operator<<(double f){
-	sentry s(*this);
-	__ostream_printout<char_traits<char>, char, double>::printout(*this, f);
-	return *this;
-}
-
-template <> basic_ostream<char, char_traits<char> >& basic_ostream<char, char_traits<char> >::operator<<(long double f){
-	sentry s(*this);
-	__ostream_printout<char_traits<char>, char, long double>::printout(*this, f);
-	return *this;
-}
-
-template <> basic_ostream<char, char_traits<char> >& basic_ostream<char, char_traits<char> >::operator<<(void* p){
-	sentry s(*this);
-	__ostream_printout<char_traits<char>, char, void *>::printout(*this, p);
-	return *this;
-}
-
-template <> basic_ostream<char, char_traits<char> >&
-	basic_ostream<char, char_traits<char> >::operator<<(basic_streambuf<char, char_traits<char> >* sb)
-{
-	sentry s(*this);
-	__ostream_printout<char_traits<char>, char, basic_streambuf<char, char_traits<char> > * >::printout(*this, sb);
-	return *this;
-}
-
-
-template <> basic_ostream<char,char_traits<char> >&
-	endl(basic_ostream<char,char_traits<char> >& os)
-{
-	os.put('\n');
-	os.flush();
-	return os;
-}
-
-template <> basic_ostream<char,char_traits<char> >&
-	flush(basic_ostream<char,char_traits<char> >& os)
-{
-	os.flush();
-	return os;
-}
+	template basic_ostream<char, char_traits<char> >::~basic_ostream();
 
+	template basic_ostream<char,char_traits<char> > & basic_ostream<char, char_traits<char> >::operator<<(bool n);
+	template basic_ostream<char,char_traits<char> > & basic_ostream<char, char_traits<char> >::operator<<(short int n);
+	template basic_ostream<char,char_traits<char> > & basic_ostream<char, char_traits<char> >::
+		operator<<(unsigned short int n);
+	template basic_ostream<char,char_traits<char> > & basic_ostream<char, char_traits<char> >::operator<<(int n);
+	template basic_ostream<char,char_traits<char> > & basic_ostream<char, char_traits<char> >::operator<<(unsigned int n);
+	template basic_ostream<char,char_traits<char> > & basic_ostream<char, char_traits<char> >::operator<<(long n);
+	template basic_ostream<char,char_traits<char> > & basic_ostream<char, char_traits<char> >::operator<<(unsigned long n);
+	template basic_ostream<char,char_traits<char> > & basic_ostream<char, char_traits<char> >::operator<<(float f);
+	template basic_ostream<char,char_traits<char> > & basic_ostream<char, char_traits<char> >::operator<<(double f);
+	template basic_ostream<char,char_traits<char> > & basic_ostream<char, char_traits<char> >::operator<<(long double f);
+	template basic_ostream<char,char_traits<char> > & basic_ostream<char, char_traits<char> >::operator<<(void* p);
+	template basic_ostream<char,char_traits<char> > &
+		basic_ostream<char, char_traits<char> >::operator<<(basic_streambuf<char, char_traits<char> >* sb);
+
+
+	template basic_ostream<char,char_traits<char> >& endl(basic_ostream<char,char_traits<char> >& os);
+	template basic_ostream<char,char_traits<char> >& flush(basic_ostream<char,char_traits<char> >& os);
+	template basic_ostream<char,char_traits<char> >& operator<<(basic_ostream<char,char_traits<char> >& out, const char* c);
 
 #endif
 
-
-template<> basic_ostream<char,char_traits<char> >& operator<<(basic_ostream<char,char_traits<char> >& out, const char* c){
-	basic_ostream<char, char_traits<char> >::sentry s(out);
-	out.write(c, char_traits<char>::length(c));
-	return out;
-}
-
-
 }
--- /var/cvs/uClibc++/src/sstream.cpp	2004/09/01 16:39:31	1.1
+++ /var/cvs/uClibc++/src/sstream.cpp	2004/12/18 22:00:49	1.2
@@ -22,9 +22,10 @@
 namespace std{
 
 
+#ifdef __UCLIBCXX_EXPAND_STRING_CHAR__
 
 
-
+#endif
 
 
 }
--- /var/cvs/uClibc++/src/string.cpp	2004/09/01 16:39:31	1.4
+++ /var/cvs/uClibc++/src/string.cpp	2004/12/18 22:00:49	1.5
@@ -17,35 +17,34 @@
 	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
+#define __UCLIBCXX_COMPILE_STRING__ 1
+
 #include <basic_definitions>
 #include <char_traits>
 #include <string>
+#include <string_iostream>
 #include <string.h>
 #include <ostream>
 
 namespace std{
 
 #ifdef __UCLIBCXX_EXPAND_STRING_CHAR__
-//Pure string functions
-	template<> basic_string<char,char_traits<char>, allocator<char> >::
-		basic_string(const char* s, const allocator<char>& al)
-		: vector<char, allocator<char> >(al)
-	{
-		__string_helper_functions<char, char_traits<char>, allocator<char> >::constructor(*this, s);
-		
-	}
 
+	template basic_string<char,char_traits<char>, allocator<char> >::basic_string(const char* s, const allocator<char>& al);
+
+	template basic_string<char, char_traits<char>, allocator<char> >
+		operator+(const basic_string<char, char_traits<char>, allocator<char> >& lhs, const char* rhs);
+
+	template basic_string<char, char_traits<char>, allocator<char> >
+		operator+(const char* lhs, const basic_string<char, char_traits<char>, allocator<char> >& rhs);
 
 
 //Functions dependent upon OSTREAM
 #ifdef __UCLIBCXX_EXPAND_OSTREAM_CHAR__
 
-template<> basic_ostream<char, char_traits<char> >& 
+template basic_ostream<char, char_traits<char> >&
 	operator<<(basic_ostream<char, char_traits<char> >& os,
-	const basic_string<char,char_traits<char>, std::allocator<char> >& str)
-{
-	return os.write(str.data(), str.length());
-}
+	const basic_string<char,char_traits<char>, std::allocator<char> >& str);
 
 #endif
 
@@ -53,14 +52,9 @@
 //Functions dependent upon ISTREAM
 #ifdef __UCLIBCXX_EXPAND_ISTREAM_CHAR__
 
-template<> basic_istream<char, char_traits<char> >& operator>>(
+template basic_istream<char, char_traits<char> >& operator>>(
 	basic_istream<char,char_traits<char> >& is,
-	basic_string<char, char_traits<char>,
-	allocator<char> >& str)
-{
-	return __string_helper_functions<char, char_traits<char>, allocator<char> >::op_right_right(is, str);
-	
-}
+	basic_string<char, char_traits<char>, allocator<char> >& str);
 
 
 #endif
--- /var/cvs/uClibc++/src/vector.cpp	2004/09/01 16:39:31	1.4
+++ /var/cvs/uClibc++/src/vector.cpp	2004/12/18 22:00:49	1.5
@@ -17,6 +17,9 @@
 	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
+#define __UCLIBCXX_COMPILE_VECTOR__ 1
+
+
 #include <vector>
 
 namespace std{
@@ -24,119 +27,29 @@
 
 #ifdef __UCLIBCXX_EXPAND_VECTOR_BASIC__
 
-	template<> void vector<char, allocator<char> >::reserve(size_type n){
-		__vector_helper_functions<char, allocator<char> >::
-			reserve(*this, n);
-	}
-
-	template<> void vector<unsigned char, allocator<unsigned char> >::reserve(size_type n){
-		__vector_helper_functions<unsigned char, allocator<unsigned char> >::
-			reserve(*this, n);
-	}
-
-	template<> void vector<short int, allocator<short int> >::reserve(size_type n){
-		__vector_helper_functions<short int, allocator<short int> >::
-			reserve(*this, n);
-	}
-
-	template<> void vector<unsigned short int, allocator<unsigned short int> >::reserve(size_type n){
-		__vector_helper_functions<unsigned short int, allocator<unsigned short int> >::
-			reserve(*this, n);
-	}
-
-	template<> void vector<int, allocator<int> >::reserve(size_type n){
-		__vector_helper_functions<int, allocator<int> >::
-			reserve(*this, n);
-	}
-
-	template<> void vector<unsigned int, allocator<unsigned int> >::reserve(size_type n){
-		__vector_helper_functions<unsigned int, allocator<unsigned int> >::
-			reserve(*this, n);
-	}
-
-	template<> void vector<long int, allocator<long int> >::reserve(size_type n){
-		__vector_helper_functions<long int, allocator<long int> >::
-			reserve(*this, n);
-	}
-
-	template<> void vector<unsigned long int, allocator<unsigned long int> >::reserve(size_type n){
-		__vector_helper_functions<unsigned long int, allocator<unsigned long int> >::
-			reserve(*this, n);
-	}
-
-	template<> void vector<float, allocator<float> >::reserve(size_type n){
-		__vector_helper_functions<float, allocator<float> >::
-			reserve(*this, n);
-	}
-
-	template<> void vector<double, allocator<double> >::reserve(size_type n){
-		__vector_helper_functions<double, allocator<double> >::
-			reserve(*this, n);
-	}
-
-	template<> void vector<bool, allocator<bool> >::reserve(size_type n){
-		__vector_helper_functions<bool, allocator<bool> >::
-			reserve(*this, n);
-	}
-
-
-
-
-	template<> void vector<char, allocator<char> >::resize(size_type sz, char c){
-		__vector_helper_functions<char, allocator<char> >::
-			resize(*this, sz, c);
-	}
-
-	template<> void vector<unsigned char, allocator<unsigned char> >::resize(size_type sz, unsigned char c){
-		__vector_helper_functions<unsigned char, allocator<unsigned char> >::
-			resize(*this, sz, c);
-	}
-
-	template<> void vector<short int, allocator<short int> >::resize(size_type sz, short int c){
-		__vector_helper_functions<short int, allocator<short int> >::
-			resize(*this, sz, c);
-	}
-
-	template<> void vector<unsigned short int, allocator<unsigned short int> >::resize(size_type sz, unsigned short int c){
-		__vector_helper_functions<unsigned short int, allocator<unsigned short int> >::
-			resize(*this, sz, c);
-	}
-
-	template<> void vector<int, allocator<int> >::resize(size_type sz, int c){
-		__vector_helper_functions<int, allocator<int> >::
-			resize(*this, sz, c);
-	}
-
-	template<> void vector<unsigned int, allocator<unsigned int> >::resize(size_type sz, unsigned int c){
-		__vector_helper_functions<unsigned int, allocator<unsigned int> >::
-			resize(*this, sz, c);
-	}
-
-	template<> void vector<long int, allocator<long int> >::resize(size_type sz, long int c){
-		__vector_helper_functions<long int, allocator<long int> >::
-			resize(*this, sz, c);
-	}
-
-	template<> void vector<unsigned long int, allocator<unsigned long int> >::resize(size_type sz, unsigned long int c){
-		__vector_helper_functions<unsigned long int, allocator<unsigned long int> >::
-			resize(*this, sz, c);
-	}
-
-	template<> void vector<float, allocator<float> >::resize(size_type sz, float c){
-		__vector_helper_functions<float, allocator<float> >::
-			resize(*this, sz, c);
-	}
-
-	template<> void vector<double, allocator<double> >::resize(size_type sz, double c){
-		__vector_helper_functions<double, allocator<double> >::
-			resize(*this, sz, c);
-	}
-
-	template<> void vector<bool, allocator<bool> >::resize(size_type sz, bool c){
-		__vector_helper_functions<bool, allocator<bool> >::
-			resize(*this, sz, c);
-	}
-
+	template void vector<char, allocator<char> >::reserve(size_type n);
+	template void vector<unsigned char, allocator<unsigned char> >::reserve(size_type n);
+	template void vector<short int, allocator<short int> >::reserve(size_type n);
+	template void vector<unsigned short int, allocator<unsigned short int> >::reserve(size_type n);
+	template void vector<int, allocator<int> >::reserve(size_type n);
+	template void vector<unsigned int, allocator<unsigned int> >::reserve(size_type n);
+	template void vector<long int, allocator<long int> >::reserve(size_type n);
+	template void vector<unsigned long int, allocator<unsigned long int> >::reserve(size_type n);
+	template void vector<float, allocator<float> >::reserve(size_type n);
+	template void vector<double, allocator<double> >::reserve(size_type n);
+	template void vector<bool, allocator<bool> >::reserve(size_type n);
+
+	template void vector<char, allocator<char> >::resize(size_type sz, char c);
+	template void vector<unsigned char, allocator<unsigned char> >::resize(size_type sz, unsigned char c);
+	template void vector<short int, allocator<short int> >::resize(size_type sz, short c);
+	template void vector<unsigned short int, allocator<unsigned short int> >::resize(size_type sz, unsigned short int c);
+	template void vector<int, allocator<int> >::resize(size_type sz, int c);
+	template void vector<unsigned int, allocator<unsigned int> >::resize(size_type sz, unsigned int c);
+	template void vector<long int, allocator<long int> >::resize(size_type sz, long int c);
+	template void vector<unsigned long int, allocator<unsigned long int> >::resize(size_type sz, unsigned long int c);
+	template void vector<float, allocator<float> >::resize(size_type sz, float c);
+	template void vector<double, allocator<double> >::resize(size_type sz, double c);
+	template void vector<bool, allocator<bool> >::resize(size_type sz, bool c);
 
 
 #endif



More information about the uClibc-cvs mailing list