Bump version number. Remove bogus copyright line. Don't distribute the kdevelop proje...
authordarco <darco@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Wed, 9 Nov 2005 16:25:21 +0000 (16:25 +0000)
committerdarco <darco@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Wed, 9 Nov 2005 16:25:21 +0000 (16:25 +0000)
git-svn-id: http://svn.voria.com/code@52 1f10aa63-cdf2-0310-b900-c93c546f37ac

14 files changed:
ETL/trunk/ETL.pbproj/frameworkfix.cpp
ETL/trunk/ETL.pc.in
ETL/trunk/ETL/_clock_gettimeofday.h
ETL/trunk/ETL/_curve_func.h
ETL/trunk/ETL/_fixed.h
ETL/trunk/ETL/_handle.h
ETL/trunk/ETL/_smart_ptr.h
ETL/trunk/Makefile.am
ETL/trunk/config/build.cfg
ETL/trunk/doxygen.cfg
ETL/trunk/test/Makefile.am
ETL/trunk/test/fixed.cpp
ETL/trunk/test/handle.cpp
ETL/trunk/test/smart_ptr.cpp

index 83f0e3a..0aee6e8 100644 (file)
@@ -3,7 +3,6 @@
  *  ETL
  *
  *  Created by Robert Quattlebaum on Mon Aug 26 2002.
- *  Copyright (c) 2002 __MyCompanyName__. All rights reserved.
  *
  */
 
index 04ef18f..8b8dcd4 100644 (file)
@@ -6,6 +6,6 @@ includedir=@includedir@
 Name: ETL
 Description: Voria Extended Class and Template Library
 Requires:
-Version: 0.04.06
+Version: 0.04.07
 Libs: @LIBS@
 Cflags: -I${includedir}
index 8626c73..ab6a770 100644 (file)
@@ -87,7 +87,7 @@ protected:
                        return ret;
                }
 
-               inline timestamp &operator+(timestamp rhs)const
+               inline timestamp operator+(timestamp rhs)const
                {
                        rhs.tv_usec+=tv_usec;
                        
index b578888..b1be012 100644 (file)
@@ -43,7 +43,7 @@ struct affine_combo
 
        T reverse(const T &x, const T &b, const K &t)const
        {
-               return T( (x-b*t)*(static_cast<K>(1)/(static_cast<K>(1)-t)) );
+               return T( (x-t*b)*(static_cast<K>(1)/(static_cast<K>(1)-t)) );
        }       
 };
 
index cf69fc1..642e164 100644 (file)
@@ -111,12 +111,12 @@ private:
        class raw { };
 public:
        fixed_base()ETL_ATTRIB_INLINE;
-       fixed_base(const _fixed &x)ETL_ATTRIB_INLINE;
        fixed_base(const float &f)ETL_ATTRIB_INLINE;
        fixed_base(const double &f)ETL_ATTRIB_INLINE;
        fixed_base(const long double &f)ETL_ATTRIB_INLINE;
        fixed_base(const int &i)ETL_ATTRIB_INLINE;
        fixed_base(const int &n,const int &d)ETL_ATTRIB_INLINE; //!< Fraction constructor
+       fixed_base(const _fixed &x)ETL_ATTRIB_INLINE;
        fixed_base(value_type x,raw)ETL_ATTRIB_INLINE;
 
        T &data() ETL_ATTRIB_PURE ETL_ATTRIB_INLINE;    
@@ -142,6 +142,8 @@ public:
        _fixed operator/(const _fixed &rhs)const ETL_ATTRIB_INLINE;
        _fixed operator*(const int &rhs)const ETL_ATTRIB_INLINE;
        _fixed operator/(const int &rhs)const ETL_ATTRIB_INLINE;
+       _fixed operator*(const float &rhs)const ETL_ATTRIB_INLINE;
+       _fixed operator*(const double &rhs)const ETL_ATTRIB_INLINE;
        
        // Negation Operator
        _fixed operator-()const ETL_ATTRIB_INLINE;
@@ -175,15 +177,15 @@ fixed_base<T,FIXED_BITS>::fixed_base(const _fixed &x):_data(x._data)
 {}
 
 template <class T,unsigned int FIXED_BITS>
-fixed_base<T,FIXED_BITS>::fixed_base(const float &f):_data(static_cast<value_type>(f*_ONE()+0.5f))
+fixed_base<T,FIXED_BITS>::fixed_base(const float &f):_data(static_cast<value_type>(f*_ONE()/*+0.5f*/))
 {}
 
 template <class T,unsigned int FIXED_BITS>
-fixed_base<T,FIXED_BITS>::fixed_base(const double &f):_data(static_cast<value_type>(f*_ONE()+0.5))
+fixed_base<T,FIXED_BITS>::fixed_base(const double &f):_data(static_cast<value_type>(f*_ONE()/*+0.5*/))
 {}
 
 template <class T,unsigned int FIXED_BITS>
