+/* 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
#include "xbt/RngStream.h"
+#include "xbt/sysdep.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
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);
- 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;
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);
{
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