diff options
author | imp <imp@FreeBSD.org> | 2002-02-02 06:50:57 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2002-02-02 06:50:57 +0000 |
commit | 5ef5088ac4e038d0a147a08377ef087fd6edf527 (patch) | |
tree | 01a827446e9ba4f34cf1e754fcac691f6c9eb1cf /bin/sh/mystring.c | |
parent | 50014e35418ca00d25ea852fc4f94acf80be4df3 (diff) | |
download | FreeBSD-src-5ef5088ac4e038d0a147a08377ef087fd6edf527.zip FreeBSD-src-5ef5088ac4e038d0a147a08377ef087fd6edf527.tar.gz |
o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
they already are.
o Change
int
foo() {
...
to
int
foo(void)
{
...
Diffstat (limited to 'bin/sh/mystring.c')
-rw-r--r-- | bin/sh/mystring.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/bin/sh/mystring.c b/bin/sh/mystring.c index 8013f7d..993cbd2 100644 --- a/bin/sh/mystring.c +++ b/bin/sh/mystring.c @@ -77,11 +77,8 @@ char nullstr[1]; /* zero length string */ */ void -scopyn(from, to, size) - char const *from; - char *to; - int size; - { +scopyn(const char *from, char *to, int size) +{ while (--size > 0) { if ((*to++ = *from++) == '\0') @@ -96,10 +93,8 @@ scopyn(from, to, size) */ int -prefix(pfx, string) - char const *pfx; - char const *string; - { +prefix(const char *pfx, const char *string) +{ while (*pfx) { if (*pfx++ != *string++) return 0; @@ -114,10 +109,8 @@ prefix(pfx, string) */ int -number(s) - const char *s; - { - +number(const char *s) +{ if (! is_number(s)) error("Illegal number: %s", (char *)s); return atoi(s); @@ -130,9 +123,8 @@ number(s) */ int -is_number(p) - const char *p; - { +is_number(const char *p) +{ do { if (! is_digit(*p)) return 0; |