summaryrefslogtreecommitdiff
path: root/lib/libalpm/sync.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-06-05 17:34:33 -0400
committerDan McGee <dan@archlinux.org>2007-06-05 17:34:33 -0400
commitf7912e9dc6be71b177d546da0f8d005e7b4af9e8 (patch)
tree14f9c7be0757de98d2325b3623eac2a45a438a16 /lib/libalpm/sync.c
parent4906b76c85bc93c4a86dfa8449d58b55ede30425 (diff)
downloadpacman-f7912e9dc6be71b177d546da0f8d005e7b4af9e8.tar.xz
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 <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/sync.c')
-rw-r--r--lib/libalpm/sync.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 2178d1bd..632e510b 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -367,8 +367,8 @@ int _alpm_sync_addtarget(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sy
*/
static int syncpkg_cmp(const void *s1, const void *s2)
{
- pmsyncpkg_t *sp1 = (pmsyncpkg_t *)s1;
- pmsyncpkg_t *sp2 = (pmsyncpkg_t *)s2;
+ const pmsyncpkg_t *sp1 = s1;
+ const pmsyncpkg_t *sp2 = s2;
pmpkg_t *p1, *p2;
p1 = alpm_sync_get_pkg(sp1);
@@ -1085,7 +1085,7 @@ pmsyncpkg_t *_alpm_sync_find(alpm_list_t *syncpkgs, const char* pkgname)
return(NULL); /* not found */
}
-pmsynctype_t SYMEXPORT alpm_sync_get_type(pmsyncpkg_t *sync)
+pmsynctype_t SYMEXPORT alpm_sync_get_type(const pmsyncpkg_t *sync)
{
/* Sanity checks */
ASSERT(sync != NULL, return(-1));
@@ -1093,7 +1093,7 @@ pmsynctype_t SYMEXPORT alpm_sync_get_type(pmsyncpkg_t *sync)
return sync->type;
}
-pmpkg_t SYMEXPORT *alpm_sync_get_pkg(pmsyncpkg_t *sync)
+pmpkg_t SYMEXPORT *alpm_sync_get_pkg(const pmsyncpkg_t *sync)
{
/* Sanity checks */
ASSERT(sync != NULL, return(NULL));
@@ -1101,7 +1101,7 @@ pmpkg_t SYMEXPORT *alpm_sync_get_pkg(pmsyncpkg_t *sync)
return sync->pkg;
}
-void SYMEXPORT *alpm_sync_get_data(pmsyncpkg_t *sync)
+void SYMEXPORT *alpm_sync_get_data(const pmsyncpkg_t *sync)
{
/* Sanity checks */
ASSERT(sync != NULL, return(NULL));