aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2004-04-22 06:34:56 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2004-04-22 06:34:56 +0000
commit30cce8f1904a4b593c4d0a0f0181572bed06e5b6 (patch)
tree7ae5d55e27aa2413b5f3c192c930f32631e1931f
parent85e0e85498d71d4ac6c7bf4f75c6bd8f7709c7ac (diff)
downloadperl-URPM-30cce8f1904a4b593c4d0a0f0181572bed06e5b6.tar
perl-URPM-30cce8f1904a4b593c4d0a0f0181572bed06e5b6.tar.gz
perl-URPM-30cce8f1904a4b593c4d0a0f0181572bed06e5b6.tar.bz2
perl-URPM-30cce8f1904a4b593c4d0a0f0181572bed06e5b6.tar.xz
perl-URPM-30cce8f1904a4b593c4d0a0f0181572bed06e5b6.zip
(return_list_tag) factorize common local variables declaration (though
it wastes 4 pointer slots on stack in RPMTAG_SUMMARY case)
-rw-r--r--URPM.xs25
1 files changed, 5 insertions, 20 deletions
diff --git a/URPM.xs b/URPM.xs
index 3e84100..51734da 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -745,47 +745,32 @@ return_list_tag(URPM__Package pkg, int_32 tag_name) {
}
}
} else {
+ char *name;
+ char *version;
+ char *release;
+ char *arch;
+ char *eos;
switch (tag_name) {
case RPMTAG_NAME:
{
- char *name;
- char *version;
- char *release;
- char *arch;
- char *eos;
get_fullname_parts(pkg, &name, &version, &release, &arch, &eos);
XPUSHs(sv_2mortal(newSVpv(name, version-name)));
}
break;
case RPMTAG_VERSION:
{
- char *name;
- char *version;
- char *release;
- char *arch;
- char *eos;
get_fullname_parts(pkg, &name, &version, &release, &arch, &eos);
XPUSHs(sv_2mortal(newSVpv(version, release-version)));
}
break;
case RPMTAG_RELEASE:
{
- char *name;
- char *version;
- char *release;
- char *arch;
- char *eos;
get_fullname_parts(pkg, &name, &version, &release, &arch, &eos);
XPUSHs(sv_2mortal(newSVpv(release, arch-release)));
}
break;
case RPMTAG_ARCH:
{
- char *name;
- char *version;
- char *release;
- char *arch;
- char *eos;
get_fullname_parts(pkg, &name, &version, &release, &arch, &eos);
XPUSHs(sv_2mortal(newSVpv(arch, eos-arch)));
}