From 061d1d394f6b460a40c4fb34c10b1ea817fb03fd Mon Sep 17 00:00:00 2001 From: tjr Date: Mon, 14 Oct 2002 01:46:18 +0000 Subject: Style changes. Mainly removing excessive whitespace and parens. --- lib/libc/locale/mskanji.c | 53 ++++++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 24 deletions(-) (limited to 'lib/libc/locale') diff --git a/lib/libc/locale/mskanji.c b/lib/libc/locale/mskanji.c index 4d1df64..3110299 100644 --- a/lib/libc/locale/mskanji.c +++ b/lib/libc/locale/mskanji.c @@ -67,22 +67,25 @@ _MSKanji_sgetrune(string, n, result) { rune_t rune = 0; - if (n < 1 ) { - rune = _INVALID_RUNE; - } else { - rune = *( string++ ) & 0xff; - if ( ( rune > 0x80 && rune < 0xa0 ) - || ( rune >= 0xe0 && rune < 0xfa ) ) { - if ( n < 2 ) { - rune = (rune_t)_INVALID_RUNE; - --string; - } else { - rune = ( rune << 8 ) | ( *( string++ ) & 0xff ); - } - } + if (n < 1) { + if (result != NULL) + *result = string; + return (_INVALID_RUNE); + } + + rune = *string++ & 0xff; + if ((rune > 0x80 && rune < 0xa0) || + (rune >= 0xe0 && rune < 0xfa)) { + if (n < 2) { + rune = _INVALID_RUNE; + --string; + } else + rune = (rune << 8) | (*string++ & 0xff); } - if (result) *result = string; - return rune; + if (result != NULL) + *result = string; + + return (rune); } int @@ -91,16 +94,18 @@ _MSKanji_sputrune(c, string, n, result) char *string, **result; size_t n; { - int len, i; + int len, i; - len = ( c > 0x100 ) ? 2 : 1; - if ( n < len ) { - if ( result ) *result = (char *) 0; + len = (c > 0x100) ? 2 : 1; + if (n < len) { + if (result != NULL) + *result = NULL; } else { - if ( result ) *result = string + len; - for ( i = len; i-- > 0; ) { - *( string++ ) = c >> ( i << 3 ); - } + if (result != NULL) + *result = string + len; + for (i = len; i-- > 0; ) + *string++ = c >> (i << 3); } - return len; + + return (len); } -- cgit v1.1