commit: 9483ff2be5c737182e3863574e12442ca2a982f9
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 28 20:10:49 2025 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu Aug 28 20:10:49 2025 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=9483ff2b
*: fix compiler warnings
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
q.c | 4 ++--
qmerge.c | 21 ++++++++++++---------
qpkg.c | 4 ++--
3 files changed, 16 insertions(+), 13 deletions(-)
diff --git a/q.c b/q.c
index de241be..3aced3e 100644
--- a/q.c
+++ b/q.c
@@ -173,7 +173,7 @@ static int q_build_gtree_pkg_process_dir(struct q_cache_ctx
*ctx,
return 0;
}
-int q_build_gtree_cache_pkg(tree_pkg_ctx *pkg, void *priv)
+static int q_build_gtree_cache_pkg(tree_pkg_ctx *pkg, void *priv)
{
struct q_cache_ctx *ctx = priv;
struct archive *a = ctx->archive;
@@ -283,7 +283,7 @@ int q_build_gtree_cache_pkg(tree_pkg_ctx *pkg, void *priv)
return 0;
}
-int q_build_gtree_ebuilds_pkg(tree_pkg_ctx *pkg, void *priv)
+static int q_build_gtree_ebuilds_pkg(tree_pkg_ctx *pkg, void *priv)
{
struct q_cache_ctx *ctx = priv;
struct archive *a = ctx->archive;
diff --git a/qmerge.c b/qmerge.c
index 9f1aa0d..fcdf45c 100644
--- a/qmerge.c
+++ b/qmerge.c
@@ -19,7 +19,7 @@
#include <sys/wait.h>
#include <assert.h>
-#ifdef HAVE_LIBARCHIVE
+#ifdef ENABLE_GPKG
# include <archive.h>
# include <archive_entry.h>
#endif
@@ -482,8 +482,8 @@ install_mask_check_dir(
int subfd = openat(fd, files[j]->d_name, O_RDONLY);
if (subfd < 0)
continue;
- snprintf(npth, _Q_PATH_MAX - (npth - qpth),
- "/%s", files[j]->d_name);
+ snprintf(npth, _Q_PATH_MAX - (npth - qpth), "/%.*s",
+ (int)(_Q_PATH_MAX - (npth - qpth)),
files[j]->d_name);
install_mask_check_dir(maskv, maskc, st, subfd,
level + 1, child_mode, qpth);
close(subfd);
@@ -1251,7 +1251,6 @@ pkg_merge(int level, const depend_atom *qatom, const
tree_match_ctx *mpkg)
err("failed to open %s: %s", mpkg->path,
archive_error_string(a));
while (archive_read_next_header(a, &entry) == ARCHIVE_OK) {
const char *fname = archive_entry_pathname(entry);
- const void *p;
size_t size;
la_int64_t off;
@@ -1272,7 +1271,9 @@ pkg_merge(int level, const depend_atom *qatom, const
tree_match_ctx *mpkg)
if (archive_write_header(t, entry) != ARCHIVE_OK)
err("failed to write: %s",
archive_error_string(t));
- while (archive_read_data_block(a, &p, &size, &off) ==
ARCHIVE_OK) {
+ while (archive_read_data_block(a, (const void **)&p,
+
&size, &off) == ARCHIVE_OK)
+ {
if (archive_write_data_block(t, p, size, off)
!= ARCHIVE_OK)
err("failed to write %s: %s\n",
fname, archive_error_string(t));
@@ -1302,7 +1303,6 @@ pkg_merge(int level, const depend_atom *qatom, const
tree_match_ctx *mpkg)
err("failed to open metadata: %s",
archive_error_string(a));
while (archive_read_next_header(a, &entry) == ARCHIVE_OK) {
const char *fname = archive_entry_pathname(entry);
- const void *p;
size_t size;
la_int64_t off;
@@ -1316,7 +1316,9 @@ pkg_merge(int level, const depend_atom *qatom, const
tree_match_ctx *mpkg)
if (archive_write_header(t, entry) != ARCHIVE_OK)
err("failed to write: %s",
archive_error_string(t));
- while (archive_read_data_block(a, &p, &size, &off) ==
ARCHIVE_OK) {
+ while (archive_read_data_block(a, (const void **)&p,
+
&size, &off) == ARCHIVE_OK)
+ {
if (archive_write_data_block(t, p, size, off)
!= ARCHIVE_OK)
err("failed to write %s: %s\n",
fname, archive_error_string(t));
@@ -1345,7 +1347,6 @@ pkg_merge(int level, const depend_atom *qatom, const
tree_match_ctx *mpkg)
err("failed to open metadata: %s",
archive_error_string(a));
while (archive_read_next_header(a, &entry) == ARCHIVE_OK) {
const char *fname = archive_entry_pathname(entry);
- const void *p;
size_t size;
la_int64_t off;
@@ -1359,7 +1360,9 @@ pkg_merge(int level, const depend_atom *qatom, const
tree_match_ctx *mpkg)
if (archive_write_header(t, entry) != ARCHIVE_OK)
err("failed to write: %s",
archive_error_string(t));
- while (archive_read_data_block(a, &p, &size, &off) ==
ARCHIVE_OK) {
+ while (archive_read_data_block(a, (const void **)&p,
+
&size, &off) == ARCHIVE_OK)
+ {
if (archive_write_data_block(t, p, size, off)
!= ARCHIVE_OK)
err("failed to write %s: %s\n",
fname, archive_error_string(t));
diff --git a/qpkg.c b/qpkg.c
index aa15a2b..291fdc7 100644
--- a/qpkg.c
+++ b/qpkg.c
@@ -213,7 +213,7 @@ write_hashes
write(fd, data, len);
}
-static char *
+static const char *
qgpkg_set_compression(struct archive *a)
{
/* we compress the metadata and image using zstd as the compression
@@ -247,7 +247,7 @@ qgpkg_make(tree_pkg_ctx *pkg)
char gpkg[BUFSIZE + 32];
char buf[BUFSIZE * 4];
char ename[BUFSIZE];
- char *filter;
+ const char *filter;
char *line;
char *savep;
int i;