From f7912e9dc6be71b177d546da0f8d005e7b4af9e8 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 5 Jun 2007 17:34:33 -0400 Subject: Const correctness! Add some 'const' keywords all over the code to make it a bit more strict on what you can and can't do with data. This is especially important when we return pointers to the pacman frontend- ideally this would always be untouchable data. Signed-off-by: Dan McGee --- lib/libalpm/package.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/libalpm/package.c') diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index 7f20b9e0..e25ecbe4 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -61,7 +61,7 @@ * @param pkg address of the package pointer * @return 0 on success, -1 on error (pm_errno is set accordingly) */ -int SYMEXPORT alpm_pkg_load(char *filename, pmpkg_t **pkg) +int SYMEXPORT alpm_pkg_load(const char *filename, pmpkg_t **pkg) { _alpm_log(PM_LOG_FUNCTION, "enter alpm_pkg_load"); @@ -210,7 +210,7 @@ static char *_supported_archs[] = { * * @return pointer to start of -ARCH text if it exists, else NULL */ -char SYMEXPORT *alpm_pkg_name_hasarch(char *pkgname) +char SYMEXPORT *alpm_pkg_name_hasarch(const char *pkgname) { /* TODO remove this when we transfer everything over to -ARCH * @@ -732,7 +732,7 @@ int _alpm_pkg_splitname(const char *target, char *name, char *version, int witha * used when we want to install or add a package */ void _alpm_pkg_update_requiredby(pmpkg_t *pkg) { - alpm_list_t *i, *j; + const alpm_list_t *i, *j; pmdb_t *localdb = alpm_option_get_localdb(); for(i = _alpm_db_get_pkgcache(localdb); i; i = i->next) { -- cgit v1.2.3-54-g00ecf