From: Gurusamy Sarathy Date: Sun, 5 Mar 2000 20:02:17 +0000 (+0000) Subject: prototype changes for eventually supporting C X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1c1fc3ea10284b28de560550fae130e9d453e5c1;p=p5sagit%2Fp5-mst-13.2.git prototype changes for eventually supporting C and C p4raw-id: //depot/perl@5554 --- diff --git a/opcode.h b/opcode.h index ce88940..646add4 100644 --- a/opcode.h +++ b/opcode.h @@ -1643,12 +1643,12 @@ EXT U32 PL_opargs[] = { 0x00001a44, /* dump */ 0x00001a44, /* goto */ 0x00013644, /* exit */ - 0x0132c81c, /* open */ + 0x0052c81c, /* open */ 0x0001d614, /* close */ 0x000cc814, /* pipe_op */ 0x0000d61c, /* fileno */ 0x0001361c, /* umask */ - 0x0000d604, /* binmode */ + 0x0012c804, /* binmode */ 0x0042e855, /* tie */ 0x0000f614, /* untie */ 0x0000f604, /* tied */ diff --git a/opcode.pl b/opcode.pl index 59b039b..29ef602 100755 --- a/opcode.pl +++ b/opcode.pl @@ -605,13 +605,13 @@ exit exit ck_fun ds% S? # I/O. -open open ck_fun ist@ F S? S? +open open ck_fun ist@ F S? L close close ck_fun is% F? pipe_op pipe ck_fun is@ F F fileno fileno ck_fun ist% F umask umask ck_fun ist% S? -binmode binmode ck_fun s% F +binmode binmode ck_fun s@ F S? tie tie ck_fun idms@ R S L untie untie ck_fun is% R diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 758b573..650a00a 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -439,6 +439,8 @@ does. Returns true if it succeeded, false otherwise. NAME should be a packed address of the appropriate type for the socket. See the examples in L. +=item binmode FILEHANDLE, DISCIPLINE + =item binmode FILEHANDLE Arranges for FILEHANDLE to be read or written in "binary" mode on @@ -2538,7 +2540,7 @@ to be converted into a file mode, for example. (Although perl will automatically convert strings into numbers as needed, this automatic conversion assumes base 10.) -=item open FILEHANDLE,MODE,EXPR +=item open FILEHANDLE,MODE,LIST =item open FILEHANDLE,EXPR diff --git a/pp.c b/pp.c index 4210bd6..300b20f 100644 --- a/pp.c +++ b/pp.c @@ -426,7 +426,7 @@ PP(pp_prototype) seen_question = 1; str[n++] = ';'; } - else if (seen_question) + else if (n && str[0] == ';' && seen_question) goto set; /* XXXX system, exec */ if ((oa & (OA_OPTIONAL - 1)) >= OA_AVREF && (oa & (OA_OPTIONAL - 1)) <= OA_HVREF) { diff --git a/t/comp/proto.t b/t/comp/proto.t index 6381fac..ee17088 100755 --- a/t/comp/proto.t +++ b/t/comp/proto.t @@ -384,7 +384,7 @@ print "ok ", $i++, "\n"; print "not " if defined prototype('CORE::system'); print "ok ", $i++, "\n"; -print "# CORE::open => ($p)\nnot " if ($p = prototype('CORE::open')) ne '*;$;$'; +print "# CORE::open => ($p)\nnot " if ($p = prototype('CORE::open')) ne '*;$@'; print "ok ", $i++, "\n"; print "# CORE:Foo => ($p), \$@ => `$@'\nnot " diff --git a/toke.c b/toke.c index 322e194..8b3a69f 100644 --- a/toke.c +++ b/toke.c @@ -3984,7 +3984,7 @@ Perl_yylex(pTHX) LOP(OP_BIND,XTERM); case KEY_binmode: - UNI(OP_BINMODE); + LOP(OP_BINMODE,XTERM); case KEY_bless: LOP(OP_BLESS,XTERM);