unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* srfi-13 string-trim isspace on char
@ 2004-04-06  1:25 Kevin Ryde
  2004-05-11 18:58 ` Marius Vollmer
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Ryde @ 2004-04-06  1:25 UTC (permalink / 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-05-11 18:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-06  1:25 srfi-13 string-trim isspace on char Kevin Ryde
2004-05-11 18:58 ` Marius Vollmer

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).