This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch main in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=b8a0dc982d4a554972d5dd129f2aa275e4be05ee commit b8a0dc982d4a554972d5dd129f2aa275e4be05ee Author: Guillem Jover <[email protected]> AuthorDate: Wed Sep 20 05:00:47 2023 +0200 Use FHFF_NONE instead of a literal 0 in calls to fsys_hash_find_node() Reported-by: Alexandre Detiste <[email protected]> Changelog: internal --- lib/dpkg/db-fsys-digest.c | 2 +- lib/dpkg/db-fsys-divert.c | 4 ++-- lib/dpkg/db-fsys-files.c | 2 +- lib/dpkg/db-fsys-override.c | 2 +- lib/dpkg/t/t-fsys-hash.c | 4 ++-- lib/dpkg/triglib.h | 2 +- src/divert/main.c | 4 ++-- src/main/archives.c | 6 +++--- src/main/help.c | 2 +- src/main/remove.c | 2 +- src/main/unpack.c | 2 +- src/query/main.c | 2 +- src/statoverride/main.c | 2 +- 13 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/dpkg/db-fsys-digest.c b/lib/dpkg/db-fsys-digest.c index 8aa2713ae..5b4252b08 100644 --- a/lib/dpkg/db-fsys-digest.c +++ b/lib/dpkg/db-fsys-digest.c @@ -125,7 +125,7 @@ parse_filehash_buffer(struct varbuf *buf, thisline, filename); /* Add the file to the list. */ - namenode = fsys_hash_find_node(filename, 0); + namenode = fsys_hash_find_node(filename, FHFF_NONE); namenode->newhash = nfstrsave(thisline); } } diff --git a/lib/dpkg/db-fsys-divert.c b/lib/dpkg/db-fsys-divert.c index bf0b7ff5a..e0054bb35 100644 --- a/lib/dpkg/db-fsys-divert.c +++ b/lib/dpkg/db-fsys-divert.c @@ -104,11 +104,11 @@ ensure_diversions(void) oicontest = nfmalloc(sizeof(*oicontest)); oialtname = nfmalloc(sizeof(*oialtname)); - oialtname->camefrom = fsys_hash_find_node(linebuf, 0); + oialtname->camefrom = fsys_hash_find_node(linebuf, FHFF_NONE); oialtname->useinstead = NULL; fgets_must(linebuf, sizeof(linebuf), file, diversionsname); - oicontest->useinstead = fsys_hash_find_node(linebuf, 0); + oicontest->useinstead = fsys_hash_find_node(linebuf, FHFF_NONE); oicontest->camefrom = NULL; fgets_must(linebuf, sizeof(linebuf), file, diversionsname); diff --git a/lib/dpkg/db-fsys-files.c b/lib/dpkg/db-fsys-files.c index abdd05109..099cad332 100644 --- a/lib/dpkg/db-fsys-files.c +++ b/lib/dpkg/db-fsys-files.c @@ -140,7 +140,7 @@ ensure_packagefiles_available(struct pkginfo *pkg) pkg_name(pkg, pnaw_nonambig)); *ptr = '\0'; - namenode = fsys_hash_find_node(thisline, 0); + namenode = fsys_hash_find_node(thisline, FHFF_NONE); lendp = pkg_files_add_file(pkg, namenode, lendp); thisline = nextline; } diff --git a/lib/dpkg/db-fsys-override.c b/lib/dpkg/db-fsys-override.c index 925286bc1..b74f6cbc2 100644 --- a/lib/dpkg/db-fsys-override.c +++ b/lib/dpkg/db-fsys-override.c @@ -252,7 +252,7 @@ ensure_statoverrides(enum statdb_parse_flags flags) if (thisline >= loaded_list_end) ohshit(_("unexpected end of line in statoverride file")); - fnn = fsys_hash_find_node(thisline, 0); + fnn = fsys_hash_find_node(thisline, FHFF_NONE); if (fnn->statoverride) ohshit(_("multiple statoverrides present for file '%.250s'"), thisline); diff --git a/lib/dpkg/t/t-fsys-hash.c b/lib/dpkg/t/t-fsys-hash.c index 88a05544b..4318779a3 100644 --- a/lib/dpkg/t/t-fsys-hash.c +++ b/lib/dpkg/t/t-fsys-hash.c @@ -50,7 +50,7 @@ test_fsys_nodes(void) test_pass(fnn->oldhash == NULL); test_pass(fnn->newhash == NULL); - fnn = fsys_hash_find_node("//./test/path/bb", 0); + fnn = fsys_hash_find_node("//./test/path/bb", FHFF_NONE); test_pass(fnn != NULL); test_pass(fsys_hash_entries() == 2); test_str(fnn->name, ==, "/test/path/bb"); @@ -58,7 +58,7 @@ test_fsys_nodes(void) test_pass(fnn->oldhash == NULL); test_pass(fnn->newhash == NULL); - fnn = fsys_hash_find_node("/test/path/cc", 0); + fnn = fsys_hash_find_node("/test/path/cc", FHFF_NONE); test_pass(fnn != NULL); test_pass(fsys_hash_entries() == 3); test_str(fnn->name, ==, "/test/path/cc"); diff --git a/lib/dpkg/triglib.h b/lib/dpkg/triglib.h index 946ba4b44..e4e101b2b 100644 --- a/lib/dpkg/triglib.h +++ b/lib/dpkg/triglib.h @@ -80,7 +80,7 @@ struct trig_hooks { #define TRIGHOOKS_DEFINE_NAMENODE_ACCESSORS \ static struct fsys_namenode *th_nn_find(const char *name, bool nonew) \ - { return fsys_hash_find_node(name, nonew ? FHFF_NO_NEW : 0); } \ + { return fsys_hash_find_node(name, nonew ? FHFF_NO_NEW : FHFF_NONE); } \ static struct trigfileint **th_nn_interested(struct fsys_namenode *fnn) \ { return &fnn->trig_interested; } \ static const char *th_nn_name(struct fsys_namenode *fnn) \ diff --git a/src/divert/main.c b/src/divert/main.c index 9fb6387ac..23a0cd07e 100644 --- a/src/divert/main.c +++ b/src/divert/main.c @@ -490,7 +490,7 @@ diversion_add(const char *const *argv) S_ISDIR(file_from.stat.st_mode)) badusage(_("cannot divert directories")); - fnn_from = fsys_hash_find_node(filename, 0); + fnn_from = fsys_hash_find_node(filename, FHFF_NONE); /* Handle divertto. */ if (opt_divertto == NULL) @@ -501,7 +501,7 @@ diversion_add(const char *const *argv) file_init(&file_to, opt_divertto); - fnn_to = fsys_hash_find_node(opt_divertto, 0); + fnn_to = fsys_hash_find_node(opt_divertto, FHFF_NONE); /* Handle package name. */ if (opt_pkgname == NULL) diff --git a/src/main/archives.c b/src/main/archives.c index 13263d2db..e23fc4564 100644 --- a/src/main/archives.c +++ b/src/main/archives.c @@ -426,7 +426,7 @@ tarobject_extract(struct tarcontext *tc, struct tar_entry *te, break; case TAR_FILETYPE_HARDLINK: varbuf_set_str(&hardlinkfn, dpkg_fsys_get_dir()); - linknode = fsys_hash_find_node(te->linkname, 0); + linknode = fsys_hash_find_node(te->linkname, FHFF_NONE); varbuf_add_str(&hardlinkfn, namenodetouse(linknode, tc->pkg, &tc->pkg->available)->name); if (linknode->flags & (FNNF_DEFERRED_RENAME | FNNF_NEW_CONFF)) @@ -473,7 +473,7 @@ tarobject_hash(struct tarcontext *tc, struct tar_entry *te, } else if (te->type == TAR_FILETYPE_HARDLINK) { struct fsys_namenode *linknode; - linknode = fsys_hash_find_node(te->linkname, 0); + linknode = fsys_hash_find_node(te->linkname, FHFF_NONE); namenode->newhash = linknode->newhash; debug(dbg_eachfiledetail, "tarobject hardlink digest=%s", namenode->newhash); } @@ -689,7 +689,7 @@ tarobject(struct tar_archive *tar, struct tar_entry *ti) if (strchr(ti->name, '\n')) ohshit(_("newline not allowed in archive object name '%.255s'"), ti->name); - namenode = fsys_hash_find_node(ti->name, 0); + namenode = fsys_hash_find_node(ti->name, FHFF_NONE); if (namenode->flags & FNNF_RM_CONFF_ON_UPGRADE) ohshit(_("conffile '%s' marked for removal on upgrade, shipped in package"), diff --git a/src/main/help.c b/src/main/help.c index 615da0eac..59e730e1c 100644 --- a/src/main/help.c +++ b/src/main/help.c @@ -305,7 +305,7 @@ pkg_conffiles_mark_old(struct pkginfo *pkg) for (conff = pkg->installed.conffiles; conff; conff = conff->next) { struct fsys_namenode *namenode; - namenode = fsys_hash_find_node(conff->name, 0); /* XXX */ + namenode = fsys_hash_find_node(conff->name, FHFF_NONE); /* XXX */ namenode->flags |= FNNF_OLD_CONFF; if (!namenode->oldhash) namenode->oldhash = conff->hash; diff --git a/src/main/remove.c b/src/main/remove.c index 52acdeb02..88c01a227 100644 --- a/src/main/remove.c +++ b/src/main/remove.c @@ -546,7 +546,7 @@ static void removal_bulk_remove_configfiles(struct pkginfo *pkg) { if (rc == -1) continue; - namenode = fsys_hash_find_node(conff->name, 0); + namenode = fsys_hash_find_node(conff->name, FHFF_NONE); usenode = namenodetouse(namenode, pkg, &pkg->installed); trig_path_activate(usenode, pkg); diff --git a/src/main/unpack.c b/src/main/unpack.c index 97dd0a0d1..02c2681d7 100644 --- a/src/main/unpack.c +++ b/src/main/unpack.c @@ -395,7 +395,7 @@ deb_parse_conffiles(const struct pkginfo *pkg, const char *control_conffiles, } } - namenode = fsys_hash_find_node(conffilename, 0); + namenode = fsys_hash_find_node(conffilename, FHFF_NONE); namenode->oldhash = NEWCONFFILEFLAG; newconff = tar_fsys_namenode_queue_push(newconffiles, namenode); diff --git a/src/query/main.c b/src/query/main.c index 91b980057..7f8de5901 100644 --- a/src/query/main.c +++ b/src/query/main.c @@ -364,7 +364,7 @@ searchfiles(const char *const *argv) varbuf_set_str(&path, thisarg); varbuf_trunc(&path, path_trim_slash_slashdot(path.buf)); - namenode = fsys_hash_find_node(path.buf, 0); + namenode = fsys_hash_find_node(path.buf, FHFF_NONE); found += searchoutput(namenode); } else { struct fsys_hash_iter *iter; diff --git a/src/statoverride/main.c b/src/statoverride/main.c index 5274a5712..07c875711 100644 --- a/src/statoverride/main.c +++ b/src/statoverride/main.c @@ -149,7 +149,7 @@ statdb_node_find(const char *filename) { struct fsys_namenode *file; - file = fsys_hash_find_node(filename, 0); + file = fsys_hash_find_node(filename, FHFF_NONE); return &file->statoverride; } -- Dpkg.Org's dpkg

