diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-11-11 10:51:12 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-11-11 10:51:12 +0300 |
commit | 030253cdf665648eb5a16f3be910ceae26979f30 (patch) | |
tree | 1c6f2732bd77840c6056c11d788bf786bdf39299 /source/blender/blenlib/intern/bpath.c | |
parent | 80a650dfb1e73363ae6924dc5738b732bb89ded4 (diff) |
fix for building, also use const char in more places.
Diffstat (limited to 'source/blender/blenlib/intern/bpath.c')
-rw-r--r-- | source/blender/blenlib/intern/bpath.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c index 8711857f83a..06932f24bcb 100644 --- a/source/blender/blenlib/intern/bpath.c +++ b/source/blender/blenlib/intern/bpath.c @@ -79,7 +79,7 @@ enum BPathTypes { BPATH_DONE }; -void BLI_bpathIterator_init( struct BPathIterator *bpi, char *base_path ) { +void BLI_bpathIterator_init( struct BPathIterator *bpi, const char *base_path ) { bpi->type = BPATH_IMAGE; bpi->data = NULL; @@ -112,7 +112,7 @@ void BLI_bpathIterator_getPath( struct BPathIterator *bpi, char *path) { } } -void BLI_bpathIterator_setPath( struct BPathIterator *bpi, char *path) { +void BLI_bpathIterator_setPath( struct BPathIterator *bpi, const char *path) { if (bpi->setpath_callback) { bpi->setpath_callback( bpi, path ); } else { @@ -121,7 +121,7 @@ void BLI_bpathIterator_setPath( struct BPathIterator *bpi, char *path) { } void BLI_bpathIterator_getPathExpanded( struct BPathIterator *bpi, char *path_expanded) { - char *libpath; + const char *libpath; BLI_bpathIterator_getPath(bpi, path_expanded); libpath = BLI_bpathIterator_getLib(bpi); @@ -133,10 +133,10 @@ void BLI_bpathIterator_getPathExpanded( struct BPathIterator *bpi, char *path_ex } BLI_cleanup_file(NULL, path_expanded); } -char* BLI_bpathIterator_getLib( struct BPathIterator *bpi) { +const char* BLI_bpathIterator_getLib( struct BPathIterator *bpi) { return bpi->lib; } -char* BLI_bpathIterator_getName( struct BPathIterator *bpi) { +const char* BLI_bpathIterator_getName( struct BPathIterator *bpi) { return bpi->name; } int BLI_bpathIterator_getType( struct BPathIterator *bpi) { @@ -275,7 +275,7 @@ static void seq_getpath(struct BPathIterator *bpi, char *path) { } } -static void seq_setpath(struct BPathIterator *bpi, char *path) { +static void seq_setpath(struct BPathIterator *bpi, const char *path) { Sequence *seq = (Sequence *)bpi->data; if (seq==NULL) return; @@ -443,7 +443,7 @@ int BLI_bpathIterator_isDone( struct BPathIterator *bpi) { static void bpath_as_report(struct BPathIterator *bpi, const char *message, ReportList *reports) { char *prefix; - char *name; + const char *name; char path_expanded[FILE_MAXDIR*2]; if(reports==NULL) @@ -484,7 +484,7 @@ static void bpath_as_report(struct BPathIterator *bpi, const char *message, Repo } /* high level function */ -void checkMissingFiles(char *basepath, ReportList *reports) { +void checkMissingFiles(const char *basepath, ReportList *reports) { struct BPathIterator bpi; /* be sure there is low chance of the path being too short */ @@ -503,10 +503,11 @@ void checkMissingFiles(char *basepath, ReportList *reports) { } /* dont log any errors at the moment, should probably do this */ -void makeFilesRelative(char *basepath, ReportList *reports) { +void makeFilesRelative(const char *basepath, ReportList *reports) { int tot= 0, changed= 0, failed= 0, linked= 0; struct BPathIterator bpi; - char filepath[FILE_MAX], *libpath; + char filepath[FILE_MAX]; + const char *libpath; /* be sure there is low chance of the path being too short */ char filepath_relative[(FILE_MAXDIR * 2) + FILE_MAXFILE]; @@ -551,12 +552,13 @@ void makeFilesRelative(char *basepath, ReportList *reports) { /* dont log any errors at the moment, should probably do this - * Verry similar to makeFilesRelative - keep in sync! */ -void makeFilesAbsolute(char *basepath, ReportList *reports) +void makeFilesAbsolute(const char *basepath, ReportList *reports) { int tot= 0, changed= 0, failed= 0, linked= 0; struct BPathIterator bpi; - char filepath[FILE_MAX], *libpath; + char filepath[FILE_MAX]; + const char *libpath; /* be sure there is low chance of the path being too short */ char filepath_absolute[(FILE_MAXDIR * 2) + FILE_MAXFILE]; @@ -652,12 +654,13 @@ static int findFileRecursive(char *filename_new, const char *dirname, const char } /* high level function - call from fileselector */ -void findMissingFiles(char *basepath, char *str) { +void findMissingFiles(const char *basepath, const char *str) { struct BPathIterator bpi; /* be sure there is low chance of the path being too short */ char filepath_expanded[FILE_MAXDIR*2]; - char filepath[FILE_MAX], *libpath; + char filepath[FILE_MAX]; + const char *libpath; int filesize, recur_depth; char dirname[FILE_MAX], filename_new[FILE_MAX]; |