libalpm: const annotate struct pkg_operations
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
f8614d8c5b
commit
1d2dd9a128
5 changed files with 6 additions and 6 deletions
|
@ -326,7 +326,7 @@ static int _cache_force_load(alpm_pkg_t *pkg)
|
||||||
* lazy accessor methods that handle any backend loading and caching
|
* lazy accessor methods that handle any backend loading and caching
|
||||||
* logic.
|
* logic.
|
||||||
*/
|
*/
|
||||||
static struct pkg_operations local_pkg_ops = {
|
static const struct pkg_operations local_pkg_ops = {
|
||||||
.get_base = _cache_get_base,
|
.get_base = _cache_get_base,
|
||||||
.get_desc = _cache_get_desc,
|
.get_desc = _cache_get_desc,
|
||||||
.get_url = _cache_get_url,
|
.get_url = _cache_get_url,
|
||||||
|
|
|
@ -137,7 +137,7 @@ static int _package_changelog_close(const alpm_pkg_t UNUSED *pkg, void *fp)
|
||||||
* because we want to reuse the majority of the default_pkg_ops struct and
|
* because we want to reuse the majority of the default_pkg_ops struct and
|
||||||
* add only a few operations of our own on top.
|
* add only a few operations of our own on top.
|
||||||
*/
|
*/
|
||||||
static struct pkg_operations *get_file_pkg_ops(void)
|
static const struct pkg_operations *get_file_pkg_ops(void)
|
||||||
{
|
{
|
||||||
static struct pkg_operations file_pkg_ops;
|
static struct pkg_operations file_pkg_ops;
|
||||||
static int file_pkg_ops_initialized = 0;
|
static int file_pkg_ops_initialized = 0;
|
||||||
|
|
|
@ -285,7 +285,7 @@ static int _sync_get_validation(alpm_pkg_t *pkg)
|
||||||
* because we want to reuse the majority of the default_pkg_ops struct and
|
* because we want to reuse the majority of the default_pkg_ops struct and
|
||||||
* add only a few operations of our own on top.
|
* add only a few operations of our own on top.
|
||||||
*/
|
*/
|
||||||
static struct pkg_operations *get_sync_pkg_ops(void)
|
static const struct pkg_operations *get_sync_pkg_ops(void)
|
||||||
{
|
{
|
||||||
static struct pkg_operations sync_pkg_ops;
|
static struct pkg_operations sync_pkg_ops;
|
||||||
static int sync_pkg_ops_initalized = 0;
|
static int sync_pkg_ops_initalized = 0;
|
||||||
|
|
|
@ -138,7 +138,7 @@ static int _pkg_force_load(alpm_pkg_t UNUSED *pkg) { return 0; }
|
||||||
/** The standard package operations struct. Get fields directly from the
|
/** The standard package operations struct. Get fields directly from the
|
||||||
* struct itself with no abstraction layer or any type of lazy loading.
|
* struct itself with no abstraction layer or any type of lazy loading.
|
||||||
*/
|
*/
|
||||||
struct pkg_operations default_pkg_ops = {
|
const struct pkg_operations default_pkg_ops = {
|
||||||
.get_base = _pkg_get_base,
|
.get_base = _pkg_get_base,
|
||||||
.get_desc = _pkg_get_desc,
|
.get_desc = _pkg_get_desc,
|
||||||
.get_url = _pkg_get_url,
|
.get_url = _pkg_get_url,
|
||||||
|
|
|
@ -83,7 +83,7 @@ struct pkg_operations {
|
||||||
* The actual definition is in package.c so it can have access to the
|
* The actual definition is in package.c so it can have access to the
|
||||||
* default accessor functions which are defined there.
|
* default accessor functions which are defined there.
|
||||||
*/
|
*/
|
||||||
extern struct pkg_operations default_pkg_ops;
|
extern const struct pkg_operations default_pkg_ops;
|
||||||
|
|
||||||
struct __alpm_pkg_t {
|
struct __alpm_pkg_t {
|
||||||
unsigned long name_hash;
|
unsigned long name_hash;
|
||||||
|
@ -121,7 +121,7 @@ struct __alpm_pkg_t {
|
||||||
alpm_list_t *removes; /* in transaction targets only */
|
alpm_list_t *removes; /* in transaction targets only */
|
||||||
alpm_pkg_t *oldpkg; /* in transaction targets only */
|
alpm_pkg_t *oldpkg; /* in transaction targets only */
|
||||||
|
|
||||||
struct pkg_operations *ops;
|
const struct pkg_operations *ops;
|
||||||
|
|
||||||
alpm_filelist_t files;
|
alpm_filelist_t files;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue