A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Supernovae mode was deprecated. It is currently broken too. Remove it.
[simgrid.git]
/
src
/
xbt
/
RngStream.c
diff --git
a/src/xbt/RngStream.c
b/src/xbt/RngStream.c
index
a5a3313
..
e4dbbb5
100644
(file)
--- a/
src/xbt/RngStream.c
+++ b/
src/xbt/RngStream.c
@@
-1,3
+1,9
@@
+/* Copyright (c) 2012, 2014. The SimGrid Team.
+ * All rights reserved. */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
/***********************************************************************\
*
* File: RngStream.c for multiple streams of Random Numbers
/***********************************************************************\
*
* File: RngStream.c for multiple streams of Random Numbers
@@
-13,6
+19,7
@@
#include "xbt/RngStream.h"
#include "xbt/RngStream.h"
+#include "xbt/sysdep.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@
-311,14
+318,14
@@
RngStream RngStream_CreateStream (const char name[])
RngStream g;
size_t len;
RngStream g;
size_t len;
- g = (RngStream) malloc (sizeof (struct RngStream_InfoState));
+ g = (RngStream)
xbt_
malloc (sizeof (struct RngStream_InfoState));
if (g == NULL) {
printf ("RngStream_CreateStream: No more memory\n\n");
exit (EXIT_FAILURE);
}
if (name) {
len = strlen (name);
if (g == NULL) {
printf ("RngStream_CreateStream: No more memory\n\n");
exit (EXIT_FAILURE);
}
if (name) {
len = strlen (name);
- g->name = (char *) malloc ((len + 1) * sizeof (char));
+ g->name = (char *)
xbt_
malloc ((len + 1) * sizeof (char));
strncpy (g->name, name, len + 1);
} else
g->name = 0;
strncpy (g->name, name, len + 1);
} else
g->name = 0;
@@
-355,7
+362,7
@@
RngStream RngStream_CopyStream (const RngStream src)
exit (EXIT_FAILURE);
}
exit (EXIT_FAILURE);
}
- g = (RngStream) malloc (sizeof (struct RngStream_InfoState));
+ g = (RngStream)
xbt_
malloc (sizeof (struct RngStream_InfoState));
if (g == NULL) {
printf ("RngStream_CopyStream: No more memory\n\n");
exit (EXIT_FAILURE);
if (g == NULL) {
printf ("RngStream_CopyStream: No more memory\n\n");
exit (EXIT_FAILURE);
@@
-538,15
+545,3
@@
int RngStream_RandInt (RngStream g, int i, int j)
{
return i + (int) ((j - i + 1.0) * RngStream_RandU01 (g));
}
{
return i + (int) ((j - i + 1.0) * RngStream_RandU01 (g));
}
-
-/* Undefine this terms, or supernovae build will fail. */
-#undef norm
-#undef m1
-#undef m2
-#undef a12
-#undef a13n
-#undef a21
-#undef a23n
-#undef two17
-#undef two53
-#undef fact