From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Andreas_V=F6gele?= Newsgroups: gmane.lisp.guile.user,gmane.lisp.guile.devel Subject: Re: Guile 1.7.1 has been released. Date: Sun, 29 Aug 2004 11:23:33 +0200 Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: <193B2882-F99D-11D8-A510-000D93673682@gmx.net> References: <87sma9h59y.fsf@zagadka.ping.de> <24CF5BB2-F93A-11D8-B8A1-000A95C37894@lurchi.franken.de> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (Apple Message framework v619) Content-Type: multipart/mixed; boundary=Apple-Mail-7--499903345 X-Trace: sea.gmane.org 1093771482 12388 80.91.224.253 (29 Aug 2004 09:24:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 29 Aug 2004 09:24:42 +0000 (UTC) Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Aug 29 11:24:37 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1C1LvR-0007Nd-00 for ; Sun, 29 Aug 2004 11:24:37 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C1M0B-0004BQ-TT for guile-user@m.gmane.org; Sun, 29 Aug 2004 05:29:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C1M04-0004B5-In for guile-user@gnu.org; Sun, 29 Aug 2004 05:29:24 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C1M02-0004Ah-Ge for guile-user@gnu.org; Sun, 29 Aug 2004 05:29:22 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C1M02-0004AJ-EO for guile-user@gnu.org; Sun, 29 Aug 2004 05:29:22 -0400 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.34) id 1C1LuW-0008Lx-Gn for guile-user@gnu.org; Sun, 29 Aug 2004 05:23:40 -0400 Original-Received: (qmail 32406 invoked by uid 65534); 29 Aug 2004 09:23:35 -0000 Original-Received: from pD951950A.dip.t-dialin.net (EHLO [192.168.1.15]) (217.81.149.10) by mail.gmx.net (mp014) with SMTP; 29 Aug 2004 11:23:35 +0200 X-Authenticated: #14729429 In-Reply-To: <24CF5BB2-F93A-11D8-B8A1-000A95C37894@lurchi.franken.de> Original-To: guile-devel@gnu.org, guile-user@gnu.org X-Mailer: Apple Mail (2.619) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:3416 gmane.lisp.guile.devel:4051 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:4051 --Apple-Mail-7--499903345 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Michael Tuexen writes: > Hi Marius, > > I tried to compile it on Mac OS X, but the following comes up: [...] > > srfi-13.c: In function `scm_string_trim_right': > srfi-13.c:771: warning: passing arg 3 of `scm_i_get_substring_spec' > from incompatible pointer type I've attached a patch that replaces the remaining occurrences of int in srfi-13.c with size_t. In addition to these replacements, the function string_reverse_x() makes sure that the variable cend is only decremented if it's value is greater than zero. One thing that I noted is that the variable cfrom in scm_xsubstring() and the variable csfrom in scm_string_xcopy_x() are of type size_t but that they are checked for negative values: int t = ((cfrom < 0) ? -cfrom : cfrom) % (cend - cstart); if (cfrom < 0) .... I've tested this patch on Mac OS X and OpenBSD. BTW, do you prefer included or attached patches? --Apple-Mail-7--499903345 Content-Transfer-Encoding: 7bit Content-Type: application/octet-stream; x-unix-mode=0700; name="srfi-13.c.diff" Content-Disposition: attachment; filename=srfi-13.c.diff Index: libguile/srfi-13.c =================================================================== RCS file: /cvsroot/guile/guile/guile-core/libguile/srfi-13.c,v retrieving revision 1.3 diff -u -r1.3 srfi-13.c --- libguile/srfi-13.c 25 Aug 2004 16:04:09 -0000 1.3 +++ libguile/srfi-13.c 29 Aug 2004 09:12:07 -0000 @@ -106,7 +106,7 @@ } else if (SCM_CHARSETP (char_pred)) { - int i; + size_t i; for (i = cstart; i < cend; i++) if (SCM_CHARSET_GET (char_pred, cstr[i])) { @@ -163,7 +163,7 @@ if (SCM_CHARP (char_pred)) { char cchr = SCM_CHAR (char_pred); - int i; + size_t i; for (i = cstart; i < cend; i++) if (cstr[i] != cchr) { @@ -173,7 +173,7 @@ } else if (SCM_CHARSETP (char_pred)) { - int i; + size_t i; for (i = cstart; i < cend; i++) if (!SCM_CHARSET_GET (char_pred, cstr[i])) { @@ -225,7 +225,7 @@ /* The RES string remains untouched since nobody knows about it yet. No need to refetch P. */ - ch = scm_call_1 (proc, scm_from_int (i)); + ch = scm_call_1 (proc, scm_from_size_t (i)); if (!SCM_CHARP (ch)) SCM_MISC_ERROR ("procedure ~S returned non-char", scm_list_1 (proc)); *p++ = SCM_CHAR (ch); @@ -764,7 +764,7 @@ #define FUNC_NAME s_scm_string_trim_right { const char *cstr; - int cstart, cend; + size_t cstart, cend; MY_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr, 3, start, cstart, @@ -2326,7 +2326,7 @@ /* Helper function for the string uppercase conversion functions. * No argument checking is performed. */ static SCM -string_upcase_x (SCM v, int start, int end) +string_upcase_x (SCM v, size_t start, size_t end) { size_t k; char *dst; @@ -2392,7 +2392,7 @@ /* Helper function for the string lowercase conversion functions. * No argument checking is performed. */ static SCM -string_downcase_x (SCM v, int start, int end) +string_downcase_x (SCM v, size_t start, size_t end) { size_t k; char *dst; @@ -2460,7 +2460,7 @@ /* Helper function for the string capitalization functions. * No argument checking is performed. */ static SCM -string_titlecase_x (SCM str, int start, int end) +string_titlecase_x (SCM str, size_t start, size_t end) { unsigned char *sz; size_t i; @@ -2555,18 +2555,21 @@ /* Reverse the portion of @var{str} between str[cstart] (including) and str[cend] excluding. */ static void -string_reverse_x (char * str, int cstart, int cend) +string_reverse_x (char * str, size_t cstart, size_t cend) { char tmp; - cend--; - while (cstart < cend) + if (cend > 0) { - tmp = str[cstart]; - str[cstart] = str[cend]; - str[cend] = tmp; - cstart++; cend--; + while (cstart < cend) + { + tmp = str[cstart]; + str[cstart] = str[cend]; + str[cend] = tmp; + cstart++; + cend--; + } } } @@ -3032,7 +3035,7 @@ cs = scm_i_string_chars (s); while (cfrom < cto) { - int t = ((cfrom < 0) ? -cfrom : cfrom) % (cend - cstart); + size_t t = ((cfrom < 0) ? -cfrom : cfrom) % (cend - cstart); if (cfrom < 0) *p = cs[(cend - cstart) - t]; else @@ -3060,7 +3063,7 @@ const char *cs; size_t ctstart, csfrom, csto, cstart, cend; SCM dummy = SCM_UNDEFINED; - int cdummy; + size_t cdummy; MY_VALIDATE_SUBSTRING_SPEC (1, target, 2, tstart, ctstart, @@ -3082,7 +3085,7 @@ cs = scm_i_string_chars (s); while (csfrom < csto) { - int t = ((csfrom < 0) ? -csfrom : csfrom) % (cend - cstart); + size_t t = ((csfrom < 0) ? -csfrom : csfrom) % (cend - cstart); if (csfrom < 0) *p = cs[(cend - cstart) - t]; else @@ -3155,7 +3158,7 @@ if (SCM_CHARSETP (token_set)) { - int idx; + size_t idx; while (cstart < cend) { --Apple-Mail-7--499903345 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user --Apple-Mail-7--499903345--