From 8017c61604996d3adcab25cc544427945c903373 Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Mon, 3 Sep 2007 07:40:40 +0000 Subject: [PATCH] fixed const-ness of matchlist functions made the initial file-list a 'char const **' to ease initialization from string constants git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2607 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- lib_internal/matchlist-appendfiles.c | 4 ++-- lib_internal/matchlist-initmanually.c | 10 +++++----- lib_internal/matchlist.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib_internal/matchlist-appendfiles.c b/lib_internal/matchlist-appendfiles.c index 73af1a0..bf05ad7 100644 --- a/lib_internal/matchlist-appendfiles.c +++ b/lib_internal/matchlist-appendfiles.c @@ -38,7 +38,7 @@ determineCompareFunc(char const UNUSED *fname) void MatchList_appendFiles(struct MatchList *list, size_t idx, - char **files, size_t count, + char const **files, size_t count, bool auto_type) { struct MatchItem *ptr = list->data + idx; @@ -48,7 +48,7 @@ MatchList_appendFiles(struct MatchList *list, size_t idx, if (auto_type) { for (i=0; itype = stINCLUDE; ++file; break; case '~' : ptr->type = stSKIP; ++file; break; diff --git a/lib_internal/matchlist-initmanually.c b/lib_internal/matchlist-initmanually.c index 8fffe73..4be43fd 100644 --- a/lib_internal/matchlist-initmanually.c +++ b/lib_internal/matchlist-initmanually.c @@ -42,7 +42,7 @@ extern bool Global_doRenew() PURE CONST; static void readExcludeListFD(int fd, - char ***files, size_t *size, + char const ***files, size_t *size, char **buf) { off_t len; @@ -90,7 +90,7 @@ readExcludeListFD(int fd, static void readExcludeList(char const *filename, - char ***files, size_t *size, + char const ***files, size_t *size, char **buf) { int fd = open(filename, O_RDONLY); @@ -102,7 +102,7 @@ readExcludeList(char const *filename, static void getConfigfileList(char const *vserver, - char ***files, size_t *size, + char const ***files, size_t *size, char **buf) { char tmpname[] = "/tmp/vunify.XXXXXX"; @@ -152,10 +152,10 @@ MatchList_initManually(struct MatchList *list, { char *buf[2] = { 0,0 }; - char **fixed_files = 0; + char const **fixed_files = 0; size_t fixed_count = 0; - char **expr_files = 0; + char const **expr_files = 0; size_t expr_count = 0; size_t len; diff --git a/lib_internal/matchlist.h b/lib_internal/matchlist.h index 49a60ff..35a7620 100644 --- a/lib_internal/matchlist.h +++ b/lib_internal/matchlist.h @@ -73,7 +73,7 @@ void MatchList_initRefserverList(struct MatchList **, size_t *cnt, char const *dir) NONNULL((1,2,3)); void MatchList_destroy(struct MatchList *) NONNULL((1)); void MatchList_appendFiles(struct MatchList *, size_t idx, - char **files, size_t count, + char const **files, size_t count, bool auto_type) NONNULL((1,3)); MatchType MatchList_compare(struct MatchList const *, -- 1.8.1.5