Kill off last remaining uses of _constfree()
- practially all the data in rpmfi needs to be treated as const, these are just a funky special case which point to header memory for the couple of cases where KEEPHEADER is still used
This commit is contained in:
parent
cef9afbf2a
commit
33685ef74e
23
lib/rpmfi.c
23
lib/rpmfi.c
|
@ -1079,21 +1079,22 @@ fprintf(stderr, "*** fi %p\t[%d]\n", fi, fi->fc);
|
|||
fi->fstates = _free(fi->fstates);
|
||||
fi->fps = _free(fi->fps);
|
||||
|
||||
/* these point to header memory if KEEPHEADER is used, dont free */
|
||||
if (!(fi->fiflags & RPMFI_KEEPHEADER) && fi->h == NULL) {
|
||||
fi->fmtimes = _constfree(fi->fmtimes);
|
||||
fi->fmtimes = _free(fi->fmtimes);
|
||||
fi->fmodes = _free(fi->fmodes);
|
||||
fi->fflags = _constfree(fi->fflags);
|
||||
fi->vflags = _constfree(fi->vflags);
|
||||
fi->fsizes = _constfree(fi->fsizes);
|
||||
fi->frdevs = _constfree(fi->frdevs);
|
||||
fi->finodes = _constfree(fi->finodes);
|
||||
fi->fflags = _free(fi->fflags);
|
||||
fi->vflags = _free(fi->vflags);
|
||||
fi->fsizes = _free(fi->fsizes);
|
||||
fi->frdevs = _free(fi->frdevs);
|
||||
fi->finodes = _free(fi->finodes);
|
||||
fi->dil = _free(fi->dil);
|
||||
|
||||
fi->fcolors = _constfree(fi->fcolors);
|
||||
fi->fcdictx = _constfree(fi->fcdictx);
|
||||
fi->ddict = _constfree(fi->ddict);
|
||||
fi->fddictx = _constfree(fi->fddictx);
|
||||
fi->fddictn = _constfree(fi->fddictn);
|
||||
fi->fcolors = _free(fi->fcolors);
|
||||
fi->fcdictx = _free(fi->fcdictx);
|
||||
fi->ddict = _free(fi->ddict);
|
||||
fi->fddictx = _free(fi->fddictx);
|
||||
fi->fddictn = _free(fi->fddictn);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,31 +32,31 @@ struct rpmfi_s {
|
|||
scidx_t * flangs; /*!< Index to file lang(s) cache */
|
||||
|
||||
uint32_t * dil; /*!< Directory indice(s) (from header) */
|
||||
const rpm_flag_t * fflags; /*!< File flag(s) (from header) */
|
||||
const rpm_off_t * fsizes; /*!< File size(s) (from header) */
|
||||
const rpm_time_t * fmtimes; /*!< File modification time(s) (from header) */
|
||||
rpm_flag_t * fflags; /*!< File flag(s) (from header) */
|
||||
rpm_off_t * fsizes; /*!< File size(s) (from header) */
|
||||
rpm_time_t * fmtimes; /*!< File modification time(s) (from header) */
|
||||
rpm_mode_t * fmodes; /*!< File mode(s) (from header) */
|
||||
const rpm_rdev_t * frdevs; /*!< File rdev(s) (from header) */
|
||||
const rpm_ino_t * finodes; /*!< File inodes(s) (from header) */
|
||||
rpm_rdev_t * frdevs; /*!< File rdev(s) (from header) */
|
||||
rpm_ino_t * finodes; /*!< File inodes(s) (from header) */
|
||||
|
||||
scidx_t *fuser; /*!< Index to file owner(s) cache */
|
||||
scidx_t *fgroup; /*!< Index to file group(s) cache */
|
||||
|
||||
char * fstates; /*!< File state(s) (from header) */
|
||||
|
||||
const rpm_color_t * fcolors;/*!< File color bits (header) */
|
||||
rpm_color_t * fcolors; /*!< File color bits (header) */
|
||||
strcache fcapcache; /*!< File capabilities cache */
|
||||
scidx_t * fcaps; /*!< Index to file cap(s) cache */
|
||||
|
||||
const char ** cdict; /*!< File class dictionary (header) */
|
||||
char ** cdict; /*!< File class dictionary (header) */
|
||||
rpm_count_t ncdict; /*!< No. of class entries. */
|
||||
const uint32_t * fcdictx; /*!< File class dictionary index (header) */
|
||||
uint32_t * fcdictx; /*!< File class dictionary index (header) */
|
||||
|
||||
const uint32_t * ddict; /*!< File depends dictionary (header) */
|
||||
uint32_t * ddict; /*!< File depends dictionary (header) */
|
||||
rpm_count_t nddict; /*!< No. of depends entries. */
|
||||
const uint32_t * fddictx; /*!< File depends dictionary start (header) */
|
||||
const uint32_t * fddictn; /*!< File depends dictionary count (header) */
|
||||
const rpm_flag_t * vflags; /*!< File verify flag(s) (from header) */
|
||||
uint32_t * fddictx; /*!< File depends dictionary start (header) */
|
||||
uint32_t * fddictn; /*!< File depends dictionary count (header) */
|
||||
rpm_flag_t * vflags; /*!< File verify flag(s) (from header) */
|
||||
|
||||
rpm_count_t dc; /*!< No. of directories. */
|
||||
rpm_count_t fc; /*!< No. of files. */
|
||||
|
|
1
system.h
1
system.h
|
@ -246,7 +246,6 @@ typedef void * cap_t;
|
|||
#define xrealloc(_ptr, _size) rrealloc((_ptr), (_size))
|
||||
#define xstrdup(_str) rstrdup((_str))
|
||||
#define _free(_ptr) rfree((_ptr))
|
||||
#define _constfree(_ptr) rfree((void *)(_ptr))
|
||||
|
||||
/* Retrofit glibc __progname */
|
||||
#if defined __GLIBC__ && __GLIBC__ >= 2
|
||||
|
|
Loading…
Reference in New Issue