[pacman-dev] [PATCH v2 3/3] libalpm: const annotate struct db_operations

Emil Velikov emil.l.velikov at gmail.com
Tue Jan 5 00:36:10 UTC 2021


Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 lib/libalpm/be_local.c | 2 +-
 lib/libalpm/db.h       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c
index 9c3c8bb3..1d7748d5 100644
--- a/lib/libalpm/be_local.c
+++ b/lib/libalpm/be_local.c
@@ -1158,7 +1158,7 @@ int SYMEXPORT alpm_pkg_set_reason(alpm_pkg_t *pkg, alpm_pkgreason_t reason)
 	return 0;
 }
 
-struct db_operations local_db_ops = {
+static const struct db_operations local_db_ops = {
 	.validate         = local_db_validate,
 	.populate         = local_db_populate,
 	.unregister       = _alpm_db_unregister,
diff --git a/lib/libalpm/db.h b/lib/libalpm/db.h
index c642e077..bc0f8bfc 100644
--- a/lib/libalpm/db.h
+++ b/lib/libalpm/db.h
@@ -70,7 +70,7 @@ struct __alpm_db_t {
 	alpm_pkghash_t *pkgcache;
 	alpm_list_t *grpcache;
 	alpm_list_t *servers;
-	struct db_operations *ops;
+	const struct db_operations *ops;
 
 	/* bitfields for validity, local, loaded caches, etc. */
 	/* From _alpm_dbstatus_t */
-- 
2.30.0


More information about the pacman-dev mailing list