In perl.git, the branch smoke-me/nicholas/conditional-gdbmcompat has been created
<http://perl5.git.perl.org/perl.git/commitdiff/f0fe019a81bffdc6f23c6c00d5fa100df21f8428?hp=0000000000000000000000000000000000000000> at f0fe019a81bffdc6f23c6c00d5fa100df21f8428 (commit) - Log ----------------------------------------------------------------- commit f0fe019a81bffdc6f23c6c00d5fa100df21f8428 Merge: f5957b2 1fa0529 Author: Nicholas Clark <[email protected]> Date: Wed Mar 19 11:03:04 2014 +0100 Merge the refactoring of Perl_do_openn() to blead. This makes Perl_do_openn() a wrapper around two functions Perl_do_open_raw() and Perl_do_open6(), which provide sysopen and open functionality. In turn, shared setup and cleanup code from these two is moved to two static functions S_openn_setup() and S_openn_cleanup(). For now both functions are not part of the public API, as they may change, and offer no functionality that isn't already accessible via Perl_do_openn(). These changes make it easi*er* to follow the twisted logic of open. commit 1fa0529f3cc4d34c0e6de25fce89bf2721ccac5f Author: Nicholas Clark <[email protected]> Date: Sun Mar 2 10:12:08 2014 +0100 In Perl_nextargv(), move variable declarations into the blocks that use them. This makes it clearer that variables don't hold values between iterations of the loop, and permits the variable sv to be made const. M doio.c commit d8015975ab8da00c47775a05a91a9d72f379bf1b Author: Nicholas Clark <[email protected]> Date: Sun Mar 2 10:02:51 2014 +0100 Simplify the code in Perl_nextargv(). Split the ternary that called Perl_do_open_raw() and Perl_do_open6() based on PL_inplace into two different if blocks, and merge these with the following code which is also conditional on PL_inplace. Remove the warning code from an else block and re-indent it, to make it clear that it is always called if control reaches the end of the while loop. M doio.c commit d5eb9a4687ba974ffd0d02aab53326c5aba6a9e0 Author: Nicholas Clark <[email protected]> Date: Sun Mar 2 09:50:38 2014 +0100 Change core uses of Perl_do_openn() to Perl_do_open6() or Perl_do_open_raw(). Calls to Perl_do_openn() all have at least 2 unused arguments which clutter the code and hinder easy understanding. Perl_do_open6() and Perl_do_open_raw() each only do one job, so don't have the dead arguments. M doio.c M os2/os2.c M pp_hot.c M pp_sys.c commit 4b451737e0f77cc9e91b1336d04f21659d96b732 Author: Nicholas Clark <[email protected]> Date: Sun Mar 2 09:26:29 2014 +0100 Split Perl_do_openn() into Perl_do_open_raw() and Perl_do_open6(). Perl_do_open_raw() handles the as_raw part of Perl_do_openn(). Perl_do_open6() handles the !as_raw part of Perl_do_openn(). do_open6() isn't a great name, but I can't see an obvious concise name that covers 2 arg open, 3 arg open, piped open, implicit fork, and layers. M doio.c M embed.fnc M embed.h M proto.h commit a6fc70e55b0240c99a09f1d7185e5c59ffd57206 Author: Nicholas Clark <[email protected]> Date: Sun Mar 2 08:14:13 2014 +0100 Extract the cleanup code of Perl_do_openn() into S_openn_cleanup(). A 12 parameter function is extremely ugly (as demonstrated by the need to add macros for it to perl.h), but it's private, and it will permit the two-headed public interface of Perl_do_openn() to be simplified. M doio.c M embed.fnc M embed.h M perl.h M proto.h commit a2b41d5ca668b3be2860093f464392277e1d0034 Author: Nicholas Clark <[email protected]> Date: Sun Mar 2 07:38:00 2014 +0100 Extract the setup code of Perl_do_openn() into S_openn_setup(). M doio.c M embed.fnc M embed.h M proto.h commit b4464d55c8c3facb333bef167fb547bff86d55ae Author: Nicholas Clark <[email protected]> Date: Sat Mar 1 22:53:52 2014 +0100 In Perl_do_openn(), disambiguate the two separate uses of the variable fd. Rename the first uses of the variable fd to wanted_fd to show that the variable is not used to pass a value to later in the function. M doio.c commit 26297fe91bb067fd2c1370f1d9b8b1120e30e50e Author: Nicholas Clark <[email protected]> Date: Sat Mar 1 22:38:18 2014 +0100 In Perl_do_openn(), move the variable result into the block that uses it. This also removes a couple of places which would set result = 0 to simulate "success" for an a later if block. Those paths now don't even reach that if block. M doio.c commit 9229bf8d9dfb18c8cb2feba39b2482f9fd83cf11 Author: Nicholas Clark <[email protected]> Date: Sat Mar 1 21:32:19 2014 +0100 Perl_do_openn() doesn't need to set num_svs and svp. These variables are no longer used later in the function, so no need to set them. This permits the declaration of the variable namesv to be moved from the top of the function into the blocks that use it. M doio.c commit 7c491510e1dbbc37aae15850c893746a82211cf5 Author: Nicholas Clark <[email protected]> Date: Sat Mar 1 21:10:38 2014 +0100 Perl_do_openn() should call PerlIO_openn() with arg NULL if narg is 0. If narg is NULL, then PerlIO_openn() doesn't look at args. (Technically except for PerlIOStdio_open() if f is non-NULL, which doesn't check narg and assumes that args[0] is valid. That lack of check is probably a bug. But it doesn't matter in this case, as f is NULL) This makes it clear that arg isn't needed at this point in Perl_do_openn(). This is a more complete version of the change made by commit dd37d22f759197ae (March 2002), which just changed the call to pass 0 for narg. M doio.c commit c564b489757973ad664254ae00cf16880e1f7db5 Author: Nicholas Clark <[email protected]> Date: Sat Mar 1 22:00:29 2014 +0100 In Perl_do_openn(), move {in,out}_{raw,crlf} into the !as_raw block. These 4 variables are only needed there, so by moving them into the block we save doing unneeded work for the as_raw case (ie sysopen), and as a side effect make the function a bit clearer. M doio.c commit 0c9de5b7970eafe06ebc3a92f5f24b972581372d Author: Nicholas Clark <[email protected]> Date: Sun Mar 2 15:36:52 2014 +0100 Tests that warnings are emitted if in-place edit fails to open a pathname. These have the same text as other warnings which are tested. However the existing tests only covered the code path where a directory was able to be opened (read only) and then caught by an explicit stat test for non-files. M t/lib/warnings/doio ----------------------------------------------------------------------- -- Perl5 Master Repository
