From 40731e8f2d80b8d420fd799fade3e4136497e3de Mon Sep 17 00:00:00 2001 From: wolf Date: Wed, 10 Jan 2001 17:17:06 +0000 Subject: [PATCH] Take over several fixes discovered by testing with DECs cxx from the main branch. git-svn-id: https://svn.dealii.org/branches/Branch-3-1@3639 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/include/base/exceptions.h | 2 +- deal.II/base/include/base/tensor_base.h | 1 - deal.II/base/include/base/thread_management.h | 169 +++++++++++++++++- deal.II/base/source/quadrature.cc | 3 +- deal.II/base/source/thread_management.cc | 9 +- 5 files changed, 177 insertions(+), 7 deletions(-) diff --git a/deal.II/base/include/base/exceptions.h b/deal.II/base/include/base/exceptions.h index 5aa2a879b3..c6df148655 100644 --- a/deal.II/base/include/base/exceptions.h +++ b/deal.II/base/include/base/exceptions.h @@ -491,7 +491,7 @@ void __IssueError_Throw (const char *file, * @author Wolfgang Bangerth, November 1997 */ #define DeclException0(Exception0) \ -class Exception0 : public ExceptionBase {}; +class Exception0 : public ExceptionBase {} diff --git a/deal.II/base/include/base/tensor_base.h b/deal.II/base/include/base/tensor_base.h index 8eb3d210c8..32cefb3a0a 100644 --- a/deal.II/base/include/base/tensor_base.h +++ b/deal.II/base/include/base/tensor_base.h @@ -492,7 +492,6 @@ ostream & operator << (ostream &out, const Tensor<1,dim> &p) * implemented specialized from the general template in order to avoid * a compiler warning that the loop is empty. */ -template <> inline ostream & operator << (ostream &out, const Tensor<1,1> &p) { diff --git a/deal.II/base/include/base/thread_management.h b/deal.II/base/include/base/thread_management.h index b660d23c7a..36e4420043 100644 --- a/deal.II/base/include/base/thread_management.h +++ b/deal.II/base/include/base/thread_management.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2000 by the deal.II authors +// Copyright (C) 2000, 2001 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -383,6 +383,17 @@ namespace Threads */ FunPtr fun_ptr; }; + +// we should be declaring the following function friend, but gcc2.95 +// does not allow us to do that at present... +// /** +// * Declare a function that uses +// * the @ref{ArgCollector} as +// * friend. +// */ +// friend +// FunData0::ArgCollector +// encapsulate (void (*fun_ptr)()); }; @@ -485,6 +496,16 @@ namespace Threads */ FunPtr fun_ptr; }; + + /** + * Declare a function that uses + * the @ref{ArgCollector} as + * friend. + */ + template + friend + typename FunData1::ArgCollector + encapsulate (void (*fun_ptr)(Arg1_)); }; @@ -590,6 +611,16 @@ namespace Threads */ FunPtr fun_ptr; }; + + /** + * Declare a function that uses + * the @ref{ArgCollector} as + * friend. + */ + template + friend + typename FunData2::ArgCollector + encapsulate (void (*fun_ptr)(Arg1_, Arg2_)); }; @@ -697,6 +728,16 @@ namespace Threads */ FunPtr fun_ptr; }; + + /** + * Declare a function that uses + * the @ref{ArgCollector} as + * friend. + */ + template + friend + typename FunData3::ArgCollector + encapsulate (void (*fun_ptr)(Arg1_,Arg2_,Arg3_)); }; @@ -807,6 +848,16 @@ namespace Threads */ FunPtr fun_ptr; }; + + /** + * Declare a function that uses + * the @ref{ArgCollector} as + * friend. + */ + template + friend + typename FunData4::ArgCollector + encapsulate (void (*fun_ptr)(Arg1_, Arg2_, Arg3_, Arg4_)); }; @@ -921,6 +972,16 @@ namespace Threads */ FunPtr fun_ptr; }; + + /** + * Declare a function that uses + * the @ref{ArgCollector} as + * friend. + */ + template + friend + typename FunData5::ArgCollector + encapsulate (void (*fun_ptr)(Arg1_, Arg2_, Arg3_, Arg4_, Arg5_)); }; @@ -1037,6 +1098,17 @@ namespace Threads */ FunPtr fun_ptr; }; + + /** + * Declare a function that uses + * the @ref{ArgCollector} as + * friend. + */ + template + friend + typename FunData6::ArgCollector + encapsulate (void (*fun_ptr)(Arg1_, Arg2_, Arg3_, + Arg4_, Arg5_, Arg6_)); }; @@ -1156,6 +1228,17 @@ namespace Threads */ FunPtr fun_ptr; }; + + /** + * Declare a function that uses + * the @ref{ArgCollector} as + * friend. + */ + template + friend + typename FunData7::ArgCollector + encapsulate (void (*fun_ptr)(Arg1_, Arg2_, Arg3_, + Arg4_, Arg5_, Arg6_, Arg7_)); }; @@ -1278,6 +1361,18 @@ namespace Threads */ FunPtr fun_ptr; }; + + /** + * Declare a function that uses + * the @ref{ArgCollector} as + * friend. + */ + template + friend + typename FunData8::ArgCollector + encapsulate (void (*fun_ptr)(Arg1_, Arg2_, Arg3_, + Arg4_, Arg5_, Arg6_, + Arg7_, Arg8_)); }; @@ -1393,6 +1488,16 @@ namespace Threads */ FunPtr fun_ptr; }; + + /** + * Declare a function that uses + * the @ref{ArgCollector} as + * friend. + */ + template + friend + typename MemFunData0::ArgCollector + encapsulate (void (Class_::*fun_ptr)()); }; @@ -1518,6 +1623,16 @@ namespace Threads */ FunPtr fun_ptr; }; + + /** + * Declare a function that uses + * the @ref{ArgCollector} as + * friend. + */ + template + friend + typename MemFunData1::ArgCollector + encapsulate (void (Class_::*fun_ptr)(Arg1_)); }; @@ -1647,6 +1762,16 @@ namespace Threads */ FunPtr fun_ptr; }; + + /** + * Declare a function that uses + * the @ref{ArgCollector} as + * friend. + */ + template + friend + typename MemFunData2::ArgCollector + encapsulate (void (Class_::*fun_ptr)(Arg1_, Arg2_)); }; @@ -1779,6 +1904,16 @@ namespace Threads */ FunPtr fun_ptr; }; + + /** + * Declare a function that uses + * the @ref{ArgCollector} as + * friend. + */ + template + friend + typename MemFunData3::ArgCollector + encapsulate (void (Class_::*fun_ptr)(Arg1_,Arg2_,Arg3_)); }; @@ -1915,6 +2050,16 @@ namespace Threads */ FunPtr fun_ptr; }; + + /** + * Declare a function that uses + * the @ref{ArgCollector} as + * friend. + */ + template + friend + typename MemFunData4::ArgCollector + encapsulate (void (Class_::*fun_ptr)(Arg1_, Arg2_, Arg3_, Arg4_)); }; @@ -2055,6 +2200,17 @@ namespace Threads */ FunPtr fun_ptr; }; + + /** + * Declare a function that uses + * the @ref{ArgCollector} as + * friend. + */ + template + friend + typename MemFunData5::ArgCollector + encapsulate (void (Class_::*fun_ptr)(Arg1_, Arg2_, Arg3_, + Arg4_, Arg5_)); }; @@ -2199,6 +2355,17 @@ namespace Threads */ FunPtr fun_ptr; }; + + /** + * Declare a function that uses + * the @ref{ArgCollector} as + * friend. + */ + template + friend + typename MemFunData6::ArgCollector + encapsulate (void (Class_::*fun_ptr)(Arg1_, Arg2_, Arg3_, + Arg4_, Arg5_, Arg6_)); }; diff --git a/deal.II/base/source/quadrature.cc b/deal.II/base/source/quadrature.cc index 4009ab68ba..3cf6e79823 100644 --- a/deal.II/base/source/quadrature.cc +++ b/deal.II/base/source/quadrature.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1998, 1999, 2000 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -49,6 +49,7 @@ Quadrature::Quadrature (const vector > & points, template <> Quadrature<0>::Quadrature (const Quadrature<-1> &, const Quadrature<1> &) + : n_quadrature_points (0) { Assert (false, ExcInternalError()); }; diff --git a/deal.II/base/source/thread_management.cc b/deal.II/base/source/thread_management.cc index 0ce3df3d18..e761faf658 100644 --- a/deal.II/base/source/thread_management.cc +++ b/deal.II/base/source/thread_management.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2000 by the deal.II authors +// Copyright (C) 2000, 2001 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -101,8 +101,11 @@ namespace Threads const FunEncapsulation & FunEncapsulation::operator = (const FunEncapsulation &/*fun_data*/) { - // this is not implemented at present - abort (); + // this is not implemented at + // present. return dummy value + // instead + Assert (false, ExcNotImplemented()); + return *static_cast(0); }; -- 2.39.5