summaryrefslogtreecommitdiffstats
path: root/libsh/rand.sh
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2016-02-19 02:35:23 (EST)
committer P. J. McDermott <pj@pehjota.net>2016-02-19 02:35:23 (EST)
commita9f84d9757aad50db3f1d7e11c6e779b920ed96b (patch)
tree103d2da4d0ed2698e2728dade5f225ccb11730d0 /libsh/rand.sh
parent5da1775daf87fe38d46dcdeef6ed64c6fac0bd29 (diff)
downloadeggshell-a9f84d9757aad50db3f1d7e11c6e779b920ed96b.zip
eggshell-a9f84d9757aad50db3f1d7e11c6e779b920ed96b.tar.gz
eggshell-a9f84d9757aad50db3f1d7e11c6e779b920ed96b.tar.bz2
libsh: Use parameter lists instead of aliases
Diffstat (limited to 'libsh/rand.sh')
-rw-r--r--libsh/rand.sh13
1 files changed, 2 insertions, 11 deletions
diff --git a/libsh/rand.sh b/libsh/rand.sh
index 07347d3..7efcc3b 100644
--- a/libsh/rand.sh
+++ b/libsh/rand.sh
@@ -22,25 +22,16 @@ static x=1
rand_x=1
-static srand()
+srand(int s)
{
- local s="${1}"
-
x=${s}
rand_x=${s}
}
-static rand()
+rand(void)
{
# Multiplier, increment, and modulus values are those used in glibc.
x=$((1103515245 * ${x} + 12345))
x=$((${x} % (${RAND_MAX} + 1)))
rand_x=${x}
}
-
-static rand_alias()
-{
- __alias ${srand} srand int
- __alias ${rand} rand
-}
-__init ${rand_alias}