diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-03-17 23:13:04 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-03-17 23:13:04 +0400 |
commit | 09c41019a8ecb259b2376b5c22c99f54b59f8f24 (patch) | |
tree | 64802a773768eaae39b8ec315b582123f16707fa /source/blender/blenloader | |
parent | 16b82845eee4198b2d56aa5a5c373008f5070f7f (diff) |
use const pointers for file loading and booleans for animation system return values passed as pointers.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/BLO_readfile.h | 6 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readblenentry.c | 8 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 6 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.h | 4 |
4 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/blenloader/BLO_readfile.h b/source/blender/blenloader/BLO_readfile.h index 2ee5decdfac..00ff5863e59 100644 --- a/source/blender/blenloader/BLO_readfile.h +++ b/source/blender/blenloader/BLO_readfile.h @@ -96,7 +96,7 @@ BlendFileData *BLO_read_from_file(const char *filepath, struct ReportList *repor * indicating the cause of the failure. * \return The data of the file. */ -BlendFileData *BLO_read_from_memory(void *mem, int memsize, struct ReportList *reports); +BlendFileData *BLO_read_from_memory(const void *mem, int memsize, struct ReportList *reports); /** * oldmain is old main, from which we will keep libraries, images, .. @@ -122,7 +122,7 @@ BLO_blendfiledata_free(BlendFileData *bfd); * \return A handle on success, or NULL on failure. */ BlendHandle * -BLO_blendhandle_from_file(char *file, +BLO_blendhandle_from_file(const char *filepath, struct ReportList *reports); /** @@ -134,7 +134,7 @@ BLO_blendhandle_from_file(char *file, */ BlendHandle * -BLO_blendhandle_from_memory(void *mem, +BLO_blendhandle_from_memory(const void *mem, int memsize); /** diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c index 5111baa06c1..9678dffe5af 100644 --- a/source/blender/blenloader/intern/readblenentry.c +++ b/source/blender/blenloader/intern/readblenentry.c @@ -74,16 +74,16 @@ void BLO_blendhandle_print_sizes(BlendHandle *, void *); /* Access routines used by filesel. */ -BlendHandle *BLO_blendhandle_from_file(char *file, ReportList *reports) +BlendHandle *BLO_blendhandle_from_file(const char *filepath, ReportList *reports) { BlendHandle *bh; - bh = (BlendHandle *)blo_openblenderfile(file, reports); + bh = (BlendHandle *)blo_openblenderfile(filepath, reports); return bh; } -BlendHandle *BLO_blendhandle_from_memory(void *mem, int memsize) +BlendHandle *BLO_blendhandle_from_memory(const void *mem, int memsize) { BlendHandle *bh; @@ -271,7 +271,7 @@ BlendFileData *BLO_read_from_file(const char *filepath, ReportList *reports) return bfd; } -BlendFileData *BLO_read_from_memory(void *mem, int memsize, ReportList *reports) +BlendFileData *BLO_read_from_memory(const void *mem, int memsize, ReportList *reports) { BlendFileData *bfd = NULL; FileData *fd; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 5fe7d692b8f..be2b45a3e12 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1041,7 +1041,7 @@ static int fd_read_gzip_from_memory_init(FileData *fd) return 1; } -FileData *blo_openblendermemory(void *mem, int memsize, ReportList *reports) +FileData *blo_openblendermemory(const void *mem, int memsize, ReportList *reports) { if (!mem || memsize<SIZEOFBLENDERHEADER) { BKE_report(reports, RPT_WARNING, (mem) ? TIP_("Unable to read"): TIP_("Unable to open")); @@ -1049,7 +1049,7 @@ FileData *blo_openblendermemory(void *mem, int memsize, ReportList *reports) } else { FileData *fd = filedata_new(); - char *cp = mem; + const char *cp = mem; fd->buffer = mem; fd->buffersize = memsize; @@ -1106,7 +1106,7 @@ void blo_freefiledata(FileData *fd) } if (fd->buffer && !(fd->flags & FD_FLAGS_NOT_MY_BUFFER)) { - MEM_freeN(fd->buffer); + MEM_freeN((void *)fd->buffer); fd->buffer = NULL; } diff --git a/source/blender/blenloader/intern/readfile.h b/source/blender/blenloader/intern/readfile.h index a0895c92b24..46b95434e53 100644 --- a/source/blender/blenloader/intern/readfile.h +++ b/source/blender/blenloader/intern/readfile.h @@ -54,7 +54,7 @@ typedef struct FileData { int (*read)(struct FileData *filedata, void *buffer, unsigned int size); // variables needed for reading from memory / stream - char *buffer; + const char *buffer; // variables needed for reading from memfile (undo) struct MemFile *memfile; @@ -123,7 +123,7 @@ void blo_split_main(ListBase *mainlist, struct Main *main); BlendFileData *blo_read_file_internal(FileData *fd, const char *filepath); FileData *blo_openblenderfile(const char *filepath, struct ReportList *reports); -FileData *blo_openblendermemory(void *buffer, int buffersize, struct ReportList *reports); +FileData *blo_openblendermemory(const void *buffer, int buffersize, struct ReportList *reports); FileData *blo_openblendermemfile(struct MemFile *memfile, struct ReportList *reports); void blo_clear_proxy_pointers_from_lib(Main *oldmain); |