diff --git a/bin/xbps-checkvers/main.c b/bin/xbps-checkvers/main.c index b19326b3..f57da958 100644 --- a/bin/xbps-checkvers/main.c +++ b/bin/xbps-checkvers/main.c @@ -537,7 +537,8 @@ static int rcv_check_version(rcv_t *rcv) { const char *repover = NULL; - char srcver[BUFSIZ] = { '\0' }, *binpkgname = NULL, *s = NULL; + char srcver[BUFSIZ] = { '\0' }, *binpkgname = NULL; + const char *s = NULL; const char *pkgname, *version, *revision, *reverts, *repourl; int sz; size_t len; @@ -661,7 +662,7 @@ template_removed_cb(struct xbps_handle *xhp UNUSED, bool *done UNUSED) { char *pkgname; - char *last_dash; + const char *last_dash; bool dummy_bool = false; rcv_t *rcv = arg; diff --git a/bin/xbps-create/main.c b/bin/xbps-create/main.c index 9a1ca824..215f8c0a 100644 --- a/bin/xbps-create/main.c +++ b/bin/xbps-create/main.c @@ -235,7 +235,7 @@ process_one_alternative(const char *altgrname, const char *val) { xbps_dictionary_t d; xbps_array_t a; - char *altfiles; + const char *altfiles; bool alloc = false; if ((d = xbps_dictionary_get(pkg_propsd, "alternatives")) == NULL) { diff --git a/bin/xbps-uchroot/main.c b/bin/xbps-uchroot/main.c index 0afc88db..9d8856b6 100644 --- a/bin/xbps-uchroot/main.c +++ b/bin/xbps-uchroot/main.c @@ -212,7 +212,8 @@ static void add_bindmount(const char *bm, bool ro) { struct bindmnt *bmnt; - char *b, *src, *dest; + char *src; + const char *b, *dest; size_t len; src = strdup(bm); diff --git a/lib/conf.c b/lib/conf.c index 2826f14e..f0c35a8c 100644 --- a/lib/conf.c +++ b/lib/conf.c @@ -249,7 +249,8 @@ parse_option(char *line, size_t linelen, char **valp, size_t *vallen) { size_t len; char *p; - struct key needle, *result; + struct key needle; + const struct key *result; p = strpbrk(line, " \t="); if (p == NULL) diff --git a/lib/fetch/http.c b/lib/fetch/http.c index b23e919c..0e1700fc 100644 --- a/lib/fetch/http.c +++ b/lib/fetch/http.c @@ -1339,7 +1339,7 @@ struct index_parser { static ssize_t parse_index(struct index_parser *parser, const char *buf, size_t len) { - char *end_attr, p = *buf; + const char *end_attr, p = *buf; switch (parser->state) { case ST_NONE: @@ -1463,7 +1463,7 @@ parse_index(struct index_parser *parser, const char *buf, size_t len) end_attr = memchr(buf, '"', len); if (end_attr == NULL) return 0; - *end_attr = '\0'; + *(char *)(uintptr_t)end_attr = '\0'; parser->state = ST_TAGA; if (fetch_add_entry(parser->ue, parser->url, buf, 1)) return -1; diff --git a/lib/package_unpack.c b/lib/package_unpack.c index 05774bf2..098013a4 100644 --- a/lib/package_unpack.c +++ b/lib/package_unpack.c @@ -95,7 +95,7 @@ unpack_archive(struct xbps_handle *xhp, struct archive_entry *entry; ssize_t entry_size; const char *entry_pname, *pkgname; - char *buf = NULL; + const char *buf = NULL; int ar_rv, rv, error, entry_type, flags; bool preserve, update, file_exists, keep_conf_file; bool skip_extract, force, xucd_stats; @@ -454,14 +454,14 @@ unpack_archive(struct xbps_handle *xhp, if (!xbps_dictionary_externalize_to_file(binpkg_filesd, buf)) { rv = errno; umask(prev_umask); - free(buf); + free((void *)(uintptr_t)buf); xbps_set_cb_state(xhp, XBPS_STATE_UNPACK_FAIL, rv, pkgver, "%s: [unpack] failed to externalize pkg " "pkg metadata files: %s", pkgver, strerror(rv)); goto out; } umask(prev_umask); - free(buf); + free((void *)(uintptr_t)buf); } out: /* @@ -470,7 +470,7 @@ unpack_archive(struct xbps_handle *xhp, if (!xbps_dictionary_count(binpkg_filesd)) { buf = xbps_xasprintf("%s/.%s-files.plist", xhp->metadir, pkgname); unlink(buf); - free(buf); + free((void *)(uintptr_t)buf); } xbps_object_release(binpkg_filesd);