Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/group.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm/group.c')
-rw-r--r--lib/libalpm/group.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/lib/libalpm/group.c b/lib/libalpm/group.c
index cce05213..4ad39d6d 100644
--- a/lib/libalpm/group.c
+++ b/lib/libalpm/group.c
@@ -24,7 +24,6 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include <libintl.h>
/* libalpm */
#include "group.h"
@@ -40,20 +39,13 @@ pmgrp_t *_alpm_grp_new()
ALPM_LOG_FUNC;
- grp = calloc(1, sizeof(pmgrp_t));
- if(grp == NULL) {
- _alpm_log(PM_LOG_ERROR, _("malloc failure: could not allocate %d bytes"),
- sizeof(pmgrp_t));
- RET_ERR(PM_ERR_MEMORY, NULL);
- }
+ CALLOC(grp, 1, sizeof(pmgrp_t), RET_ERR(PM_ERR_MEMORY, NULL));
return(grp);
}
-void _alpm_grp_free(void *data)
+void _alpm_grp_free(pmgrp_t *grp)
{
- pmgrp_t *grp = data;
-
ALPM_LOG_FUNC;
if(grp == NULL) {
@@ -62,8 +54,6 @@ void _alpm_grp_free(void *data)
FREELIST(grp->packages);
FREE(grp);
-
- return;
}
/* Helper function for sorting groups
@@ -76,7 +66,7 @@ int _alpm_grp_cmp(const void *g1, const void *g2)
return(strcmp(grp1->name, grp2->name));
}
-const char SYMEXPORT *alpm_grp_get_name(pmgrp_t *grp)
+const char SYMEXPORT *alpm_grp_get_name(const pmgrp_t *grp)
{
ALPM_LOG_FUNC;
@@ -86,7 +76,7 @@ const char SYMEXPORT *alpm_grp_get_name(pmgrp_t *grp)
return grp->name;
}
-alpm_list_t SYMEXPORT *alpm_grp_get_pkgs(pmgrp_t *grp)
+const alpm_list_t SYMEXPORT *alpm_grp_get_pkgs(const pmgrp_t *grp)
{
ALPM_LOG_FUNC;