summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2007-05-15 11:55:37 +0000
committerWerner Lemberg <wl@gnu.org>2007-05-15 11:55:37 +0000
commit6ae7ff0607bd3e586d148705ab8cc52b5b1b91d3 (patch)
treed11d83eaf26661f0b33bfd74c8acb9fb0a0e12ae
parent0a24bd259aad26d1191fca26a34890a68e8c088c (diff)
downloadfreetype2-6ae7ff0607bd3e586d148705ab8cc52b5b1b91d3.tar.gz
Formatting, typos.
-rw-r--r--ChangeLog6
-rw-r--r--include/freetype/internal/ftobjs.h29
2 files changed, 17 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 81b99b341..f781a9043 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,10 @@
2007-05-15 David Turner <david@freetype.org>
* include/freetype/config/ftstdlib.h,
- include/freetype/internal/ftobjs.h: as suggested by Graham Asher,
- ensure that ft_isalnum, ft_isdigit, etc... use hard-coded values
+ include/freetype/internal/ftobjs.h: As suggested by Graham Asher,
+ ensure that ft_isalnum, ft_isdigit, etc., use hard-coded values
instead on relying on the locale-dependent functions provided by
- <ctypes.h>
+ <ctypes.h>.
2007-05-15 Graham Asher <graham.asher@btinternet.com>
diff --git a/include/freetype/internal/ftobjs.h b/include/freetype/internal/ftobjs.h
index 5f9f9e858..15b68d63f 100644
--- a/include/freetype/internal/ftobjs.h
+++ b/include/freetype/internal/ftobjs.h
@@ -89,24 +89,23 @@ FT_BEGIN_HEADER
ft_highpow2( FT_UInt32 value );
- /*
- * character classification functions. Since these are used to parse font
- * files, we must not use those in <ctypes.h> which are locale-dependent !!
- */
-#define ft_isdigit(x) (((unsigned)(x) - '0') < 10U)
-
-#define ft_isxdigit(x) ( ((unsigned)(x) - '0') < 10U || \
- ((unsigned)(x) - 'a') < 6U || \
- ((unsigned)(x) - 'A') < 6U )
-
-#define ft_isupper(x) ( ((unsigned)(x) - 'A') < 26U )
-
-#define ft_islower(x) ( ((unsigned)(x) - 'a') < 26U )
+ /*
+ * character classification functions -- since these are used to parse
+ * font files, we must not use those in <ctypes.h> which are
+ * locale-dependent
+ */
+#define ft_isdigit( x ) ( ( (unsigned)(x) - '0' ) < 10U )
-#define ft_isalpha(x) ( ft_is_upper(x) || ft_is_lower(x) )
+#define ft_isxdigit( x ) ( ( (unsigned)(x) - '0' ) < 10U || \
+ ( (unsigned)(x) - 'a' ) < 6U || \
+ ( (unsigned)(x) - 'A' ) < 6U )
-#define ft_isalnum(x) ( ft_isdigit(x) || ft_isalpha(x) )
+ /* the next two macros assume ASCII representation */
+#define ft_isupper( x ) ( ( (unsigned)(x) - 'A' ) < 26U )
+#define ft_islower( x ) ( ( (unsigned)(x) - 'a' ) < 26U )
+#define ft_isalpha( x ) ( ft_isupper( x ) || ft_islower( x ) )
+#define ft_isalnum( x ) ( ft_isdigit( x ) || ft_isalpha( x ) )
/*************************************************************************/