]> git.unchartedbackwaters.co.uk Git - francis/libjit.git/commitdiff
Remove the locale-sensitive string comparison routines because
authorRhys Weatherley <rweather@southern-storm.com.au>
Sat, 8 May 2004 01:10:22 +0000 (01:10 +0000)
committerRhys Weatherley <rweather@southern-storm.com.au>
Sat, 8 May 2004 01:10:22 +0000 (01:10 +0000)
they aren't used in libjit, and front ends will normally have
their own functions for this purpose.

ChangeLog
configure.in
include/jit/jit-util.h
jit/jit-string.c

index 20a02ff97f0584d9b700d998f23e142fc7eddb2f..11976bdd2f61183f79c8fdd2ef5d6196eb881d2c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,11 @@
        jit/jit-rules-interp.c: add "_jit_cache_get_end_method", to allow
        the end of a method's code to be located without explicit marking.
 
+       * configure.in, include/jit/jit-util.h, jit/jit-string.c:
+       remove the locale-sensitive string comparison routines because
+       they aren't used in libjit, and front ends will normally have
+       their own functions for this purpose.
+
 2004-05-07  Rhys Weatherley  <rweather@southern-storm.com.au>
 
        * dpas/dpas-function.c, dpas/dpas-internal.h, dpas/dpas-main.c,
index c16067dd3c037a447cf277ebd3717c8d75f1857b..637b65429f420bbd73e97666c9a04463dc346ae7 100644 (file)
@@ -350,8 +350,6 @@ fi
 AC_FUNC_MEMCMP
 AC_CHECK_FUNCS(memset memcmp memchr memcpy memmove bcopy bzero bcmp)
 AC_CHECK_FUNCS(strlen strcpy strcat strncpy strcmp strncmp)
-AC_CHECK_FUNCS(strcoll _strcoll stricoll _stricoll strcasecmp)
-AC_CHECK_FUNCS(strncoll _strncoll strnicoll _strnicoll strncasecmp)
 AC_CHECK_FUNCS(strchr strrchr vsprintf vsnprintf _vsnprintf getpagesize)
 AC_CHECK_FUNCS(isnan isinf finite fmod remainder drem ceil floor)
 AC_CHECK_FUNCS(acos asin atan atan2 cos cosh exp log log10 pow)
index 0a4427260ed1274014e1a233d0707229c2263d43..3c8894e0012bac5e64a90c6b27b9032f3e69adc2 100644 (file)
@@ -51,8 +51,7 @@ int   jit_memcmp(const void *s1, const void *s2, unsigned int len) JIT_NOTHROW;
 void *jit_memchr(const void *str, int ch, unsigned int len) JIT_NOTHROW;
 
 /*
- * String routines.  Note: jit_stricmp uses fixed ASCII rules for case
- * comparison, whereas jit_stricoll uses localized rules.
+ * String routines.
  */
 unsigned int jit_strlen(const char *str) JIT_NOTHROW;
 char *jit_strcpy(char *dest, const char *src) JIT_NOTHROW;
@@ -66,12 +65,6 @@ int jit_strncmp
 int jit_stricmp(const char *str1, const char *str2) JIT_NOTHROW;
 int jit_strnicmp
        (const char *str1, const char *str2, unsigned int len) JIT_NOTHROW;
-int jit_strcoll(const char *str1, const char *str2) JIT_NOTHROW;
-int jit_strncoll
-       (const char *str1, const char *str2, unsigned int len) JIT_NOTHROW;
-int jit_stricoll(const char *str1, const char *str2) JIT_NOTHROW;
-int jit_strnicoll
-       (const char *str1, const char *str2, unsigned int len) JIT_NOTHROW;
 char *jit_strchr(const char *str, int ch) JIT_NOTHROW;
 char *jit_strrchr(const char *str, int ch) JIT_NOTHROW;
 int jit_sprintf(char *str, const char *format, ...) JIT_NOTHROW;
index bdc18af69a66cf9b8d4073cbec723fee05f07110..ca77f1ce23ea1340fb965a7ac7f4f8c7ca0d8bbf 100644 (file)
@@ -239,8 +239,12 @@ int jit_strncmp(const char *str1, const char *str2, unsigned int len)
  * lower case counterparts before comparison.
  *
  * Note: this function is guaranteed to use English case comparison rules,
