develooper Front page | perl.perl5.porters | Postings from July 2013

[perl #116296] [PATCH] remove PL_patchlevel from and optimize S_minus_v

Thread Next
From:
Tony Cook via RT
Date:
July 5, 2013 07:01
Subject:
[perl #116296] [PATCH] remove PL_patchlevel from and optimize S_minus_v
Message ID:
rt-3.6.HEAD-2552-1373007669-1906.116296-15-0@perl.org
On Fri Jan 04 09:37:10 2013, bulk88 wrote:
> See attached patch.

This patch no longer applies.

I can see a couple of places it could be improved:

+		    level = Perl_newSVpvf_nocontext("%s", num);

Couldn't this just be:

  level = newSVpvn(num, num_len);

 	PerlIO_printf(PIO_stdout,
-		Perl_form(aTHX_ "\nThis is perl, %"SVf"\n",
-		    SVfARG(vstringify(PL_patchlevel))));
+		Perl_form(aTHX_ "\nThis is perl, " "v" PERL_VERSION_STRING "\n");

Why is Perl_form() being called here?

#elif defined(UNDER_CE)
 			"WINCE port by Rainer Keuchel, 2001-2002\n"
 			"Built on " __DATE__ " " __TIME__ "\n\n");
 	wce_hitreturn();
-#endif
-#ifdef __SYMBIAN32__
-	PerlIO_printf(PIO_stdout,
-		      "Symbian port by Nokia, 2004-2005\n");
-#endif
+#elif defined(__SYMBIAN32__)
+		      "Symbian port by Nokia, 2004-2005\n"
+#endif /* end of additional copyright lines */
+
 #ifdef BINARY_BUILD_NOTICE
+#  ifndef UNDER_CE
+	); /* close Larry Wall copyright printf */
+#  endif
 	BINARY_BUILD_NOTICE;
-#endif
 	PerlIO_printf(PIO_stdout,
+#elif defined(UNDER_CE) /* because of wce_hitreturn() open new printf */
+	PerlIO_printf(PIO_stdout,
+/* else CPP catenation continues from Larry Wall copyright printf */
+#endif

The contortions to handle UNDER_CE ending the PerlIO_printf() are
confusing.  Wouldn't it be better to put the wce_hitreturn() in it's own
#ifdef UNDER_CE ?

Tony

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org:443/rt3/Ticket/Display.html?id=116296

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About