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
/
normal.c
diff --git
a/netem/normal.c
b/netem/normal.c
index
e6683db
..
dbdebb1
100644
(file)
--- a/
netem/normal.c
+++ b/
netem/normal.c
@@
-20,21
+20,16
@@
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));
}
+
int
main(int argc, char **argv)
{
int
main(int argc, char **argv)
{
- double x, *table;
int i, n;
int i, n;
-
- table = calloc(sizeof(double), TABLESIZE+1);
- if (!table) {
- fprintf(stderr, "Not enough memory\n");
- return 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;
}
table[i] = x;
}
@@
-51,6
+46,6
@@
main(int argc, char **argv)
n = 0;
}
}
n = 0;
}
}
- free(table);
+
return 0;
}
return 0;
}