From a9f84d9757aad50db3f1d7e11c6e779b920ed96b Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Fri, 19 Feb 2016 02:35:23 -0500 Subject: libsh: Use parameter lists instead of aliases --- (limited to 'libsh') diff --git a/libsh/errno.sh b/libsh/errno.sh index a0f9648..fc0c884 100644 --- a/libsh/errno.sh +++ b/libsh/errno.sh @@ -26,10 +26,8 @@ static errlist=' EBADF 7 ' -static strerror() +strerror(int errnum) { - local errnum=${1} - eval "msgget \"\${__errsym_${errnum}}\"" } @@ -45,9 +43,3 @@ static init_error_syms() unset IFS } __init ${init_error_syms} - -static errno_alias() -{ - __alias ${strerror} strerror int -} -__init ${errno_alias} 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} diff --git a/libsh/stdio.sh b/libsh/stdio.sh index 7d44d12..0d00fa5 100644 --- a/libsh/stdio.sh +++ b/libsh/stdio.sh @@ -44,10 +44,8 @@ static fd_9_set=false fd=0 -static fopen() +fopen(string path, string mode) { - local path="${1}" - local mode="${2}" local mode_r= local mode_w= local i= @@ -97,7 +95,7 @@ static fopen() return 0 } -static fclose() +fclose(int f) { local f=${1} @@ -114,10 +112,3 @@ static fclose() return 0 } - -static stdio_alias() -{ - __alias ${fopen} fopen string string - __alias ${fclose} fclose int -} -__init ${stdio_alias} -- cgit v0.9.1