diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-06-13 18:44:18 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-06-13 18:44:18 +0000 |
commit | 38b88ed85d9d472c62209370f94ce82b3eb80c15 (patch) | |
tree | 609edcb899825cd778bdb99cf7c639701118f4ac | |
parent | 1869caccae3a2edd6cceb75e92e471169f0c6b64 (diff) | |
download | perl-URPM-38b88ed85d9d472c62209370f94ce82b3eb80c15.tar perl-URPM-38b88ed85d9d472c62209370f94ce82b3eb80c15.tar.gz perl-URPM-38b88ed85d9d472c62209370f94ce82b3eb80c15.tar.bz2 perl-URPM-38b88ed85d9d472c62209370f94ce82b3eb80c15.tar.xz perl-URPM-38b88ed85d9d472c62209370f94ce82b3eb80c15.zip |
(return_list_tag) use proper accessors
-rw-r--r-- | URPM.xs | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -487,10 +487,10 @@ return_list_uint_16(const Header header, rpmTag tag_name) { if (headerGet(header, tag_name, &list, HEADERGET_DEFAULT)) { int count = rpmtdCount(&list); int i; - uint16_t *list_ = list.data; EXTEND(SP, count); for(i = 0; i < count; i++) { - mPUSHs(newSViv(list_[i])); + rpmtdNext(&list); + mPUSHs(newSViv(rpmtdGetNumber(&list))); } rpmtdFreeData(&list); } @@ -554,25 +554,25 @@ return_list_tag(const URPM__Package pkg, rpmTag tag_name) { case RPM_INT32_TYPE: { int i; - int *r = (int *)list; EXTEND(SP, count); for (i=0; i < count; i++) { - mPUSHs(newSViv(r[i])); + rpmtdNext(&td); + mPUSHs(newSViv(rpmtdGetNumber(&td))); } } break; case RPM_STRING_TYPE: - mXPUSHs(newSVpv((char *) list, 0)); + mPUSHs(newSVpv(rpmtdGetString(&td), 0)); break; case RPM_BIN_TYPE: break; case RPM_STRING_ARRAY_TYPE: { int i; - char **s = (char **)list; EXTEND(SP, count); + rpmtdInit(&td); for (i = 0; i < count; i++) - mPUSHs(newSVpv(s[i], 0)); + mPUSHs(newSVpv(rpmtdNextString(&td), 0)); } break; case RPM_I18NSTRING_TYPE: |