The uploaded file
MP3-Mplib-0.01.tar.gz
has entered CPAN as
file: $CPAN/authors/id/V/VP/VPARSEVAL/MP3-Mplib-0.01.tar.gz
size: 80543 bytes
md5: 7acf4fa07a13648ecbc9e0509a27b6da
No action is required on your part
Request entered by: VPARSEVAL (Tassilo von Parseval)
Request entered on: Mon, 02 Dec 2002 12:15:17 GMT
Request completed: Mon, 02 Dec 2002 12:15:57 GMT
Virtually Yours,
Id: paused,v 1.81 2002/08/02 11:34:24 k Exp k
Another tough session today made the above possible. Perl5.8.0 complained about some readonly values that I tried set somewhere within my XS code. It took a while to find the delinquent. 5.005_03 and 5.6.1 did not have these objections.
In the last moment I decided to use Test::More instead of Test. That made a few rewrites necessary, too.
Also, h2xs obviously screwed up when I created the extension skeleton some months ago. This part was funny actually: When I tested all the constants from mplib.h, Perl failed to export UTF16...but only on this one. UTF16BE and all the other encodings worked ok. I located the error somewhere here:
static double
constant_UTF1(char *name, int len, int arg)
{
if (4 + 1 >= len ) {
errno = EINVAL;
return 0;
}
switch (name[4 + 1]) {
case '\0':
if (strEQ(name + 4, "6")) {
#ifdef UTF16
return UTF16;
#else
goto not_there;
#endif
}
case 'B':
if (strEQ(name + 4, "6BE")) {
#ifdef UTF16BE
return UTF16BE;
#else
goto not_there;
#endif
It turned out that the first if-condition was messed up. It should have been:
if (3 + 1 >= len ) {
I have no explanation for this failure but I find it somehow amusing that even a machine can come up with an incorrect calculation of a string length. This puts my sometimes scaringly silly errors into the right perspective, I think.
<rant>
Who actually came up with this insane constant handling in XS code? A constant name is cut into strings of variable length and then control is delegated to another suitable constant-function that exclusively deals with constants of a particular prefix. If that is a performance tweak then it is silly since any constant is only retrieved once and after that compiled into a subroutine by AUTOLOAD.
</rant>
Insane XS constant handling code (Score:1)
Fair comment.
What you saw with the miscalculated
ifcondition looks like the bug I found in the constant generaExtUtils::Constant (Score:1)
This makes it very hard to add new constants later on, if later versions of the module you're wrapping add new constants. It also means that you're stuck with whatever lousy autogenerated switch code was the style at the time of the h2xs you ran.
That was exactly my second thought after fixing
constant_U(): What happens if the next release of mplib has additional constants? I don't want to re-run h2xs (and