]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix signature of our rand/srand implementations. 2941/head
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 9 Aug 2016 17:44:27 +0000 (12:44 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 9 Aug 2016 17:44:27 +0000 (12:44 -0500)
Since these are functions in our own namespace -- that happen to have the
same names as ones in the std:: namespace, but really independent -- there
is no reason not to use our own conventions. Specifically:
- make input arguments 'const'
- remove the deprecated 'throw()' specification.

tests/tests.h

index d8ae92099055592c148d43b2515f4708beb6b4a4..f258dcb65fd999f2cf673d725ccaa211f7c3da85 100644 (file)
@@ -1,6 +1,6 @@
 // ---------------------------------------------------------------------
 //
-// Copyright (C) 2004 - 2015 by the deal.II authors
+// Copyright (C) 2004 - 2016 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -98,7 +98,8 @@ number get_real_assert_zero_imag(const number &a)
 // we put this into a namespace to not conflict with stdlib
 namespace Testing
 {
-  int rand(bool reseed=false, int seed=1) throw()
+  int rand(const bool reseed=false,
+           const int seed=1)
   {
     static int r[32];
     static int k;
@@ -138,7 +139,7 @@ namespace Testing
   }
 
 // reseed our random number generator
-  void srand(int seed) throw()
+  void srand(const int seed)
   {
     rand(true, seed);
   }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.