[#19261] lstripped here-document (Re: comments and continuing strings on the next line) — nobu.nakada@...

なかだです。

29 messages 2003/01/01
[#19360] Re: lstripped here-document (Re: comments and continuing strings on the next line) — "K.Kosako" <kosako@...> 2003/01/15

nobu.nakada@nifty.ne.jpさんの

[#19361] Re: lstripped here-document (Re: comments and continuing strings on the next line) — "NAKAMURA, Hiroshi" <nakahiro@...> 2003/01/15

なひです。

[#19364] Re: lstripped here-document (Re: comments and continuing strings on the next line) — nobu.nakada@... 2003/01/17

なかだです。

[#19366] Re: lstripped here-document (Re: comments and continuing strings on the next line) — "NAKAMURA, Hiroshi" <nakahiro@...> 2003/01/17

なひです。

[#19299] [BUG] errno == 0 — Kazuhiro Yoshida <moriq@...>

もりきゅうです。win32だけかもしれません。

22 messages 2003/01/04
[#19301] Re: [BUG] errno == 0 — "U.Nakamura" <usa@...> 2003/01/04

こんにちは、なかむら(う)です。

[#19302] Re: [BUG] errno == 0 — "U.Nakamura" <usa@...> 2003/01/04

こんにちは、なかむら(う)です。

[#19303] Re: [BUG] errno == 0 — "U.Nakamura" <usa@...> 2003/01/04

こんにちは、なかむら(う)です。

[#19304] Re: [BUG] errno == 0 — "U.Nakamura" <usa@...> 2003/01/04

こんにちは、なかむら(う)です。

[#19306] Re: [BUG] errno == 0 — nobu.nakada@... 2003/01/05

なかだです。

[ruby-dev:19334] Re: [Ruby/DL] 'S', 's'

From: Takaaki Tateishi <ttate@...>
Date: 2003-01-09 09:09:54 UTC
List: ruby-dev #19334
立石です.

At Thu, 9 Jan 2003 16:13:17 +0900,
> となってますが、ext/dl/sym.cのrb_dlsym_call()を見ると逆です。
>   case 'S':
>     return "const char *";
>   case 's':
>     return "char *";
> という記述もあるので、どうも実装のほうが間違ってるようです。

一瞬自分でも間違えてるかもと思ってしまいましたが,実は const char * と
いう記述が正確ではないです.const char * とあるのはあくまで書き込みを
行わないという宣言程度の意味です.

以下の結果となりますが,すべて意図した通りのものです. 'S' の方はRuby
で確保されている実際の文字列の領域へ書き込みが行われそのままそのオブジ
ェクトを返します.'s'の方はdl内部でメモリを確保して新しいStringオブジェ
クトを返しています.

irb(main):009:0> sym = h['strcpy','SsS']
=> #<DL::Symbol:0x8145ab0 func=0x401c88b0 'const char *strcpy(char *, const char *);'>
irb(main):010:0> sym.call("   ","ab")
=> ["ab", ["ab", "ab"]]

          ↑ "   " と "ab" は異なるオブジェクトです.

irb(main):011:0> sym = h['strcpy','SSS']
=> #<DL::Symbol:0x8100158 func=0x401c88b0 'const char *strcpy(const char *, const char *);'>
irb(main):012:0> sym.call("   ","ab")
=> ["ab", ["ab\000", "ab"]]

          ↑ これはもともとの "   " が長さが3だったためです.
             2つのオブジェクトは同じオブジェクトです.
-- 
Takaaki Tateishi <ttate@kt.jaist.ac.jp>

In This Thread