[pacman-dev] [PATCH] Constify some input pointers
Rikard Falkeborn
rikard.falkeborn at gmail.com
Fri Apr 24 21:43:58 UTC 2020
Signed-off-by: Rikard Falkeborn <rikard.falkeborn at gmail.com>
---
lib/libalpm/diskspace.c | 2 +-
lib/libalpm/diskspace.h | 2 +-
lib/libalpm/util.c | 2 +-
src/pacman/util.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/libalpm/diskspace.c b/lib/libalpm/diskspace.c
index 4cc17a12..2be98055 100644
--- a/lib/libalpm/diskspace.c
+++ b/lib/libalpm/diskspace.c
@@ -359,7 +359,7 @@ static int check_mountpoint(alpm_handle_t *handle, alpm_mountpoint_t *mp)
}
int _alpm_check_downloadspace(alpm_handle_t *handle, const char *cachedir,
- size_t num_files, off_t *file_sizes)
+ size_t num_files, const off_t *file_sizes)
{
alpm_list_t *mount_points;
alpm_mountpoint_t *cachedir_mp;
diff --git a/lib/libalpm/diskspace.h b/lib/libalpm/diskspace.h
index 4f7d00b9..5f17a878 100644
--- a/lib/libalpm/diskspace.h
+++ b/lib/libalpm/diskspace.h
@@ -58,6 +58,6 @@ typedef struct __alpm_mountpoint_t {
int _alpm_check_diskspace(alpm_handle_t *handle);
int _alpm_check_downloadspace(alpm_handle_t *handle, const char *cachedir,
- size_t num_files, off_t *file_sizes);
+ size_t num_files, const off_t *file_sizes);
#endif /* ALPM_DISKSPACE_H */
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index cb838e43..ead03004 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -1006,7 +1006,7 @@ static int sha256_file(const char *path, unsigned char output[32])
* @return a NULL terminated string with the hexadecimal representation of
* bytes or NULL on error. This string must be freed.
*/
-static char *hex_representation(unsigned char *bytes, size_t size)
+static char *hex_representation(const unsigned char *bytes, size_t size)
{
static const char *hex_digits = "0123456789abcdef";
char *str;
diff --git a/src/pacman/util.c b/src/pacman/util.c
index 6693ec75..97b8e06d 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -515,7 +515,7 @@ void string_display(const char *title, const char *string, unsigned short cols)
}
static void table_print_line(const alpm_list_t *line, short col_padding,
- size_t colcount, size_t *widths, int *has_data)
+ size_t colcount, const size_t *widths, const int *has_data)
{
size_t i;
int need_padding = 0;
--
2.26.2
More information about the pacman-dev
mailing list