ruby-changes:33971
From: nobu <ko1@a...>
Date: Fri, 23 May 2014 00:09:15 +0900 (JST)
Subject: [ruby-changes:33971] nobu:r46052 (trunk): Makefile.in: suppress warnings
nobu 2014-05-23 00:09:11 +0900 (Fri, 23 May 2014) New Revision: 46052 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=46052 Log: Makefile.in: suppress warnings * Makefile.in (enc/jis/props.h): suppress `pointer-to-int-cast` warnings by using `offsetof`. Modified files: trunk/Makefile.in trunk/enc/jis/props.h trunk/enc/jis/props.h.blt Index: enc/jis/props.h =================================================================== --- enc/jis/props.h (revision 46051) +++ enc/jis/props.h (revision 46052) @@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/enc/jis/props.h#L1 /* C code produced by gperf version 3.0.4 */ -/* Command-line: gperf -k1,3 -7 -c -j1 -i1 -t -C -P -t --ignore-case -H onig_jis_property_hash -Q onig_jis_property_pool -N onig_jis_property --output-file=enc/jis/props.h enc/jis/props.kwd */ +/* Command-line: gperf -k1,3 -7 -c -j1 -i1 -t -C -P -t --ignore-case -H onig_jis_property_hash -Q onig_jis_property_pool -N onig_jis_property enc/jis/props.kwd */ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ @@ -190,19 +190,19 @@ onig_jis_property (str, len) https://github.com/ruby/ruby/blob/trunk/enc/jis/props.h#L190 { {-1}, {-1}, {-1}, {-1}, {-1}, #line 48 "enc/jis/props.kwd" - {(int)(long)&((struct onig_jis_property_pool_t *)0)->onig_jis_property_pool_str5, onigenc_jis_han}, + {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str5), onigenc_jis_han}, {-1}, #line 49 "enc/jis/props.kwd" - {(int)(long)&((struct onig_jis_property_pool_t *)0)->onig_jis_property_pool_str7, onigenc_jis_latin}, + {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str7), onigenc_jis_latin}, #line 50 "enc/jis/props.kwd" - {(int)(long)&((struct onig_jis_property_pool_t *)0)->onig_jis_property_pool_str8, onigenc_jis_greek}, + {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str8), onigenc_jis_greek}, {-1}, #line 46 "enc/jis/props.kwd" - {(int)(long)&((struct onig_jis_property_pool_t *)0)->onig_jis_property_pool_str10, onigenc_jis_hiragana}, + {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str10), onigenc_jis_hiragana}, #line 47 "enc/jis/props.kwd" - {(int)(long)&((struct onig_jis_property_pool_t *)0)->onig_jis_property_pool_str11, onigenc_jis_katakana}, + {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str11), onigenc_jis_katakana}, #line 51 "enc/jis/props.kwd" - {(int)(long)&((struct onig_jis_property_pool_t *)0)->onig_jis_property_pool_str12, onigenc_jis_cyrillic} + {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str12), onigenc_jis_cyrillic} }; if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) Index: enc/jis/props.h.blt =================================================================== --- enc/jis/props.h.blt (revision 46051) +++ enc/jis/props.h.blt (revision 46052) @@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/enc/jis/props.h.blt#L1 /* C code produced by gperf version 3.0.4 */ -/* Command-line: gperf -k1,3 -7 -c -j1 -i1 -t -C -P -t --ignore-case -H onig_jis_property_hash -Q onig_jis_property_pool -N onig_jis_property --output-file=enc/jis/props.h enc/jis/props.kwd */ +/* Command-line: gperf -k1,3 -7 -c -j1 -i1 -t -C -P -t --ignore-case -H onig_jis_property_hash -Q onig_jis_property_pool -N onig_jis_property enc/jis/props.kwd */ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ @@ -190,19 +190,19 @@ onig_jis_property (str, len) https://github.com/ruby/ruby/blob/trunk/enc/jis/props.h.blt#L190 { {-1}, {-1}, {-1}, {-1}, {-1}, #line 48 "enc/jis/props.kwd" - {(int)(long)&((struct onig_jis_property_pool_t *)0)->onig_jis_property_pool_str5, onigenc_jis_han}, + {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str5), onigenc_jis_han}, {-1}, #line 49 "enc/jis/props.kwd" - {(int)(long)&((struct onig_jis_property_pool_t *)0)->onig_jis_property_pool_str7, onigenc_jis_latin}, + {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str7), onigenc_jis_latin}, #line 50 "enc/jis/props.kwd" - {(int)(long)&((struct onig_jis_property_pool_t *)0)->onig_jis_property_pool_str8, onigenc_jis_greek}, + {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str8), onigenc_jis_greek}, {-1}, #line 46 "enc/jis/props.kwd" - {(int)(long)&((struct onig_jis_property_pool_t *)0)->onig_jis_property_pool_str10, onigenc_jis_hiragana}, + {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str10), onigenc_jis_hiragana}, #line 47 "enc/jis/props.kwd" - {(int)(long)&((struct onig_jis_property_pool_t *)0)->onig_jis_property_pool_str11, onigenc_jis_katakana}, + {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str11), onigenc_jis_katakana}, #line 51 "enc/jis/props.kwd" - {(int)(long)&((struct onig_jis_property_pool_t *)0)->onig_jis_property_pool_str12, onigenc_jis_cyrillic} + {(char)offsetof(struct onig_jis_property_pool_t, onig_jis_property_pool_str12), onigenc_jis_cyrillic} }; if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) Index: Makefile.in =================================================================== --- Makefile.in (revision 46051) +++ Makefile.in (revision 46052) @@ -335,7 +335,8 @@ enc/jis/props.h: enc/jis/props.kwd https://github.com/ruby/ruby/blob/trunk/Makefile.in#L335 $(CP) $(?:.kwd=.h.blt) $@; \ else \ set -x; \ - gperf $(JIS_PROPS_OPTIONS) --output-file=$@ $? && \ + gperf $(JIS_PROPS_OPTIONS) $? | \ + sed 's/(int)(long)&((\([a-zA-Z_0-9 ]*[a-zA-Z_0-9]\) *\*)0)->\([a-zA-Z0-9_]*\),/(char)offsetof(\1, \2),/g' > $@ && \ $(CP) $? $(?:.kwd=.src) && \ $(CP) $@ $(?:.kwd=.h.blt); \ fi -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/