From: EGUCHI Osamu Date: 1999-02-25T13:34:32+09:00 Subject: [ruby-dev:5654] [PATCH]Re: Re: Ruby 1.3.1-990224 えぐち@エスアンドイー です。 >>> In message [ruby-dev:5584] Re: Ruby 1.3.1-990224 On Wed, 24 Feb 1999 15:55:28 +0900, WATANABE Tetsuya said: tetsu> 渡辺哲也です。 tetsu> tetsu> nkf の ANSI-C 記述の部分ですが、次の部分が .... patch(1) が誤動作するのでザックリ省略 ... 類似の、非 ANSI-C 問題が SunOS-4.1.4 JLE の標準CC で発生します。 (ext/nkf/orig/nkf.c missing/fnmatch.c missing/fnmatch.h) 前方参照な関数を static とし、定義が static でないものがあり、 これをエラーにされていました。 (定義も static に変更 : missing/fnmatch.c) SunOS には fnmatch() がないので、 missing/fnmatch.c を コンパイルしますが、 missing/ に -I が通ってませんので、 "fnmatch.h" を見失ってました。 (Makefile.in) # time.c の floor() 削除が混ざってます。 此のパッチで SunOS の標準 CC で make test 確認し O K でした。 えぐち diff -rud ../ruby-1.3.1-990224/Makefile.in ./Makefile.in --- ../ruby-1.3.1-990224/Makefile.in Thu Feb 18 04:08:52 1999 +++ ./Makefile.in Thu Feb 25 13:06:37 1999 @@ -12,7 +12,7 @@ @SET_MAKE@ prefix = @prefix@ -CFLAGS = @CFLAGS@ -I. -I@srcdir@ -I@includedir@ +CFLAGS = @CFLAGS@ -I. -I@srcdir@ -I@includedir@ -I@srcdir@/missing LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@ EXTLIBS = LIBS = @LIBS@ $(EXTLIBS) Only in ./ext/curses: curses.o Only in ./ext/curses: curses.so diff -rud ../ruby-1.3.1-990224/ext/nkf/orig/nkf.c ./ext/nkf/orig/nkf.c --- ../ruby-1.3.1-990224/ext/nkf/orig/nkf.c Mon Feb 22 15:54:51 1999 +++ ./ext/nkf/orig/nkf.c Thu Feb 25 10:28:27 1999 @@ -257,9 +257,9 @@ # define DEFAULT_CONV e_oconv #endif -static void (*iconv)(int c2,int c1); +static void (*iconv)(); /* s_iconv or oconv */ -static void (*oconv)(int c2,int c1) = DEFAULT_CONV; +static void (*oconv)() = DEFAULT_CONV; /* [ejs]_oconv */ /* Global states */ @@ -464,6 +464,7 @@ } #endif +static void arguments(cp) char *cp; @@ -1049,6 +1050,7 @@ +static int push_hold_buf(c2, c1) int c2, c1; @@ -1323,6 +1325,7 @@ This is the main difference from fmt. */ +static int line_fold(c2,c1) int c2,c1; @@ -1446,6 +1449,7 @@ } } +static int pre_convert(c1,c2) int c1,c2; @@ -1566,6 +1570,7 @@ #define mime_ungetc0(c,f) (mimebuf_f?ungetc(c,f):mime_input--) #else +static int mime_begin(f) FILE *f; @@ -1620,6 +1625,7 @@ #endif +static int mime_getc(f) FILE *f; @@ -1732,6 +1738,7 @@ return Fifo(mime_top++); } +static int mime_ungetc(c) unsigned int c; @@ -1778,6 +1785,7 @@ } #endif +static int base64decode(c) int c; @@ -1797,6 +1805,7 @@ return (i); } +static void reinit() { diff -rud ../ruby-1.3.1-990224/missing/fnmatch.c ./missing/fnmatch.c --- ../ruby-1.3.1-990224/missing/fnmatch.c Thu Feb 18 03:52:07 1999 +++ ./missing/fnmatch.c Thu Feb 25 10:22:03 1999 @@ -48,11 +48,13 @@ #define EOS '\0' -static const char *rangematch(const char *, int, int); +static char *rangematch(); -int fnmatch(const char *pattern, const char *string, int flags) +int fnmatch(pattern, string, flags) + char *pattern; + char *string; { - const char *stringstart; + char *stringstart; char c, test; for (stringstart = string;;) { @@ -149,7 +151,8 @@ } } -static const char *rangematch(const char *pattern, int test, int flags) +static char *rangematch(pattern, test, flags) + char *pattern; { int negate, ok; char c, c2; diff -rud ../ruby-1.3.1-990224/missing/fnmatch.h ./missing/fnmatch.h --- ../ruby-1.3.1-990224/missing/fnmatch.h Thu Feb 18 03:51:03 1999 +++ ./missing/fnmatch.h Thu Feb 25 13:13:42 1999 @@ -48,7 +48,7 @@ #define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */ #define FNM_PERIOD 0x04 /* Period must be matched by period. */ -int fnmatch(const char *, const char *, int); +int fnmatch(); #ifdef __cplusplus } diff -rud ../ruby-1.3.1-990224/time.c ./time.c --- ../ruby-1.3.1-990224/time.c Wed Feb 24 13:31:26 1999 +++ ./time.c Thu Feb 25 13:17:47 1999 @@ -120,7 +120,7 @@ case T_FLOAT: if (RFLOAT(time)->value < 0.0) rb_raise(rb_eArgError, "time must be positive"); - t.tv_sec = (long)floor(RFLOAT(time)->value); + t.tv_sec = (long)(RFLOAT(time)->value); t.tv_usec = (long)((RFLOAT(time)->value - t.tv_sec) * 1000000.0); break;