From daa7af2bb2326de363aa5ea51c29616e3634343a Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 20 Jan 2009 23:20:20 -0500 Subject: Move the copy of CopyISOLatin1Lowered near its user, and un-weak it. --- src/fontfile/fontfile.c | 24 +++++++++++++++++++++++- src/util/miscutil.c | 22 ---------------------- 2 files changed, 23 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/fontfile/fontfile.c b/src/fontfile/fontfile.c index 09fc555..c2eae29 100644 --- a/src/fontfile/fontfile.c +++ b/src/fontfile/fontfile.c @@ -36,11 +36,33 @@ in this Software without prior written authorization from The Open Group. #ifdef HAVE_CONFIG_H #include #endif -#include +#include +#include #ifdef WIN32 #include #endif +static unsigned char +ISOLatin1ToLower(unsigned char source) +{ + if (source >= XK_A && source <= XK_Z) + return source + (XK_a - XK_A); + if (source >= XK_Agrave && source <= XK_Odiaeresis) + return source + (XK_agrave - XK_Agrave); + if (source >= XK_Ooblique && source <= XK_Thorn) + return source + (XK_oslash - XK_Ooblique); + return source; +} + +_X_HIDDEN void +CopyISOLatin1Lowered(char *dest, char *source, int length) +{ + int i; + for (i = 0; i < length; i++, source++, dest++) + *dest = ISOLatin1ToLower(*source); + *dest = '\0'; +} + /* * Map FPE functions to renderer functions */ diff --git a/src/util/miscutil.c b/src/util/miscutil.c index 6e5d52e..3459275 100644 --- a/src/util/miscutil.c +++ b/src/util/miscutil.c @@ -43,34 +43,12 @@ from The Open Group. #ifdef __SUNPRO_C #pragma weak serverGeneration -#pragma weak CopyISOLatin1Lowered #pragma weak register_fpe_functions #endif /* make sure everything initializes themselves at least once */ weak long serverGeneration = 1; -weak void -CopyISOLatin1Lowered (char *dst, char *src, int len) -{ - register unsigned char *dest, *source; - - for (dest = (unsigned char *)dst, source = (unsigned char *)src; - *source && len > 0; - source++, dest++, len--) - { - if ((*source >= XK_A) && (*source <= XK_Z)) - *dest = *source + (XK_a - XK_A); - else if ((*source >= XK_Agrave) && (*source <= XK_Odiaeresis)) - *dest = *source + (XK_agrave - XK_Agrave); - else if ((*source >= XK_Ooblique) && (*source <= XK_Thorn)) - *dest = *source + (XK_oslash - XK_Ooblique); - else - *dest = *source; - } - *dest = '\0'; -} - weak void register_fpe_functions (void) { -- cgit v1.2.3