diff options
author | rjray <devnull@localhost> | 2000-11-14 06:19:10 +0000 |
---|---|---|
committer | rjray <devnull@localhost> | 2000-11-14 06:19:10 +0000 |
commit | f34af1ea587faf2141060c6400f88080377ffd00 (patch) | |
tree | a539244e92f76589732b9832f9447166d275258b /Perl-RPM | |
parent | 0f33f87d1ce6fb5d6e7023e2da4c3339d2e3d74c (diff) | |
download | librpm-tizen-f34af1ea587faf2141060c6400f88080377ffd00.tar.gz librpm-tizen-f34af1ea587faf2141060c6400f88080377ffd00.tar.bz2 librpm-tizen-f34af1ea587faf2141060c6400f88080377ffd00.zip |
Fixing scalar mortality issues
CVS patchset: 4265
CVS date: 2000/11/14 06:19:10
Diffstat (limited to 'Perl-RPM')
-rw-r--r-- | Perl-RPM/Makefile.PL | 5 | ||||
-rw-r--r-- | Perl-RPM/RPM/Database.xs | 13 | ||||
-rw-r--r-- | Perl-RPM/RPM/Header.xs | 16 |
3 files changed, 17 insertions, 17 deletions
diff --git a/Perl-RPM/Makefile.PL b/Perl-RPM/Makefile.PL index f0cf8ba32..af95c8845 100644 --- a/Perl-RPM/Makefile.PL +++ b/Perl-RPM/Makefile.PL @@ -1,6 +1,6 @@ #!/bin/perl -# $Id: Makefile.PL,v 1.15 2000/11/11 09:24:32 rjray Exp $ +# $Id: Makefile.PL,v 1.16 2000/11/14 06:19:10 rjray Exp $ use Config; use ExtUtils::MakeMaker; @@ -96,8 +96,9 @@ WriteMakefile( EXE_FILES => [ @SAMPLES ], OBJECT => $OBJECT, INC => "-Wunused -I. -I$rpm_libdir", + XSOPT => '-nolinenumbers', DIR => [], - XSOPT => '-nolinenumbers', +# XSOPT => '-nolinenumbers', dist => { COMPRESS => 'gzip -9f' }, clean => { FILES => $CLEAN } ); diff --git a/Perl-RPM/RPM/Database.xs b/Perl-RPM/RPM/Database.xs index 9ed27dadf..70b002a69 100644 --- a/Perl-RPM/RPM/Database.xs +++ b/Perl-RPM/RPM/Database.xs @@ -5,7 +5,7 @@ #include <fcntl.h> #include "RPM.h" -static char * const rcsid = "$Id: Database.xs,v 1.10 2000/11/11 09:24:32 rjray Exp $"; +static char * const rcsid = "$Id: Database.xs,v 1.11 2000/11/14 06:19:10 rjray Exp $"; /* rpmdb_TIEHASH @@ -114,8 +114,8 @@ RPM__Header rpmdb_FETCH(pTHX_ RPM__Database self, SV* key) svp = hv_fetch(dbstruct->storage, (char *)name, namelen, FALSE); if (svp && SvROK(*svp)) { - FETCH = (RPM__Header)SvRV(*svp); - return FETCH; + FETCH = (RPM__Header)(*svp); + return (RPM__Header)SvREFCNT_inc((SV *)FETCH); } #if RPM_MAJOR < 4 @@ -196,7 +196,7 @@ RPM__Header rpmdb_FETCH(pTHX_ RPM__Database self, SV* key) if (name != NULL) { hv_store(dbstruct->storage, (char *)name, namelen, - newRV((SV *)FETCH), FALSE); + (SV *)FETCH, FALSE); SvREFCNT_inc((SV *)FETCH); } } @@ -298,6 +298,7 @@ void rpmdb_DESTROY(pTHX_ RPM__Database self) { RPM_Database* dbstruct; /* This is the struct used to hold C-level data */ + /*fprintf(stderr, "rpmdb_DESTROY\n");*/ struct_from_object(RPM_Database, dbstruct, self); rpmdbClose(dbstruct->dbp); @@ -500,7 +501,7 @@ rpmdb_FIRSTKEY(self) value = newSVsv(&PL_sv_undef); } else - value = newRV((SV *)hvalue); + value = newRV_inc((SV *)hvalue); EXTEND(SP, 2); PUSHs(sv_2mortal(value)); @@ -524,7 +525,7 @@ rpmdb_NEXTKEY(self, key=NULL) nextvalue = newSVsv(&PL_sv_undef); } else - nextvalue = newRV((SV *)hvalue); + nextvalue = newRV_inc((SV *)hvalue); EXTEND(SP, 2); PUSHs(sv_2mortal(nextvalue)); diff --git a/Perl-RPM/RPM/Header.xs b/Perl-RPM/RPM/Header.xs index 1e30f1aa6..968f4eb13 100644 --- a/Perl-RPM/RPM/Header.xs +++ b/Perl-RPM/RPM/Header.xs @@ -4,7 +4,7 @@ #include "RPM.h" -static char * const rcsid = "$Id: Header.xs,v 1.20 2000/11/10 08:49:57 rjray Exp $"; +static char * const rcsid = "$Id: Header.xs,v 1.21 2000/11/14 06:19:10 rjray Exp $"; static int scalar_tag(pTHX_ SV *, int); /* @@ -335,6 +335,7 @@ RPM__Header rpmhdr_TIEHASH(pTHX_ char* class, SV* source, int flags) sv_magic((SV *)RETVAL, Nullsv, 'P', Nullch, 0); sv_magic((SV *)RETVAL, t_magic, '~', Nullch, 0); SvREFCNT_dec(t_magic); + /*fprintf(stderr, "rpmhdr_TIEHASH (%s)\n", retvalp->name);*/ return RETVAL; } @@ -388,8 +389,6 @@ SV* rpmhdr_FETCH(pTHX_ RPM__Header self, SV* key, if (svp && SvOK(*svp)) { FETCH = newSVsv(*svp); - if (SvROK(FETCH)) - FETCH = SvRV(FETCH); } else if (data_in) { @@ -398,12 +397,11 @@ SV* rpmhdr_FETCH(pTHX_ RPM__Header self, SV* key, SV* new_item = rpmhdr_create(aTHX_ data_in, type_in, size_in, scalar_tag(aTHX_ Nullsv, tag_by_num)); - hv_store(hdr->storage, uc_name, namelen, newRV((SV *)new_item), - FALSE); + hv_store(hdr->storage, uc_name, namelen, new_item, FALSE); hv_store(hdr->storage, strcat(uc_name, "_t"), (namelen + 2), newSViv(type_in), FALSE); - FETCH = new_item; + FETCH = newSVsv(new_item); } else { @@ -425,11 +423,10 @@ SV* rpmhdr_FETCH(pTHX_ RPM__Header self, SV* key, new_item = rpmhdr_create(aTHX_ new_item_p, new_item_type, size, scalar_tag(aTHX_ Nullsv, tag_by_num)); - hv_store(hdr->storage, uc_name, namelen, newRV((SV *)new_item), - FALSE); + hv_store(hdr->storage, uc_name, namelen, new_item, FALSE); hv_store(hdr->storage, strcat(uc_name, "_t"), (namelen + 2), newSViv(new_item_type), FALSE); - FETCH = new_item; + FETCH = newSVsv(new_item); } } @@ -946,6 +943,7 @@ void rpmhdr_DESTROY(pTHX_ RPM__Header self) struct_from_object(RPM_Header, hdr, self); if (! hdr) return; + /*fprintf(stderr, "rpmhdr_DESTROY (%s)\n", hdr->name);*/ if (hdr->iterator) headerFreeIterator(hdr->iterator); if (hdr->hdr) |