-fixed_base<T,FIXED_BITS>::fixed_base(const long double &f):_data(static_cast<value_type>(f*_ONE()+0.5))
+fixed_base<T,FIXED_BITS>::fixed_base(const long double &f):_data(static_cast<value_type>(f*_ONE()/*+0.5*/))
 {}
 
 template <class T,unsigned int FIXED_BITS>
@@ -394,6 +396,21 @@ fixed_base<T,FIXED_BITS>::operator*(const int &rhs)const
        //return reinterpret_cast<_fixed>(_data*rhs);
 }
 
+//! fixed * float
+template <class T,unsigned int FIXED_BITS>fixed_base<T,FIXED_BITS>
+fixed_base<T,FIXED_BITS>::operator*(const float &rhs)const 
+{
+    return (*this)*_fixed(rhs);
+}
+
+//! fixed * double
+template <class T,unsigned int FIXED_BITS>fixed_base<T,FIXED_BITS>
+fixed_base<T,FIXED_BITS>::operator*(const double &rhs)const 
+{
+    return (*this)*_fixed(rhs);
+}
+
+
 //! fixed / int
 template <class T,unsigned int FIXED_BITS>fixed_base<T,FIXED_BITS>
 fixed_base<T,FIXED_BITS>::operator/(const int &rhs)const 
@@ -404,7 +421,19 @@ fixed_base<T,FIXED_BITS>::operator/(const int &rhs)const
        //return reinterpret_cast<_fixed>(_data/rhs);
 }
 
+//! float * fixed
+template <class T,unsigned int FIXED_BITS>fixed_base<T,FIXED_BITS>
+operator*(const float& lhs, const fixed_base<T,FIXED_BITS> &rhs) 
+{
+    return rhs*lhs;
+}
 
+//! double * fixed
+template <class T,unsigned int FIXED_BITS>fixed_base<T,FIXED_BITS>
+operator*(const double& lhs, const fixed_base<T,FIXED_BITS> &rhs) 
+{
+    return rhs*lhs;
+}
 
 
 
index 0cf5af2..317f6c2 100644 (file)
@@ -257,14 +257,14 @@ public:
        operator->()const
                { assert(obj); return obj; }
 
-       //! static_cast<> overload -- Useful for implicit casts
-       template <class U>
-       operator handle<U>()const
-       { return handle<U>(static_cast<U*>(obj)); }
+       //! More explicit bool cast
+       operator bool()const
+               { return obj!=NULL; }
 
        operator handle<const value_type>()const
        { return handle<const value_type>(static_cast<const_pointer>(obj)); }
 
+
        //! <tt> static_cast\<\> </tt> wrapper
        template <class U> static
        handle<T> cast_static(const handle<U> &x)
@@ -303,13 +303,14 @@ public:
        //! Returns pointer to the object that is being wrapped
        pointer get()const { return obj; }
 
-       //! More explicit bool cast
-       operator bool()const
-               { return obj!=NULL; }
-
        bool
        operator!()const
                { return !obj; }
+
+       //! static_cast<> overload -- Useful for implicit casts
+       template <class U>
+       operator handle<U>()const
+       { return handle<U>(static_cast<U*>(obj)); }
 }; // END of template class handle
 
 // ========================================================================
index 4609880..479c966 100644 (file)
@@ -178,19 +178,6 @@ public:
 
        pointer operator->()const { assert(obj); return obj; }
 
-       //! Overloaded cast operator -- useful for implicit casts
-       template <class U>
-       operator smart_ptr<U>()
-       {
-               // This next line should provide a syntax check
-               // to make sure that this cast makes sense.
-               // If it doesn't, this should have a compiler error.
-               // Otherwise, it should get optimized right out
-               // of the code.
-               //(U*)obj;
-
-               return *reinterpret_cast<smart_ptr<U>*>(this);
-       }
 
        operator smart_ptr<const value_type>()const
        { return smart_ptr<const value_type>(static_cast<const_pointer>(obj)); }
@@ -217,6 +204,20 @@ public:
 
        bool operator!()const { return !obj; }
 
+       //! Overloaded cast operator -- useful for implicit casts
+       template <class U>
+       operator smart_ptr<U>()
+       {
+               // This next line should provide a syntax check
+               // to make sure that this cast makes sense.
+               // If it doesn't, this should have a compiler error.
+               // Otherwise, it should get optimized right out
+               // of the code.
+               //(U*)obj;
+
+               return *reinterpret_cast<smart_ptr<U>*>(this);
+       }
+
 }; // END of template class smart_ptr
 
 // ========================================================================
index 69d1690..6f67533 100644 (file)
@@ -13,7 +13,7 @@ bin_SCRIPTS=ETL-config
 aclocaldir = $(prefix)/share/aclocal
 
 
