]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fix exception specification for rand() in tests
authorTimo Heister <timo.heister@gmail.com>
Thu, 21 Nov 2013 15:44:42 +0000 (15:44 +0000)
committerTimo Heister <timo.heister@gmail.com>
Thu, 21 Nov 2013 15:44:42 +0000 (15:44 +0000)
git-svn-id: https://svn.dealii.org/trunk@31746 0785d39b-7218-0410-832d-ea1e28bc413d

tests/tests.h

index c7cf65ac838f93869b9db64851d226d51a08eb7b..bcc14d635efc641f63d08530d887cbbb4af06c43 100644 (file)
@@ -36,7 +36,7 @@
 // Cygwin has a different implementation for rand() which causes many tests to fail.
 // This here is a reimplementation that gives the same sequence of numbers as a program
 // that uses rand() on a typical linux machine.
-int myrand(bool reseed=false, int seed=1)
+int myrand(bool reseed=false, int seed=1) throw()
 {
   static int r[32];
   static int k;
@@ -76,20 +76,17 @@ int myrand(bool reseed=false, int seed=1)
 }
 
 // reseed our random number generator
-void mysrand(int seed)
+void mysrand(int seed) throw()
 {
   myrand(true, seed);
 }
 
-
-// I hope this is safe to just override the standard
-// rand() functions here.
-int rand()
+int rand() throw()
 {
   return myrand();
 }
 
-void srand(int seed)
+void srand(int seed) throw()
 {
   mysrand(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.