git://git.onelab.eu
/
iproute2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sync to iproute2-2.6.16-060323
[iproute2.git]
/
netem
/
paretonormal.c
diff --git
a/netem/paretonormal.c
b/netem/paretonormal.c
index
c793df6
..
ed75f28
100644
(file)
--- a/
netem/paretonormal.c
+++ b/
netem/paretonormal.c
@@
-29,7
+29,6
@@
normal(double x, double mu, double sigma)
return .5 + .5*erf((x-mu)/(sqrt(2.0)*sigma));
}
return .5 + .5*erf((x-mu)/(sqrt(2.0)*sigma));
}
-
static const double a=3.0;
static int
static const double a=3.0;
static int
@@
-50,18
+49,12
@@
paretovalue(int i)
int
main(int argc, char **argv)
{
int
main(int argc, char **argv)
{
- double x;
- double *table;
int i,n;
int i,n;
-
- table = calloc(TABLESIZE+1, sizeof(double));
- if (!table) {
- fprintf(stderr, "Out of memory!\n");
- exit(1);
- }
+ double x;
+ double table[TABLESIZE+1];
for (x = -10.0; x < 10.05; x += .00005) {
for (x = -10.0; x < 10.05; x += .00005) {
- i =
(int)
rint(TABLESIZE*normal(x, 0.0, 1.0));
+ i = rint(TABLESIZE*normal(x, 0.0, 1.0));
table[i] = x;
}
printf(
table[i] = x;
}
printf(
@@
-84,7
+77,6
@@
main(int argc, char **argv)
n = 0;
}
}
n = 0;
}
}
- free(table);
return 0;
}
return 0;
}