- * no matter what the current locale is set to.  Use @code{jit_stricoll} for
- * locale-sensitive string comparison.
+ * no matter what the current locale is set to, making it suitable for
+ * comparing token tags and simple programming language identifiers.
+ *
+ * Locale-sensitive string comparison is complicated and usually specific
+ * to the front end language or its supporting runtime library.  We
+ * deliberately chose not to handle this in @code{libjit}.
  * @end deftypefun
 @*/
 int jit_stricmp(const char *str1, const char *str2)
@@ -273,10 +277,6 @@ int jit_stricmp(const char *str1, const char *str2)
  * At most @code{len} characters are compared.  Instances of the English
  * letters A to Z are converted into their lower case counterparts
  * before comparison.
- *
- * Note: this function is guaranteed to use English case comparison rules,
- * no matter what the current locale is set to.  Use @code{jit_strnicoll} for
- * locale-sensitive string comparison.
  * @end deftypefun
 @*/
 int jit_strnicmp(const char *str1, const char *str2, unsigned int len)
@@ -303,93 +303,6 @@ int jit_strnicmp(const char *str1, const char *str2, unsigned int len)
        return 0;
 }
 
-/*@
- * @deftypefun int jit_strcoll ({const char *} str1, {const char *} str2)
- * Compare the two strings @code{str1} and @code{str2}, returning
- * a negative, zero, or positive value depending upon their relationship.
- * This function uses locale-sensitive comparison rules, but case is
- * still considered significant.  If the system does not have locale
- * sensitive comparisons, this function will be identical to
- * @code{jit_strcmp}.
- * @end deftypefun
-@*/
-int jit_strcoll(const char *str1, const char *str2)
-{
-#if defined(HAVE_STRCOLL)
-       return strcoll(str1, str2);
-#elif defined(HAVE__STRCOLL)
-       return _strcoll(str1, str2);
-#elif defined(HAVE_STRCMP)
-       return strcmp(str1, str2);
-#else
-       return jit_strcmp(str1, str2);
-#endif
-}
-
-/*@
- * @deftypefun int jit_stricoll ({const char *} str1, {const char *} str2)
- * Compare the two strings @code{str1} and @code{str2}, returning
- * a negative, zero, or positive value depending upon their relationship.
- * This function uses locale-sensitive comparison rules, while ignoring
- * case.  If the system does not have locale sensitive comparisons, this
- * function will be identical to @code{jit_stricmp}.
- * @end deftypefun
-@*/
-int jit_stricoll(const char *str1, const char *str2)
-{
-#if defined(HAVE_STRICOLL)
-       return stricoll(str1, str2);
-#elif defined(HAVE__STRICOLL)
-       return _stricoll(str1, str2);
-#elif defined(HAVE_STRCASECMP)
-       return strcasecmp(str1, str2);
-#else
-       return jit_stricmp(str1, str2);
-#endif
-}
-
-/*@
- * @deftypefun int jit_strncoll ({const char *} str1, {const char *} str2, {unsigned int} len)
- * Compare the two strings @code{str1} and @code{str2}, returning
- * a negative, zero, or positive value depending upon their relationship.
- * At most @code{len} characters are compared, but it is otherwise
- * the same as @code{jit_strcoll}.
- * @end deftypefun
-@*/
-int jit_strncoll(const char *str1, const char *str2, unsigned int len)
-{
-#if defined(HAVE_STRNCOLL)
-       return strncoll(str1, str2, len);
-#elif defined(HAVE__STRNCOLL)
-       return _strncoll(str1, str2, len);
-#elif defined(HAVE_STRNCMP)
-       return strncmp(str1, str2, len);
-#else
-       return jit_strncmp(str1, str2, len);
-#endif
-}
-
-/*@
- * @deftypefun int jit_strnicoll ({const char *} str1, {const char *} str2, {unsigned int} len)
- * Compare the two strings @code{str1} and @code{str2}, returning
- * a negative, zero, or positive value depending upon their relationship.
- * At most @code{len} characters are compared, but it is otherwise
- * the same as @code{jit_stricoll}.
- * @end deftypefun
-@*/
-int jit_strnicoll(const char *str1, const char *str2, unsigned int len)
-{
-#if defined(HAVE_STRNICOLL)
-       return strincoll(str1, str2, len);
-#elif defined(HAVE__STRNICOLL)
-       return _strnicoll(str1, str2, len);
-#elif defined(HAVE_STRNCASECMP)
-       return strncasecmp(str1, str2, len);
-#else
-       return jit_strnicmp(str1, str2, len);
-#endif
-}
-
 /*@
  * @deftypefun {char *} jit_strchr ({const char *} str, int ch)
  * Search @code{str} for the first occurrence of @code{ch}.  Returns