summaryrefslogtreecommitdiffstats
path: root/lib/libc/locale
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2002-10-14 01:46:18 +0000
committertjr <tjr@FreeBSD.org>2002-10-14 01:46:18 +0000
commit061d1d394f6b460a40c4fb34c10b1ea817fb03fd (patch)
tree045a5fb48e7a8c1798b2435a1c8253c49f40b6e7 /lib/libc/locale
parentd7c3f247294c62400d5e35f7daea1b5540ea92ec (diff)
downloadFreeBSD-src-061d1d394f6b460a40c4fb34c10b1ea817fb03fd.zip
FreeBSD-src-061d1d394f6b460a40c4fb34c10b1ea817fb03fd.tar.gz
Style changes. Mainly removing excessive whitespace and parens.
Diffstat (limited to 'lib/libc/locale')
-rw-r--r--lib/libc/locale/mskanji.c53
1 files changed, 29 insertions, 24 deletions
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);
}
OpenPOWER on IntegriCloud