+2008-06-30 Guillem Jover <guillem@debian.org>
+
+ * lib/dpkg-db.h (struct arbitraryfield): Make all 'char *' members
+ 'const'.
+ (struct filedetails): Likewise.
+ (struct pkginfoperfile): Likewise.
+ (struct trigpend): Likewise.
+
+ * lib/parse.c (parsedb): Remove now unneeded 'const char **' casts.
+ * src/processarc.c (process_archive): Change size variable before
+ assigning the pointer.
+
2008-06-30 Guillem Jover <guillem@debian.org>
* dselect/baselist.cc (baselist::wordwrapinfo): Surround expression
struct arbitraryfield {
struct arbitraryfield *next;
- char *name;
- char *value;
+ const char *name;
+ const char *value;
};
struct conffile {
struct filedetails {
struct filedetails *next;
- char *name;
- char *msdosname;
- char *size;
- char *md5sum;
+ const char *name;
+ const char *msdosname;
+ const char *size;
+ const char *md5sum;
};
struct pkginfoperfile { /* pif */
struct dependency *depends;
struct deppossi *depended;
int essential; /* The `essential' flag, 1=yes, 0=no (absent) */
- char *description, *maintainer, *source, *architecture, *installedsize, *origin, *bugs;
+ const char *description;
+ const char *maintainer;
+ const char *source;
+ const char *architecture;
+ const char *installedsize;
+ const char *origin;
+ const char *bugs;
struct versionrevision version;
struct conffile *conffiles;
struct arbitraryfield *arbs;
* trigger cycle checker (see trigproc.c).
*/
struct trigpend *next;
- char *name;
+ const char *name;
};
struct trigaw {
parse_must_have_field(filename, lno, &newpig, newpig.name, "package name");
if ((flags & pdb_recordavailable) || newpig.status != stat_notinstalled) {
parse_ensure_have_field(filename, lno, warnto, warncount, &newpig,
- (const char **)&newpifp->description, "description");
+ &newpifp->description, "description");
parse_ensure_have_field(filename, lno, warnto, warncount, &newpig,
- (const char **)&newpifp->maintainer, "maintainer");
+ &newpifp->maintainer, "maintainer");
if (newpig.status != stat_halfinstalled)
parse_must_have_field(filename, lno, &newpig,
newpifp->version.version, "version");
}
if (flags & pdb_recordavailable)
parse_ensure_have_field(filename, lno, warnto, warncount, &newpig,
- (const char **)&newpifp->architecture, "architecture");
+ &newpifp->architecture, "architecture");
/* Check the Config-Version information:
* If there is a Config-Version it is definitely to be used, but
struct pkginfo *pkg, *otherpkg, *divpkg;
char *cidir, *cidirrest, *p;
char *pfilenamebuf, conffilenamebuf[MAXCONFFILENAME];
+ char *psize;
const char *pfilename, *newinfofilename, *failed;
struct fileinlist *newconff, **newconffileslastp;
struct fileinlist *cfile;
pkg->files->name = pkg->files->msdosname = pkg->files->md5sum = NULL;
}
/* Always nfmalloc. Otherwise, we may overwrite some other field(like md5sum). */
- pkg->files->size= nfmalloc(30);
- sprintf(pkg->files->size,"%lu",(unsigned long)stab.st_size);
+ psize = nfmalloc(30);
+ sprintf(psize, "%lu", (unsigned long)stab.st_size);
+ pkg->files->size = psize;
if (cipaction->arg == act_avail) {
printf(_("Recorded info about %s from %s.\n"),pkg->name,pfilename);