-EXTRA_DIST=bootstrap config/depcomp config/cxx_macros.m4 ETL.pbproj/project.pbxproj ETL.pbproj/etl_profile.h ETL.pbproj/frameworkfix.cpp @PACKAGE_TARNAME@-@VERSION@.spec config/project.spec.in config/build.cfg ETL.kdevproj ETL-config.in config/ETL.m4 config/doxygen.cfg.in doxygen.cfg config/pkgconfig.pc.in @PACKAGE_TARNAME@.pc.in
+EXTRA_DIST=bootstrap config/subs.m4 config/depcomp config/cxx_macros.m4 ETL.pbproj/project.pbxproj ETL.pbproj/etl_profile.h ETL.pbproj/frameworkfix.cpp @PACKAGE_TARNAME@-@VERSION@.spec config/project.spec.in config/build.cfg ETL-config.in config/ETL.m4 config/doxygen.cfg.in doxygen.cfg config/pkgconfig.pc.in @PACKAGE_TARNAME@.pc.in
 
 CVS=cvs
 
index 14fc4d3..a9edf09 100644 (file)
@@ -4,7 +4,7 @@ PACKAGE_BUGREPORT="darco@deepdarc.com"
 PACKAGE_TARNAME="ETL"
 VERSION_MAJ="0"
 VERSION_MIN="04"
-VERSION_REV="06"
+VERSION_REV="07"
 VERSION_REL="1"
 
 VERSION=$VERSION_MAJ.$VERSION_MIN.$VERSION_REV
index b1adccf..776e0d7 100644 (file)
@@ -23,7 +23,7 @@ PROJECT_NAME           = "ETL"
 # This could be handy for archiving the generated documentation or 
 # if some version control system is used.
 
-PROJECT_NUMBER         = 0.04.06
+PROJECT_NUMBER         = 0.04.07
 
 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
 # base path where the generated documentation will be put. 
index 5277f51..e493c0c 100644 (file)
@@ -3,9 +3,9 @@
 MAINTAINERCLEANFILES=Makefile.in
 CXXFLAGS=@CXXFLAGS@ -I$(top_srcdir) -I$(top_builddir)
 DEFAULT_INCLUDES=-I$(top_srcdir) -I$(top_builddir)
-TESTS=value fixed clock handle angle random hermite spline stringf pen surface smart_ptr benchmark
+TESTS=fixed clock handle angle random hermite stringf pen surface smart_ptr benchmark
 
-check_PROGRAMS=value fixed handle clock angle random hermite spline stringf pen surface smart_ptr benchmark smach
+check_PROGRAMS=fixed handle clock angle random hermite stringf pen surface smart_ptr benchmark smach
 
 benchmark_SOURCES=benchmark.cpp
 smart_ptr_SOURCES=smart_ptr.cpp
index fbdac51..030b5c7 100644 (file)
@@ -100,7 +100,7 @@ struct speed_test
                a=value_type(0.25);
                b=value_type(2);
                c=value_type(4.5);
-               const value_type half(0.5);
+               const value_type half(static_cast<value_type>(0.5));
                int i;
                etl::clock MyTimer;
                MyTimer.reset();
index db7a35d..fd40e25 100644 (file)
@@ -85,11 +85,11 @@ typedef list< robj_handle > robj_list;
 
 int handle_basic_test()
 {
-       printf("handle: Size of a handle: %d\n",sizeof(etl::handle<int>));
-       printf("handle: Size of a loose_handle: %d\n",sizeof(etl::loose_handle<int>));
-       printf("handle: Size of a rhandle: %d\n",sizeof(etl::rhandle<int>));
-       printf("handle: Size of a shared_object: %d\n",sizeof(etl::shared_object));
-       printf("handle: Size of a rshared_object: %d\n",sizeof(etl::rshared_object));
+       printf("handle: Size of a handle: %u\n",(unsigned int)sizeof(etl::handle<int>));
+       printf("handle: Size of a loose_handle: %u\n",(unsigned int)sizeof(etl::loose_handle<int>));
+       printf("handle: Size of a rhandle: %u\n",(unsigned int)sizeof(etl::rhandle<int>));
+       printf("handle: Size of a shared_object: %u\n",(unsigned int)sizeof(etl::shared_object));
+       printf("handle: Size of a rshared_object: %u\n",(unsigned int)sizeof(etl::rshared_object));
 
        printf("handle: Basic test: ");
        my_test_obj::instance_count=0;
index 287ada5..e0fc8ba 100644 (file)
@@ -86,8 +86,8 @@ typedef list< other_obj_smart_ptr > other_obj_list;
 
 int smart_ptr_basic_test(void)
 {
-       printf("smart_ptr: Size of a smart_ptr: %d\n",sizeof(obj_smart_ptr));
-       printf("smart_ptr: Size of a reference_counter: %d\n",sizeof(etl::reference_counter));
+       printf("smart_ptr: Size of a smart_ptr: %u\n",(unsigned int)sizeof(obj_smart_ptr));
+       printf("smart_ptr: Size of a reference_counter: %u\n",(unsigned int)sizeof(etl::reference_counter));
 
 
        printf("smart_ptr: Basic test: ");