summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2008-09-02 23:01:47 +0200
committerLudovic Courtès <ludo@gnu.org>2008-09-02 23:01:47 +0200
commit4e641322d3dc2b47677c87de3a32f8469431cf74 (patch)
tree628eebca4337602ccc0e2724337962e7bee06a83
parent37a52039553b08c568e596852a871e59948ebfa6 (diff)
downloadguile-4e641322d3dc2b47677c87de3a32f8469431cf74.tar.gz
Fix compilation of `libguile-i18n' on NetBSD.
* libguile/i18n.c (str_upcase, str_downcase, scm_char_locale_downcase, scm_char_locale_upcase): Cast chars to `int' when invoking `toupper ()' et al. to avoid "array subscript has type 'char'" on NetBSD. Reported by Greg Toxel <gdt@ir.bbn.com>.
-rw-r--r--libguile/i18n.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/libguile/i18n.c b/libguile/i18n.c
index 43381f4ed..5d2d976fd 100644
--- a/libguile/i18n.c
+++ b/libguile/i18n.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -769,7 +769,7 @@ static inline void
str_upcase (register char *dst, register const char *src)
{
for (; *src != '\0'; src++, dst++)
- *dst = toupper (*src);
+ *dst = toupper ((int) *src);
*dst = '\0';
}
@@ -777,7 +777,7 @@ static inline void
str_downcase (register char *dst, register const char *src)
{
for (; *src != '\0'; src++, dst++)
- *dst = tolower (*src);
+ *dst = tolower ((int) *src);
*dst = '\0';
}
@@ -1120,13 +1120,13 @@ SCM_DEFINE (scm_char_locale_downcase, "char-locale-downcase", 1, 1, 0,
if (c_locale != NULL)
{
#ifdef USE_GNU_LOCALE_API
- c_result = tolower_l (c_chr, c_locale);
+ c_result = tolower_l ((int) c_chr, c_locale);
#else
- RUN_IN_LOCALE_SECTION (c_locale, c_result = tolower (c_chr));
+ RUN_IN_LOCALE_SECTION (c_locale, c_result = tolower ((int) c_chr));
#endif
}
else
- c_result = tolower (c_chr);
+ c_result = tolower ((int) c_chr);
return (SCM_MAKE_CHAR (c_result));
}
@@ -1150,13 +1150,13 @@ SCM_DEFINE (scm_char_locale_upcase, "char-locale-upcase", 1, 1, 0,
if (c_locale != NULL)
{
#ifdef USE_GNU_LOCALE_API
- c_result = toupper_l (c_chr, c_locale);
+ c_result = toupper_l ((int) c_chr, c_locale);
#else
- RUN_IN_LOCALE_SECTION (c_locale, c_result = toupper (c_chr));
+ RUN_IN_LOCALE_SECTION (c_locale, c_result = toupper ((int) c_chr));
#endif
}
else
- c_result = toupper (c_chr);
+ c_result = toupper ((int) c_chr);
return (SCM_MAKE_CHAR (c_result));
}