Skip to content

Commit d8a8183

Browse files
committed
Formatting cleanups.
1 parent 0658a6a commit d8a8183

File tree

1 file changed

+22
-64
lines changed

1 file changed

+22
-64
lines changed

src/backend/utils/mb/wchar.c

Lines changed: 22 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* conversion functions between pg_wchar and multibyte streams.
33
* Tatsuo Ishii
4-
* $PostgreSQL: pgsql/src/backend/utils/mb/wchar.c,v 1.49 2005/12/24 16:49:48 momjian Exp $
4+
* $PostgreSQL: pgsql/src/backend/utils/mb/wchar.c,v 1.50 2005/12/24 17:19:40 momjian Exp $
55
*
66
* WIN1250 client encoding updated by Pavel Behal
77
*
@@ -492,9 +492,7 @@ pg_mule_mblen(const unsigned char *s)
492492
else if (IS_LCPRV2(*s))
493493
len = 4;
494494
else
495-
{ /* assume ASCII */
496-
len = 1;
497-
}
495+
len = 1; /* assume ASCII */
498496
return len;
499497
}
500498

@@ -543,17 +541,11 @@ pg_sjis_mblen(const unsigned char *s)
543541
int len;
544542

545543
if (*s >= 0xa1 && *s <= 0xdf)
546-
{ /* 1 byte kana? */
547-
len = 1;
548-
}
544+
len = 1; /* 1 byte kana? */
549545
else if (*s > 0x7f)
550-
{ /* kanji? */
551-
len = 2;
552-
}
546+
len = 2; /* kanji? */
553547
else
554-
{ /* should be ASCII */
555-
len = 1;
556-
}
548+
len = 1; /* should be ASCII */
557549
return len;
558550
}
559551

@@ -563,17 +555,11 @@ pg_sjis_dsplen(const unsigned char *s)
563555
int len;
564556

565557
if (*s >= 0xa1 && *s <= 0xdf)
566-
{ /* 1 byte kana? */
567-
len = 1;
568-
}
558+
len = 1; /* 1 byte kana? */
569559
else if (*s > 0x7f)
570-
{ /* kanji? */
571-
len = 2;
572-
}
560+
len = 2; /* kanji? */
573561
else
574-
{ /* should be ASCII */
575-
len = 1;
576-
}
562+
len = 1; /* should be ASCII */
577563
return len;
578564
}
579565

@@ -586,13 +572,9 @@ pg_big5_mblen(const unsigned char *s)
586572
int len;
587573

588574
if (*s > 0x7f)
589-
{ /* kanji? */
590-
len = 2;
591-
}
575+
len = 2; /* kanji? */
592576
else
593-
{ /* should be ASCII */
594-
len = 1;
595-
}
577+
len = 1; /* should be ASCII */
596578
return len;
597579
}
598580

@@ -602,13 +584,9 @@ pg_big5_dsplen(const unsigned char *s)
602584
int len;
603585

604586
if (*s > 0x7f)
605-
{ /* kanji? */
606-
len = 2;
607-
}
587+
len = 2; /* kanji? */
608588
else
609-
{ /* should be ASCII */
610-
len = 1;
611-
}
589+
len = 1; /* should be ASCII */
612590
return len;
613591
}
614592

@@ -621,13 +599,9 @@ pg_gbk_mblen(const unsigned char *s)
621599
int len;
622600

623601
if (*s > 0x7f)
624-
{ /* kanji? */
625-
len = 2;
626-
}
602+
len = 2; /* kanji? */
627603
else
628-
{ /* should be ASCII */
629-
len = 1;
630-
}
604+
len = 1; /* should be ASCII */
631605
return len;
632606
}
633607

@@ -637,13 +611,9 @@ pg_gbk_dsplen(const unsigned char *s)
637611
int len;
638612

639613
if (*s > 0x7f)
640-
{ /* kanji? */
641-
len = 2;
642-
}
614+
len = 2; /* kanji? */
643615
else
644-
{ /* should be ASCII */
645-
len = 1;
646-
}
616+
len = 1; /* should be ASCII */
647617
return len;
648618
}
649619

@@ -656,13 +626,9 @@ pg_uhc_mblen(const unsigned char *s)
656626
int len;
657627

658628
if (*s > 0x7f)
659-
{ /* 2byte? */
660-
len = 2;
661-
}
629+
len = 2; /* 2byte? */
662630
else
663-
{ /* should be ASCII */
664-
len = 1;
665-
}
631+
len = 1; /* should be ASCII */
666632
return len;
667633
}
668634

@@ -672,13 +638,9 @@ pg_uhc_dsplen(const unsigned char *s)
672638
int len;
673639

674640
if (*s > 0x7f)
675-
{ /* 2byte? */
676-
len = 2;
677-
}
641+
len = 2; /* 2byte? */
678642
else
679-
{ /* should be ASCII */
680-
len = 1;
681-
}
643+
len = 1; /* should be ASCII */
682644
return len;
683645
}
684646

@@ -692,9 +654,7 @@ pg_gb18030_mblen(const unsigned char *s)
692654
int len;
693655

694656
if (*s <= 0x7f)
695-
{ /* ASCII */
696-
len = 1;
697-
}
657+
len = 1; /* ASCII */
698658
else
699659
{
700660
if ((*(s + 1) >= 0x40 && *(s + 1) <= 0x7e) || (*(s + 1) >= 0x80 && *(s + 1) <= 0xfe))
@@ -713,9 +673,7 @@ pg_gb18030_dsplen(const unsigned char *s)
713673
int len;
714674

715675
if (*s <= 0x7f)
716-
{ /* ASCII */
717-
len = 1;
718-
}
676+
len = 1; /* ASCII */
719677
else
720678
len = 2;
721679
return len;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy