* src/autofit/afblue.hin (GET_UTF8_CHAR): Use `do...while(0)'.

* src/autofit/afblue.h: Regenerated.
This commit is contained in:
Werner Lemberg 2015-12-05 13:08:45 +01:00
parent 53696f03ce
commit f7e6d51a75
3 changed files with 64 additions and 52 deletions

View File

@ -1,3 +1,9 @@
2015-12-05 Werner Lemberg <wl@gnu.org>
* src/autofit/afblue.hin (GET_UTF8_CHAR): Use `do...while(0)'.
* src/autofit/afblue.h: Regenerated.
2015-12-05 Werner Lemberg <wl@gnu.org> 2015-12-05 Werner Lemberg <wl@gnu.org>
* src/autofit/afwarp.c: s/INT_MIN/FT_INT_MIN/. * src/autofit/afwarp.c: s/INT_MIN/FT_INT_MIN/.

View File

@ -28,32 +28,35 @@ FT_BEGIN_HEADER
/* an auxiliary macro to decode a UTF-8 character -- since we only use */ /* an auxiliary macro to decode a UTF-8 character -- since we only use */
/* hard-coded, self-converted data, no error checking is performed */ /* hard-coded, self-converted data, no error checking is performed */
#define GET_UTF8_CHAR( ch, p ) \ #define GET_UTF8_CHAR( ch, p ) \
ch = (unsigned char)*p++; \ do \
if ( ch >= 0x80 ) \ { \
{ \ ch = (unsigned char)*p++; \
FT_UInt len; \ if ( ch >= 0x80 ) \
\ { \
\ FT_UInt len_; \
if ( ch < 0xE0 ) \ \
{ \ \
len = 1; \ if ( ch < 0xE0 ) \
ch &= 0x1F; \ { \
} \ len_ = 1; \
else if ( ch < 0xF0 ) \ ch &= 0x1F; \
{ \ } \
len = 2; \ else if ( ch < 0xF0 ) \
ch &= 0x0F; \ { \
} \ len_ = 2; \
else \ ch &= 0x0F; \
{ \ } \
len = 3; \ else \
ch &= 0x07; \ { \
} \ len_ = 3; \
\ ch &= 0x07; \
for ( ; len > 0; len-- ) \ } \
ch = ( ch << 6 ) | ( *p++ & 0x3F ); \ \
} for ( ; len_ > 0; len_-- ) \
ch = ( ch << 6 ) | ( *p++ & 0x3F ); \
} \
} while ( 0 )
/*************************************************************************/ /*************************************************************************/

View File

@ -25,32 +25,35 @@ FT_BEGIN_HEADER
/* an auxiliary macro to decode a UTF-8 character -- since we only use */ /* an auxiliary macro to decode a UTF-8 character -- since we only use */
/* hard-coded, self-converted data, no error checking is performed */ /* hard-coded, self-converted data, no error checking is performed */
#define GET_UTF8_CHAR( ch, p ) \ #define GET_UTF8_CHAR( ch, p ) \
ch = (unsigned char)*p++; \ do \
if ( ch >= 0x80 ) \ { \
{ \ ch = (unsigned char)*p++; \
FT_UInt len; \ if ( ch >= 0x80 ) \
\ { \
\ FT_UInt len_; \
if ( ch < 0xE0 ) \ \
{ \ \
len = 1; \ if ( ch < 0xE0 ) \
ch &= 0x1F; \ { \
} \ len_ = 1; \
else if ( ch < 0xF0 ) \ ch &= 0x1F; \
{ \ } \
len = 2; \ else if ( ch < 0xF0 ) \
ch &= 0x0F; \ { \
} \ len_ = 2; \
else \ ch &= 0x0F; \
{ \ } \
len = 3; \ else \
ch &= 0x07; \ { \
} \ len_ = 3; \
\ ch &= 0x07; \
for ( ; len > 0; len-- ) \ } \
ch = ( ch << 6 ) | ( *p++ & 0x3F ); \ \
} for ( ; len_ > 0; len_-- ) \
ch = ( ch << 6 ) | ( *p++ & 0x3F ); \
} \
} while ( 0 )
/*************************************************************************/ /*************************************************************************/