From 478b27120b4b95e070302cb3997d1694267765dd Mon Sep 17 00:00:00 2001 From: asfernandes Date: Sun, 12 Oct 2008 15:57:39 +0000 Subject: [PATCH] Misc --- src/intl/cv_big5.cpp | 2 +- src/intl/cv_gb2312.cpp | 2 +- src/intl/cv_ksc.cpp | 13 ++++++------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/intl/cv_big5.cpp b/src/intl/cv_big5.cpp index 8fbee66386..5fccb6da0c 100644 --- a/src/intl/cv_big5.cpp +++ b/src/intl/cv_big5.cpp @@ -154,7 +154,7 @@ ULONG CVBIG5_unicode_to_big5(csconvert* obj, const int tmp2 = big5_ch % 256; if (tmp1 == 0) { /* ASCII character */ - fb_assert((UCHAR(tmp2)&0x80)==0); + fb_assert((UCHAR(tmp2) & 0x80) == 0); *big5_str++ = tmp2; big5_len--; diff --git a/src/intl/cv_gb2312.cpp b/src/intl/cv_gb2312.cpp index 14b7a4e5de..6d3130b391 100644 --- a/src/intl/cv_gb2312.cpp +++ b/src/intl/cv_gb2312.cpp @@ -153,7 +153,7 @@ ULONG CVGB_unicode_to_gb2312(csconvert* obj, const int tmp2 = gb_ch % 256; if (tmp1 == 0) { /* ASCII character */ - fb_assert((UCHAR(tmp2)&0x80)==0); + fb_assert((UCHAR(tmp2) & 0x80) == 0); *gb_str++ = tmp2; gb_len--; diff --git a/src/intl/cv_ksc.cpp b/src/intl/cv_ksc.cpp index 0beaa0ab7c..7472862b29 100644 --- a/src/intl/cv_ksc.cpp +++ b/src/intl/cv_ksc.cpp @@ -65,7 +65,7 @@ ULONG CVKSC_ksc_to_unicode(csconvert* obj, USHORT wide; USHORT this_len; const USHORT* const start = dest_ptr; - while ((src_len) && (dest_len > 1)) { + while (src_len && (dest_len > 1)) { if (*src_ptr & 0x80) { const UCHAR c1 = *src_ptr++; @@ -88,12 +88,11 @@ ULONG CVKSC_ksc_to_unicode(csconvert* obj, } } else { /* it is ASCII */ - wide = *src_ptr++; this_len = 1; } - /* Convert from KSC to UNICODE */ + // Convert from KSC to UNICODE const USHORT ch = ((const USHORT*) impl->csconvert_datatable) [((const USHORT*) impl->csconvert_misc)[(USHORT) wide / 256] + (wide % 256)]; @@ -136,7 +135,7 @@ ULONG CVKSC_unicode_to_ksc(csconvert* obj, const ULONG src_start = unicode_len; *err_code = 0; -/* See if we're only after a length estimate */ + // See if we're only after a length estimate if (ksc_str == NULL) return (unicode_len); @@ -148,7 +147,7 @@ ULONG CVKSC_unicode_to_ksc(csconvert* obj, const USHORT wide = *unicode_str++; const USHORT ksc_ch = ((const USHORT*) impl->csconvert_datatable) - [((const USHORT*) impl->csconvert_misc)[(USHORT)wide / 256] + (wide % 256)]; + [((const USHORT*) impl->csconvert_misc)[(USHORT) wide / 256] + (wide % 256)]; if ((ksc_ch == CS_CANT_MAP) && !(wide == CS_CANT_MAP)) { *err_code = CS_CONVERT_ERROR; break; @@ -158,8 +157,8 @@ ULONG CVKSC_unicode_to_ksc(csconvert* obj, const int tmp2 = ksc_ch % 256; if (tmp1 == 0) { /* ASCII character */ - fb_assert((UCHAR(tmp2)&0x80)==0); - + fb_assert((UCHAR(tmp2) & 0x80) == 0); + *ksc_str++ = tmp2; ksc_len--; unicode_len -= sizeof(*unicode_str);