Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
libpkg: Mark some tables const
Mark Johnston committed 7 months ago
commit aa43be201f008a0a487bd3126e646126422e58da
parent 4f366c4
4 files changed +6 -6
modified libpkg/pkgbase.c
@@ -85,7 +85,7 @@ scan_dir_for_shlibs(charv_t *shlib_list, const char *dir,
	return (EPKG_OK);
}

-
static struct {
+
static const struct {
	const char *dir;
	enum pkg_shlib_flags flags;
} system_shlib_table[] = {
modified libpkg/private/pkg.h
@@ -468,7 +468,7 @@ struct pkg_repo_it_ops {

struct pkg_repo_it {
	struct pkg_repo *repo;
-
	struct pkg_repo_it_ops *ops;
+
	const struct pkg_repo_it_ops *ops;
	int flags;
	void *data;
};
@@ -520,7 +520,7 @@ struct pkg_key {
};

struct pkg_repo {
-
	struct pkg_repo_ops *ops;
+
	const struct pkg_repo_ops *ops;

	char *name;
	struct fetcher *fetcher;
modified libpkg/repo/binary/query.c
@@ -61,13 +61,13 @@ static int pkg_repo_binary_group_it_next(struct pkg_repo_it *it, struct pkg **pk
static void pkg_repo_binary_group_it_free(struct pkg_repo_it *it);
static void pkg_repo_binary_group_it_reset(struct pkg_repo_it *it);

-
static struct pkg_repo_it_ops pkg_repo_binary_it_ops = {
+
static const struct pkg_repo_it_ops pkg_repo_binary_it_ops = {
	.next = pkg_repo_binary_it_next,
	.free = pkg_repo_binary_it_free,
	.reset = pkg_repo_binary_it_reset
};

-
static struct pkg_repo_it_ops pkg_repo_binary_group_it_ops = {
+
static const struct pkg_repo_it_ops pkg_repo_binary_group_it_ops = {
	.next = pkg_repo_binary_group_it_next,
	.free = pkg_repo_binary_group_it_free,
	.reset = pkg_repo_binary_group_it_reset
modified src/query.c
@@ -41,7 +41,7 @@
#include <pkg.h>
#include "pkgcli.h"

-
static struct query_flags accepted_query_flags[] = {
+
static const struct query_flags accepted_query_flags[] = {
	{ 'd', "nov",		1, PKG_LOAD_DEPS },
	{ 'r', "nov",		1, PKG_LOAD_RDEPS },
	{ 'C', "",		1, PKG_LOAD_CATEGORIES },