aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-11-01 14:50:21 +0000
committerThierry Vignaud <tv@mageia.org>2012-11-01 14:50:21 +0000
commit349a648379f1614160cd9fc6458f6b8b204bbc06 (patch)
tree6586072124052c823adf0b58937f3dda1d10400d /URPM.xs
parent608b038bddb3de524058039c88b64285f84ba774 (diff)
downloadperl-URPM-349a648379f1614160cd9fc6458f6b8b204bbc06.tar
perl-URPM-349a648379f1614160cd9fc6458f6b8b204bbc06.tar.gz
perl-URPM-349a648379f1614160cd9fc6458f6b8b204bbc06.tar.bz2
perl-URPM-349a648379f1614160cd9fc6458f6b8b204bbc06.tar.xz
perl-URPM-349a648379f1614160cd9fc6458f6b8b204bbc06.zip
rename FLAG_ID as FLAG_ID_MASK as it really is a mask
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs16
1 files changed, 8 insertions, 8 deletions
diff --git a/URPM.xs b/URPM.xs
index 5169e4a..70d5805 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -77,7 +77,7 @@ typedef struct s_Transaction* URPM__DB;
typedef struct s_Transaction* URPM__Transaction;
typedef struct s_Package* URPM__Package;
-#define FLAG_ID 0x001fffffU
+#define FLAG_ID_MASK 0x001fffffU
#define FLAG_RATE 0x00e00000U
#define FLAG_BASE 0x01000000U
#define FLAG_SKIP 0x02000000U
@@ -803,7 +803,7 @@ update_hash_entry(HV *hash, const char *name, STRLEN len, int force, IV use_sens
}
if (isv && *isv != &PL_sv_undef) {
char id[8];
- STRLEN id_len = snprintf(id, sizeof(id), "%d", pkg->flag & FLAG_ID);
+ STRLEN id_len = snprintf(id, sizeof(id), "%d", pkg->flag & FLAG_ID_MASK);
SV **sense = hv_fetch((HV*)SvRV(*isv), id, id_len, 1);
if (sense && use_sense) sv_setiv(*sense, use_sense);
}
@@ -1031,7 +1031,7 @@ parse_line(AV *depslist, HV *provides, HV *obsoletes, URPM__Package pkg, char *b
int data_len = 1+strlen(data);
if (!strcmp(tag, "info")) {
pkg->info = memcpy(malloc(data_len), data, data_len);
- pkg->flag &= ~FLAG_ID;
+ pkg->flag &= ~FLAG_ID_MASK;
pkg->flag |= 1 + av_len(depslist);
URPM__Package _pkg;
SV *sv_pkg = sv_setref_pv(newSVpvs(""), "URPM::Package",
@@ -1824,7 +1824,7 @@ void
Pkg_id(pkg)
URPM::Package pkg
PPCODE:
- int id = pkg->flag & FLAG_ID;
+ int id = pkg->flag & FLAG_ID_MASK;
if (id <= FLAG_ID_MAX)
mXPUSHs(newSViv(id));
@@ -1833,10 +1833,10 @@ Pkg_set_id(pkg, id=-1)
URPM::Package pkg
int id
PPCODE:
- int old_id = pkg->flag & FLAG_ID;
+ int old_id = pkg->flag & FLAG_ID_MASK;
if (old_id <= FLAG_ID_MAX)
mXPUSHs(newSViv(old_id));
- pkg->flag &= ~FLAG_ID;
+ pkg->flag &= ~FLAG_ID_MASK;
pkg->flag |= id >= 0 && id <= FLAG_ID_MAX ? id : FLAG_ID_INVALID;
void
@@ -2532,7 +2532,7 @@ Trans_add(trans, pkg, ...)
URPM::Transaction trans
URPM::Package pkg
CODE:
- if ((pkg->flag & FLAG_ID) <= FLAG_ID_MAX && pkg->h != NULL) {
+ if ((pkg->flag & FLAG_ID_MASK) <= FLAG_ID_MAX && pkg->h != NULL) {
int update = 0;
rpmRelocation *relocations = NULL;
if (items > 3) {
@@ -2557,7 +2557,7 @@ Trans_add(trans, pkg, ...)
}
}
}
- RETVAL = rpmtsAddInstallElement(trans->ts, pkg->h, (fnpyKey)(1+(long)(pkg->flag & FLAG_ID)), update, relocations) == 0;
+ RETVAL = rpmtsAddInstallElement(trans->ts, pkg->h, (fnpyKey)(1+(long)(pkg->flag & FLAG_ID_MASK)), update, relocations) == 0;
/* free allocated memory, check rpm is copying it just above, at least in 4.0.4 */
free(relocations);
} else RETVAL = 0;