Re: [PATCH] eruby on tiger

Shugo Maeda <[email protected]> Tue, 19 Jul 2005 09:43:34 +0900
Newsgroups gmane.comp.apache.mod-ruby
Message-ID <[email protected]>
Hi,

Jb Evain wrote:
> Attached is a very small patch to clean warnings during the build of
> eruby on Tiger.

Thanks for your patch.

But isspace() requires unsigned char for arguments.
Does the attached patch help you?

Shugo
eruby-unsigned-char-cast.diff (text/plain, 729 B)
Index: eruby_lib.c
===================================================================
--- eruby_lib.c	(revision 67)
+++ eruby_lib.c	(working copy)
@@ -123,7 +123,7 @@
 	if (argv[i][0] != '-' || argv[i][1] == '\0') {
 	    break;
 	}
-	s = argv[i];
+	s = (unsigned char *) argv[i];
       again:
 	while (isspace(*s))
 	    s++;
@@ -490,11 +490,11 @@
 		output_literal(compiler, "\n");
 	    }
 	    argv[0] = "eruby";
-	    p = line;
+	    p = (unsigned char *) line;
 	    while (isspace(*p)) p++;
 	    while (*p && !isspace(*p)) p++;
 	    while (isspace(*p)) p++;
-	    argv[1] = p;
+	    argv[1] = (char *) p;
 	    if (eruby_parse_options(2, argv, NULL) != 0) {
 		rb_raise(eERubyCompileError, "invalid #! line");
 	    }