From: Kevin Ryde <user42@zip.com.au>
Subject: srfi-13 string-trim isspace on char
Date: Tue, 06 Apr 2004 11:25:20 +1000 [thread overview]
Message-ID: <871xn1kidb.fsf@zip.com.au> (raw)
[-- Attachment #1: Type: text/plain, Size: 353 bytes --]
* srfi-13.c (scm_string_trim, scm_string_trim_right,
scm_string_trim_both): Cast to unsigned char for isspace.
glibc works with negative char values, but c99 doesn't allow them.
On solaris 7, isspace is an array lookup and a char as an index
provokes a warning from gcc (3.3 at least).
This would probably be for the 1.6 branch too.
[-- Attachment #2: srfi-13.c.isspace.diff --]
[-- Type: text/plain, Size: 1109 bytes --]
--- srfi-13.c.~1.19.~ 2003-04-07 08:05:29.000000000 +1000
+++ srfi-13.c 2004-04-06 11:21:46.000000000 +1000
@@ -1,6 +1,6 @@
/* srfi-13.c --- SRFI-13 procedures for Guile
*
- * Copyright (C) 2001 Free Software Foundation, Inc.
+ * Copyright (C) 2001, 2004 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
@@ -593,7 +593,7 @@
{
while (cstart < cend)
{
- if (!isspace(cstr[cstart]))
+ if (!isspace((int) (unsigned char) cstr[cstart]))
break;
cstart++;
}
@@ -668,7 +668,7 @@
{
while (cstart < cend)
{
- if (!isspace(cstr[cend - 1]))
+ if (!isspace((int) (unsigned char) cstr[cend - 1]))
break;
cend--;
}
@@ -743,13 +743,13 @@
{
while (cstart < cend)
{
- if (!isspace(cstr[cstart]))
+ if (!isspace((int) (unsigned char) cstr[cstart]))
break;
cstart++;
}
while (cstart < cend)
{
- if (!isspace(cstr[cend - 1]))
+ if (!isspace((int) (unsigned char) cstr[cend - 1]))
break;
cend--;
}
[-- Attachment #3: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
next reply other threads:[~2004-04-06 1:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-06 1:25 Kevin Ryde [this message]
2004-05-11 18:58 ` srfi-13 string-trim isspace on char Marius Vollmer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871xn1kidb.fsf@zip.com.au \
--to=user42@zip.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).