Skip Menu |

This queue is for tickets about the GD CPAN distribution.

Report information
The Basics
Id: 11488
Status: resolved
Worked: 1 min
Priority: 0/
Queue: GD

People
Owner: LDS [...] cpan.org
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 2.21
Fixed in: (no value)



Subject: GD::constant does not need arg parameter
The attached patch removed the arg parameter from the GD::constant function, as it is not used (anymore?). Futhermore, now it is possible to call GD constants in a OO-way (for example "GD->gdBrushed") without getting warnings. The OO-style is useful if someone wants to use the same code with either GD or GD::SVG. The patch also removed the shebang from the generated GD.pm and adds a "DO NOT EDIT" warning on top of the module. Regards, Slaven
# # # To apply this patch: # STEP 1: Chdir to the source directory. # STEP 2: Run the 'applypatch' program with this patch file as input. # # If you do not have 'applypatch', it is part of the 'makepatch' package # that you can fetch from the Comprehensive Perl Archive Network: # http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz # In the above URL, 'x' should be 2 or higher. # # To apply this patch without the use of 'applypatch': # STEP 1: Chdir to the source directory. # STEP 2: Run the 'patch' program with this file as input. # #### End of Preamble #### #### Patch data follows #### diff -up 'build/GD-2.21/GD.pm.PLS' 'new.build/GD-2.21/GD.pm.PLS' Index: ./GD.pm.PLS --- ./GD.pm.PLS Wed Feb 9 19:39:42 2005 +++ ./GD.pm.PLS Sun Feb 13 12:30:45 2005 @@ -19,9 +19,8 @@ open OUT,">$file" or die "Can't create $ print "Extracting $file (with variable substitutions)\n"; -print OUT "$Config{startperl}\n"; - print OUT <<"!GROK!THIS!"; +# DO NOT EDIT! THIS FILE IS AUTOGENERATED BY $0 package GD; @@ -106,7 +105,7 @@ sub AUTOLOAD { my($constname); ($constname = $AUTOLOAD) =~ s/.*:://; - my $val = constant($constname, @_ ? $_[0] : 0); + my $val = constant($constname); if ($! != 0) { if ($! =~ /Invalid/) { $AutoLoader::AUTOLOAD = $AUTOLOAD; diff -up 'build/GD-2.21/GD.xs' 'new.build/GD-2.21/GD.xs' Index: ./GD.xs --- ./GD.xs Mon Jan 31 20:59:34 2005 +++ ./GD.xs Sun Feb 13 11:59:08 2005 @@ -59,7 +59,7 @@ not_here(char *s) } static double -constant(char *name, int arg) +constant(char *name) { errno = 0; switch (*name) { @@ -516,9 +516,8 @@ gd_chkimagefmt(GD__Image image, int true MODULE = GD PACKAGE = GD double -constant(name,arg) +constant(name) char * name - int arg MODULE = GD PACKAGE = GD::Image PREFIX=gd #### End of Patch data #### #### ApplyPatch data follows #### # Data version : 1.0 # Date generated : Sun Feb 13 12:32:37 2005 # Generated by : makepatch 2.00_05 # Recurse directories : Yes # p 'GD.pm.PLS' 67938 1108294245 0100755 # p 'GD.xs' 47448 1108292348 0100640 #### End of ApplyPatch data #### #### End of Patch kit [created: Sun Feb 13 12:32:37 2005] #### #### Patch checksum: 61 1614 45923 #### #### Checksum: 79 2238 31913 ####
Thanks very much for the patch. It will appear in version 2.23. Lincoln [SREZIC - Sun Feb 13 06:38:42 2005]: Show quoted text
> The attached patch removed the arg parameter from the GD::constant
function, Show quoted text
> as it is not used (anymore?). Futhermore, now it is possible to call > GD constants in a OO-way (for example "GD->gdBrushed") without
getting Show quoted text
> warnings. The OO-style is useful if someone wants to use the same
code Show quoted text
> with either GD or GD::SVG. > > The patch also removed the shebang from the generated GD.pm and adds
a Show quoted text
> "DO NOT EDIT" warning on top of the module. > > Regards, > Slaven