summaryrefslogtreecommitdiffstats
path: root/src/pacman/util.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-06-05 23:34:33 +0200
committerDan McGee <dan@archlinux.org>2007-06-05 23:34:33 +0200
commitf7912e9dc6be71b177d546da0f8d005e7b4af9e8 (patch)
tree14f9c7be0757de98d2325b3623eac2a45a438a16 /src/pacman/util.c
parent4906b76c85bc93c4a86dfa8449d58b55ede30425 (diff)
downloadpacman-f7912e9dc6be71b177d546da0f8d005e7b4af9e8.tar.gz
pacman-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 'src/pacman/util.c')
-rw-r--r--src/pacman/util.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pacman/util.c b/src/pacman/util.c
index e88001ac..eda32524 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -280,9 +280,9 @@ char *strreplace(const char *str, const char *needle, const char *replace)
return newstr;
}
-void list_display(const char *title, alpm_list_t *list)
+void list_display(const char *title, const alpm_list_t *list)
{
- alpm_list_t *i;
+ const alpm_list_t *i;
int cols, len;
len = strlen(title);
@@ -315,10 +315,10 @@ void list_display(const char *title, alpm_list_t *list)
* retrieved from a transaction object
*/
/* TODO move to output.c? or just combine util and output */
-void display_targets(alpm_list_t *syncpkgs)
+void display_targets(const alpm_list_t *syncpkgs)
{
char *str;
- alpm_list_t *i, *j;
+ const alpm_list_t *i, *j;
alpm_list_t *targets = NULL, *to_remove = NULL;
/* TODO these are some messy variable names */
unsigned long size = 0, isize = 0, rsize = 0, dispsize = 0;