diff options
author | Dan McGee <dan@archlinux.org> | 2007-06-05 23:34:33 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-06-05 23:34:33 +0200 |
commit | f7912e9dc6be71b177d546da0f8d005e7b4af9e8 (patch) | |
tree | 14f9c7be0757de98d2325b3623eac2a45a438a16 /src/pacman/remove.c | |
parent | 4906b76c85bc93c4a86dfa8449d58b55ede30425 (diff) | |
download | pacman-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/remove.c')
-rw-r--r-- | src/pacman/remove.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pacman/remove.c b/src/pacman/remove.c index c76fc69a..9b4adce0 100644 --- a/src/pacman/remove.c +++ b/src/pacman/remove.c @@ -47,7 +47,7 @@ extern pmdb_t *db_local; */ int pacman_remove(alpm_list_t *targets) { - alpm_list_t *i, *j, *data = NULL, *finaltargs = NULL; + alpm_list_t *i, *data = NULL, *finaltargs = NULL; int retval = 0; if(targets == NULL) { @@ -61,14 +61,14 @@ int pacman_remove(alpm_list_t *targets) pmgrp_t *grp = alpm_db_readgrp(db_local, alpm_list_getdata(i)); if(grp) { int all; - alpm_list_t *pkgnames = alpm_grp_get_pkgs(grp); + const alpm_list_t *p, *pkgnames = alpm_grp_get_pkgs(grp); printf(_(":: group %s:\n"), alpm_grp_get_name(grp)); list_display(" ", pkgnames); all = yesno(_(" Remove whole content? [Y/n] ")); - for(j = pkgnames; j; j = alpm_list_next(j)) { - char *pkg = alpm_list_getdata(j); + for(p = pkgnames; p; p = alpm_list_next(p)) { + char *pkg = alpm_list_getdata(p); if(all || yesno(_(":: Remove %s from group %s? [Y/n] "), pkg, (char *)alpm_list_getdata(i))) { finaltargs = alpm_list_add(finaltargs, strdup(pkg)); } |