Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-11-19 05:14:18 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-11-19 05:14:18 +0300
commit5a093689570d27df5ecd7394284a670fc32234b5 (patch)
tree6f819caecb1f62583033c579305a8f12174ea049 /source
parent0b74aab939c24a6999a67cbe58584957b69d6f49 (diff)
use 'const char *' for imbuf and file ops.
Diffstat (limited to 'source')
-rw-r--r--source/blender/avi/AVI_avi.h4
-rw-r--r--source/blender/avi/intern/avi.c4
-rw-r--r--source/blender/blenkernel/BKE_idprop.h4
-rw-r--r--source/blender/blenkernel/BKE_packedFile.h4
-rw-r--r--source/blender/blenkernel/BKE_sound.h2
-rw-r--r--source/blender/blenkernel/intern/idprop.c4
-rw-r--r--source/blender/blenkernel/intern/packedFile.c4
-rw-r--r--source/blender/blenkernel/intern/sound.c2
-rw-r--r--source/blender/blenlib/BLI_fileops.h16
-rw-r--r--source/blender/blenlib/intern/fileops.c28
-rw-r--r--source/blender/editors/curve/editfont.c2
-rw-r--r--source/blender/editors/include/UI_interface_icons.h2
-rw-r--r--source/blender/editors/interface/interface_icons.c2
-rw-r--r--source/blender/imbuf/IMB_imbuf.h8
-rw-r--r--source/blender/imbuf/intern/IMB_filetype.h24
-rw-r--r--source/blender/imbuf/intern/anim_movie.c2
-rw-r--r--source/blender/imbuf/intern/bmp.c2
-rw-r--r--source/blender/imbuf/intern/cineon/cineon_dpx.c6
-rw-r--r--source/blender/imbuf/intern/dds/dds_api.cpp2
-rw-r--r--source/blender/imbuf/intern/dds/dds_api.h2
-rw-r--r--source/blender/imbuf/intern/iris.c4
-rw-r--r--source/blender/imbuf/intern/jp2.c2
-rw-r--r--source/blender/imbuf/intern/jpeg.c10
-rw-r--r--source/blender/imbuf/intern/openexr/openexr_api.cpp6
-rw-r--r--source/blender/imbuf/intern/openexr/openexr_api.h2
-rw-r--r--source/blender/imbuf/intern/png.c2
-rw-r--r--source/blender/imbuf/intern/radiance_hdr.c2
-rw-r--r--source/blender/imbuf/intern/targa.c2
-rw-r--r--source/blender/imbuf/intern/tiff.c2
-rw-r--r--source/blender/imbuf/intern/util.c14
-rw-r--r--source/blender/imbuf/intern/writeimage.c2
-rw-r--r--source/blender/python/generic/IDProp.c6
-rw-r--r--source/blender/python/generic/IDProp.h2
-rw-r--r--source/blender/quicktime/apple/qtkit_import.m2
-rw-r--r--source/blender/quicktime/apple/quicktime_import.c2
-rw-r--r--source/blender/quicktime/quicktime_import.h2
36 files changed, 93 insertions, 93 deletions
diff --git a/source/blender/avi/AVI_avi.h b/source/blender/avi/AVI_avi.h
index 2e71bd98309..90fa7705598 100644
--- a/source/blender/avi/AVI_avi.h
+++ b/source/blender/avi/AVI_avi.h
@@ -232,7 +232,7 @@ typedef enum {
/**
* Test whether this is an avi-format.
*/
-int AVI_is_avi (char *name);
+int AVI_is_avi (const char *name);
/**
@@ -277,7 +277,7 @@ int AVI_get_stream (AviMovie *movie, int avist_type, int stream_num);
/**
* Open a movie stream from file.
*/
-AviError AVI_open_movie (char *name, AviMovie *movie);
+AviError AVI_open_movie (const char *name, AviMovie *movie);
/**
* Read a frame from a movie stream.
diff --git a/source/blender/avi/intern/avi.c b/source/blender/avi/intern/avi.c
index 53be1b4467a..d4b39b176d8 100644
--- a/source/blender/avi/intern/avi.c
+++ b/source/blender/avi/intern/avi.c
@@ -211,7 +211,7 @@ int AVI_is_avi (char *name) {
}
*/
-int AVI_is_avi (char *name) {
+int AVI_is_avi (const char *name) {
int temp, fcca, j;
AviMovie movie;
AviMainHeader header;
@@ -404,7 +404,7 @@ int AVI_is_avi (char *name) {
}
-AviError AVI_open_movie (char *name, AviMovie *movie) {
+AviError AVI_open_movie (const char *name, AviMovie *movie) {
int temp, fcca, size, j;
DEBUG_PRINT("opening movie\n");
diff --git a/source/blender/blenkernel/BKE_idprop.h b/source/blender/blenkernel/BKE_idprop.h
index eb33479cdb4..701cffc7743 100644
--- a/source/blender/blenkernel/BKE_idprop.h
+++ b/source/blender/blenkernel/BKE_idprop.h
@@ -72,8 +72,8 @@ void IDP_UnlinkArray(struct IDProperty *prop);
/* ---------- String Type ------------ */
IDProperty *IDP_NewString(const char *st, const char *name, int maxlen);/* maxlen excludes '\0' */
-void IDP_AssignString(struct IDProperty *prop, char *st, int maxlen); /* maxlen excludes '\0' */
-void IDP_ConcatStringC(struct IDProperty *prop, char *st);
+void IDP_AssignString(struct IDProperty *prop, const char *st, int maxlen); /* maxlen excludes '\0' */
+void IDP_ConcatStringC(struct IDProperty *prop, const char *st);
void IDP_ConcatString(struct IDProperty *str1, struct IDProperty *append);
void IDP_FreeString(struct IDProperty *prop);
diff --git a/source/blender/blenkernel/BKE_packedFile.h b/source/blender/blenkernel/BKE_packedFile.h
index 269bb0903ef..c3ab392fd85 100644
--- a/source/blender/blenkernel/BKE_packedFile.h
+++ b/source/blender/blenkernel/BKE_packedFile.h
@@ -54,14 +54,14 @@ int unpackSound(struct Main *bmain, struct ReportList *reports, struct bSound *s
int unpackImage(struct ReportList *reports, struct Image *ima, int how);
void unpackAll(struct Main *bmain, struct ReportList *reports, int how);
-int writePackedFile(struct ReportList *reports, char *filename, struct PackedFile *pf, int guimode);
+int writePackedFile(struct ReportList *reports, const char *filename, struct PackedFile *pf, int guimode);
/* free */
void freePackedFile(struct PackedFile *pf);
/* info */
int countPackedFiles(struct Main *bmain);
-int checkPackedFile(char *filename, struct PackedFile *pf);
+int checkPackedFile(const char *filename, struct PackedFile *pf);
/* read */
int seekPackedFile(struct PackedFile *pf, int offset, int whence);
diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h
index 190b0400aff..fb1a3c43006 100644
--- a/source/blender/blenkernel/BKE_sound.h
+++ b/source/blender/blenkernel/BKE_sound.h
@@ -47,7 +47,7 @@ void sound_exit();
void sound_force_device(int device);
int sound_define_from_str(char *str);
-struct bSound* sound_new_file(struct Main *main, char* filename);
+struct bSound* sound_new_file(struct Main *main, const char *filename);
// XXX unused currently
#if 0
diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c
index 639e2062f83..c837f02279b 100644
--- a/source/blender/blenkernel/intern/idprop.c
+++ b/source/blender/blenkernel/intern/idprop.c
@@ -341,7 +341,7 @@ IDProperty *IDP_CopyString(IDProperty *prop)
}
-void IDP_AssignString(IDProperty *prop, char *st, int maxlen)
+void IDP_AssignString(IDProperty *prop, const char *st, int maxlen)
{
int stlen;
@@ -356,7 +356,7 @@ void IDP_AssignString(IDProperty *prop, char *st, int maxlen)
BLI_strncpy(prop->data.pointer, st, stlen);
}
-void IDP_ConcatStringC(IDProperty *prop, char *st)
+void IDP_ConcatStringC(IDProperty *prop, const char *st)
{
int newlen;
diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c
index 3921dfbc394..c278bf3b3d2 100644
--- a/source/blender/blenkernel/intern/packedFile.c
+++ b/source/blender/blenkernel/intern/packedFile.c
@@ -263,7 +263,7 @@ static char *find_new_name(char *name)
*/
-int writePackedFile(ReportList *reports, char *filename, PackedFile *pf, int guimode)
+int writePackedFile(ReportList *reports, const char *filename, PackedFile *pf, int guimode)
{
int file, number, remove_tmp = FALSE;
int ret_value = RET_OK;
@@ -331,7 +331,7 @@ PF_NOFILE - the original file doens't exist
*/
-int checkPackedFile(char *filename, PackedFile *pf)
+int checkPackedFile(const char *filename, PackedFile *pf)
{
struct stat st;
int ret_val, i, len, file;
diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c
index 4a9a5fa881b..443ed1f7987 100644
--- a/source/blender/blenkernel/intern/sound.c
+++ b/source/blender/blenkernel/intern/sound.c
@@ -120,7 +120,7 @@ void sound_exit()
AUD_exit();
}
-struct bSound* sound_new_file(struct Main *bmain, char* filename)
+struct bSound* sound_new_file(struct Main *bmain, const char *filename)
{
bSound* sound = NULL;
diff --git a/source/blender/blenlib/BLI_fileops.h b/source/blender/blenlib/BLI_fileops.h
index ecf981c1640..95d890f133f 100644
--- a/source/blender/blenlib/BLI_fileops.h
+++ b/source/blender/blenlib/BLI_fileops.h
@@ -40,19 +40,19 @@
extern "C" {
#endif
-void BLI_recurdir_fileops(char *dirname);
-int BLI_link(char *file, char *to);
-int BLI_is_writable(char *filename);
+void BLI_recurdir_fileops(const char *dirname);
+int BLI_link(const char *file, const char *to);
+int BLI_is_writable(const char *filename);
/**
* @attention Do not confuse with BLI_exist
*/
int BLI_exists(const char *file);
-int BLI_copy_fileops(char *file, char *to);
-int BLI_rename(char *from, char *to);
-int BLI_gzip(char *from, char *to);
-int BLI_delete(char *file, int dir, int recursive);
-int BLI_move(char *file, char *to);
+int BLI_copy_fileops(const char *file, const char *to);
+int BLI_rename(const char *from, const char *to);
+int BLI_gzip(const char *from, const char *to);
+int BLI_delete(const char *file, int dir, int recursive);
+int BLI_move(const char *file, const char *to);
int BLI_touch(const char *file);
/* only for the sane unix world: direct calls to system functions :( */
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c
index 931dd6119a2..7a30bcde327 100644
--- a/source/blender/blenlib/intern/fileops.c
+++ b/source/blender/blenlib/intern/fileops.c
@@ -58,7 +58,7 @@
return -1 if zlib fails, -2 if the originating file does not exist
note: will remove the "from" file
*/
-int BLI_gzip(char *from, char *to) {
+int BLI_gzip(const char *from, const char *to) {
char buffer[10240];
int file;
int readsize = 0;
@@ -98,7 +98,7 @@ int BLI_gzip(char *from, char *to) {
}
/* return 1 when file can be written */
-int BLI_is_writable(char *filename)
+int BLI_is_writable(const char *filename)
{
int file;
@@ -151,7 +151,7 @@ int BLI_exists(const char *file) {
static char str[MAXPATHLEN+12];
-int BLI_delete(char *file, int dir, int recursive) {
+int BLI_delete(const char *file, int dir, int recursive) {
int err;
if (recursive) {
@@ -168,7 +168,7 @@ int BLI_delete(char *file, int dir, int recursive) {
return err;
}
-int BLI_move(char *file, char *to) {
+int BLI_move(const char *file, const char *to) {
int err;
// windows doesn't support moveing to a directory
@@ -193,7 +193,7 @@ int BLI_move(char *file, char *to) {
}
-int BLI_copy_fileops(char *file, char *to) {
+int BLI_copy_fileops(const char *file, const char *to) {
int err;
// windows doesn't support copying to a directory
@@ -218,13 +218,13 @@ int BLI_copy_fileops(char *file, char *to) {
return err;
}
-int BLI_link(char *file, char *to) {
+int BLI_link(const char *file, const char *to) {
callLocalErrorCallBack("Linking files is unsupported on Windows");
return 1;
}
-void BLI_recurdir_fileops(char *dirname) {
+void BLI_recurdir_fileops(const char *dirname) {
char *lslash;
char tmp[MAXPATHLEN];
@@ -254,7 +254,7 @@ void BLI_recurdir_fileops(char *dirname) {
callLocalErrorCallBack("Unable to create directory\n");
}
-int BLI_rename(char *from, char *to) {
+int BLI_rename(const char *from, const char *to) {
if (!BLI_exists(from)) return 0;
/* make sure the filenames are different (case insensitive) before removing */
@@ -273,7 +273,7 @@ int BLI_rename(char *from, char *to) {
* */
static char str[MAXPATHLEN+12];
-int BLI_delete(char *file, int dir, int recursive)
+int BLI_delete(const char *file, int dir, int recursive)
{
if(strchr(file, '"')) {
printf("Error: not deleted file %s because of quote!\n", file);
@@ -294,25 +294,25 @@ int BLI_delete(char *file, int dir, int recursive)
return -1;
}
-int BLI_move(char *file, char *to) {
+int BLI_move(const char *file, const char *to) {
sprintf(str, "/bin/mv -f \"%s\" \"%s\"", file, to);
return system(str);
}
-int BLI_copy_fileops(char *file, char *to) {
+int BLI_copy_fileops(const char *file, const char *to) {
sprintf(str, "/bin/cp -rf \"%s\" \"%s\"", file, to);
return system(str);
}
-int BLI_link(char *file, char *to) {
+int BLI_link(const char *file, const char *to) {
sprintf(str, "/bin/ln -f \"%s\" \"%s\"", file, to);
return system(str);
}
-void BLI_recurdir_fileops(char *dirname) {
+void BLI_recurdir_fileops(const char *dirname) {
char *lslash;
char tmp[MAXPATHLEN];
@@ -330,7 +330,7 @@ void BLI_recurdir_fileops(char *dirname) {
mkdir(dirname, 0777);
}
-int BLI_rename(char *from, char *to) {
+int BLI_rename(const char *from, const char *to) {
if (!BLI_exists(from)) return 0;
if (BLI_exists(to)) if(BLI_delete(to, 0, 0)) return 1;
diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c
index 64b1aa94d99..ed8b1dae430 100644
--- a/source/blender/editors/curve/editfont.c
+++ b/source/blender/editors/curve/editfont.c
@@ -325,7 +325,7 @@ void FONT_OT_insert_lorem(wmOperatorType *ot)
/* note this handles both ascii and utf8 unicode, previously
* there were 3 functions that did effectively the same thing. */
-static int paste_file(bContext *C, ReportList *reports, char *filename)
+static int paste_file(bContext *C, ReportList *reports, const char *filename)
{
Scene *scene= CTX_data_scene(C);
Object *obedit= CTX_data_edit_object(C);
diff --git a/source/blender/editors/include/UI_interface_icons.h b/source/blender/editors/include/UI_interface_icons.h
index 73fc2d6316d..b698cd610a2 100644
--- a/source/blender/editors/include/UI_interface_icons.h
+++ b/source/blender/editors/include/UI_interface_icons.h
@@ -66,7 +66,7 @@ void UI_icons_free();
void UI_icons_free_drawinfo(void *drawinfo);
struct ListBase *UI_iconfile_list(void);
-int UI_iconfile_get_index(char *filename);
+int UI_iconfile_get_index(const char *filename);
#endif /* UI_INTERFACE_ICONS_H */
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index 0ade3e6199f..e39e594af66 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -682,7 +682,7 @@ static void free_iconfile_list(struct ListBase *list)
}
}
-int UI_iconfile_get_index(char *filename)
+int UI_iconfile_get_index(const char *filename)
{
IconFile *ifile;
ListBase *list=&(iconfilelist);
diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h
index 4fcb1ffab81..eff42e48dad 100644
--- a/source/blender/imbuf/IMB_imbuf.h
+++ b/source/blender/imbuf/IMB_imbuf.h
@@ -206,7 +206,7 @@ void IMB_close_anim(struct anim *anim);
* @attention Defined in anim.c
*/
-int ismovie(char *name);
+int ismovie(const char *name);
void IMB_anim_set_preseek(struct anim *anim, int preseek);
int IMB_anim_get_preseek(struct anim *anim);
@@ -296,19 +296,19 @@ short IMB_png_encode(struct ImBuf *ibuf, int file, int flags);
*
* @attention Defined in util.c
*/
-int IMB_ispic(char *name);
+int IMB_ispic(const char *name);
/**
*
* @attention Defined in util.c
*/
-int IMB_isanim(char *name);
+int IMB_isanim(const char *name);
/**
*
* @attention Defined in util.c
*/
-int imb_get_anim_type(char *name);
+int imb_get_anim_type(const char *name);
/**
*
diff --git a/source/blender/imbuf/intern/IMB_filetype.h b/source/blender/imbuf/intern/IMB_filetype.h
index 8529c72c7ae..f82f93c83a1 100644
--- a/source/blender/imbuf/intern/IMB_filetype.h
+++ b/source/blender/imbuf/intern/IMB_filetype.h
@@ -38,7 +38,7 @@ typedef struct ImFileType {
int (*is_a)(unsigned char *buf);
int (*ftype)(struct ImFileType *type, struct ImBuf *ibuf);
struct ImBuf *(*load)(unsigned char *mem, size_t size, int flags);
- int (*save)(struct ImBuf *ibuf, char *name, int flags);
+ int (*save)(struct ImBuf *ibuf, const char *name, int flags);
void (*load_tile)(struct ImBuf *ibuf, unsigned char *mem, size_t size, int tx, int ty, unsigned int *rect);
int flag;
@@ -61,52 +61,52 @@ void imb_tile_cache_tile_free(struct ImBuf *ibuf, int tx, int ty);
/* png */
int imb_is_a_png(unsigned char *buf);
struct ImBuf *imb_loadpng(unsigned char *mem, size_t size, int flags);
-int imb_savepng(struct ImBuf *ibuf, char *name, int flags);
+int imb_savepng(struct ImBuf *ibuf, const char *name, int flags);
/* targa */
int imb_is_a_targa(unsigned char *buf);
struct ImBuf *imb_loadtarga(unsigned char *mem, size_t size, int flags);
-int imb_savetarga(struct ImBuf * ibuf, char *name, int flags);
+int imb_savetarga(struct ImBuf * ibuf, const char *name, int flags);
/* iris */
int imb_is_a_iris(unsigned char *mem);
struct ImBuf *imb_loadiris(unsigned char *mem, size_t size, int flags);
-int imb_saveiris(struct ImBuf * ibuf, char *name, int flags);
+int imb_saveiris(struct ImBuf * ibuf, const char *name, int flags);
/* jp2 */
int imb_is_a_jp2(unsigned char *buf);
struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags);
-int imb_savejp2(struct ImBuf *ibuf, char *name, int flags);
+int imb_savejp2(struct ImBuf *ibuf, const char *name, int flags);
/* jpeg */
int imb_is_a_jpeg(unsigned char *mem);
-int imb_savejpeg(struct ImBuf * ibuf, char * name, int flags);
+int imb_savejpeg(struct ImBuf *ibuf, const char *name, int flags);
struct ImBuf * imb_ibJpegImageFromFilename (const char * filename, int flags);
struct ImBuf * imb_load_jpeg (unsigned char * buffer, size_t size, int flags);
/* bmp */
int imb_is_a_bmp(unsigned char *buf);
struct ImBuf *imb_bmp_decode(unsigned char *mem, size_t size, int flags);
-int imb_savebmp(struct ImBuf *ibuf, char *name, int flags);
+int imb_savebmp(struct ImBuf *ibuf, const char *name, int flags);
/* cocoa */
struct ImBuf *imb_cocoaLoadImage(unsigned char *mem, size_t size, int flags);
-short imb_cocoaSaveImage(struct ImBuf *ibuf, char *name, int flags);
+short imb_cocoaSaveImage(struct ImBuf *ibuf, const char *name, int flags);
/* cineon */
-int imb_savecineon(struct ImBuf *buf, char *myfil, int flags);
+int imb_savecineon(struct ImBuf *buf, const char *name, int flags);
struct ImBuf *imb_loadcineon(unsigned char *mem, size_t size, int flags);
int imb_is_cineon(unsigned char *buf);
/* dpx */
-int imb_save_dpx(struct ImBuf *buf, char *myfile, int flags);
+int imb_save_dpx(struct ImBuf *buf, const char *name, int flags);
struct ImBuf *imb_loaddpx(unsigned char *mem, size_t size, int flags);
int imb_is_dpx(unsigned char *buf);
/* hdr */
int imb_is_a_hdr(unsigned char *buf);
struct ImBuf *imb_loadhdr(unsigned char *mem, size_t size, int flags);
-int imb_savehdr(struct ImBuf * ibuf, char *name, int flags);
+int imb_savehdr(struct ImBuf * ibuf, const char *name, int flags);
/* tiff */
void imb_inittiff(void);
@@ -114,7 +114,7 @@ int imb_is_a_tiff(unsigned char *buf);
struct ImBuf *imb_loadtiff(unsigned char *mem, size_t size, int flags);
void imb_loadtiletiff(struct ImBuf *ibuf, unsigned char *mem, size_t size,
int tx, int ty, unsigned int *rect);
-int imb_savetiff(struct ImBuf *ibuf, char *name, int flags);
+int imb_savetiff(struct ImBuf *ibuf, const char *name, int flags);
void *libtiff_findsymbol(char *name);
#endif /* IMB_FILETYPE_H */
diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c
index 421ef08dc25..1bf8eb899db 100644
--- a/source/blender/imbuf/intern/anim_movie.c
+++ b/source/blender/imbuf/intern/anim_movie.c
@@ -215,7 +215,7 @@ int ismovie(char *name) {
#else
-int ismovie(char *UNUSED(name)) {
+int ismovie(const char *UNUSED(name)) {
return 0;
}
diff --git a/source/blender/imbuf/intern/bmp.c b/source/blender/imbuf/intern/bmp.c
index 10dc23b1ad2..8aae41b653c 100644
--- a/source/blender/imbuf/intern/bmp.c
+++ b/source/blender/imbuf/intern/bmp.c
@@ -195,7 +195,7 @@ static int putShortLSB(unsigned short us,FILE *ofile) {
}
/* Found write info at http://users.ece.gatech.edu/~slabaugh/personal/c/bitmapUnix.c */
-int imb_savebmp(struct ImBuf *ibuf, char *name, int flags) {
+int imb_savebmp(struct ImBuf *ibuf, const char *name, int flags) {
BMPINFOHEADER infoheader;
int bytesize, extrabytes, x, y, t, ptr;
diff --git a/source/blender/imbuf/intern/cineon/cineon_dpx.c b/source/blender/imbuf/intern/cineon/cineon_dpx.c
index 7a5a3fb011b..816d2d27b78 100644
--- a/source/blender/imbuf/intern/cineon/cineon_dpx.c
+++ b/source/blender/imbuf/intern/cineon/cineon_dpx.c
@@ -116,7 +116,7 @@ static struct ImBuf *imb_load_dpx_cineon(unsigned char *mem, int use_cineon, int
return ibuf;
}
-static int imb_save_dpx_cineon(ImBuf *buf, char *filename, int use_cineon, int flags)
+static int imb_save_dpx_cineon(ImBuf *buf, const char *filename, int use_cineon, int flags)
{
LogImageByteConversionParameters conversion;
int width, height, depth;
@@ -182,7 +182,7 @@ static int imb_save_dpx_cineon(ImBuf *buf, char *filename, int use_cineon, int f
return 1;
}
-short imb_savecineon(struct ImBuf *buf, char *myfile, int flags)
+short imb_savecineon(struct ImBuf *buf, const char *myfile, int flags)
{
return imb_save_dpx_cineon(buf, myfile, 1, flags);
}
@@ -200,7 +200,7 @@ ImBuf *imb_loadcineon(unsigned char *mem, int size, int flags)
return NULL;
}
-short imb_save_dpx(struct ImBuf *buf, char *myfile, int flags)
+short imb_save_dpx(struct ImBuf *buf, const char *myfile, int flags)
{
return imb_save_dpx_cineon(buf, myfile, 0, flags);
}
diff --git a/source/blender/imbuf/intern/dds/dds_api.cpp b/source/blender/imbuf/intern/dds/dds_api.cpp
index 08f60589977..94ff8fd5d78 100644
--- a/source/blender/imbuf/intern/dds/dds_api.cpp
+++ b/source/blender/imbuf/intern/dds/dds_api.cpp
@@ -37,7 +37,7 @@ extern "C" {
#include "IMB_allocimbuf.h"
-int imb_save_dds(struct ImBuf * ibuf, char *name, int flags)
+int imb_save_dds(struct ImBuf * ibuf, const char *name, int flags)
{
return(0); /* todo: finish this function */
diff --git a/source/blender/imbuf/intern/dds/dds_api.h b/source/blender/imbuf/intern/dds/dds_api.h
index 384570ceb72..6aea3058863 100644
--- a/source/blender/imbuf/intern/dds/dds_api.h
+++ b/source/blender/imbuf/intern/dds/dds_api.h
@@ -29,7 +29,7 @@
extern "C" {
#endif
-int imb_save_dds(struct ImBuf *ibuf, char *name, int flags);
+int imb_save_dds(struct ImBuf *ibuf, const char *name, int flags);
int imb_is_a_dds(unsigned char *mem); /* use only first 32 bytes of mem */
struct ImBuf *imb_load_dds(unsigned char *mem, size_t size, int flags);
diff --git a/source/blender/imbuf/intern/iris.c b/source/blender/imbuf/intern/iris.c
index 71ba9b06cad..4e74132cdc7 100644
--- a/source/blender/imbuf/intern/iris.c
+++ b/source/blender/imbuf/intern/iris.c
@@ -662,7 +662,7 @@ static void expandrow(unsigned char *optr, unsigned char *iptr, int z)
* Added: zbuf write
*/
-static int output_iris(unsigned int *lptr, int xsize, int ysize, int zsize, char *name, int *zptr)
+static int output_iris(unsigned int *lptr, int xsize, int ysize, int zsize, const char *name, int *zptr)
{
FILE *outf;
IMAGE *image;
@@ -816,7 +816,7 @@ static int compressrow(unsigned char *lbuf, unsigned char *rlebuf, int z, int cn
return optr - (unsigned char *)rlebuf;
}
-int imb_saveiris(struct ImBuf * ibuf, char *name, int flags)
+int imb_saveiris(struct ImBuf * ibuf, const char *name, int flags)
{
short zsize;
int ret;
diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c
index 0403d0044f5..3f0443e5a88 100644
--- a/source/blender/imbuf/intern/jp2.c
+++ b/source/blender/imbuf/intern/jp2.c
@@ -661,7 +661,7 @@ static opj_image_t* ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters) {
/* Found write info at http://users.ece.gatech.edu/~slabaugh/personal/c/bitmapUnix.c */
-int imb_savejp2(struct ImBuf *ibuf, char *name, int flags) {
+int imb_savejp2(struct ImBuf *ibuf, const char *name, int flags) {
int quality = ibuf->ftype & 0xff;
diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c
index e7737e68fce..c685a54cbe9 100644
--- a/source/blender/imbuf/intern/jpeg.c
+++ b/source/blender/imbuf/intern/jpeg.c
@@ -622,7 +622,7 @@ static int init_jpeg(FILE * outfile, struct jpeg_compress_struct * cinfo, struct
}
-static int save_stdjpeg(char * name, struct ImBuf * ibuf)
+static int save_stdjpeg(const char *name, struct ImBuf *ibuf)
{
FILE * outfile;
struct jpeg_compress_struct _cinfo, *cinfo = &_cinfo;
@@ -656,7 +656,7 @@ static int save_stdjpeg(char * name, struct ImBuf * ibuf)
}
-static int save_vidjpeg(char * name, struct ImBuf * ibuf)
+static int save_vidjpeg(const char *name, struct ImBuf *ibuf)
{
FILE * outfile;
struct jpeg_compress_struct _cinfo, *cinfo = &_cinfo;
@@ -695,7 +695,7 @@ static int save_vidjpeg(char * name, struct ImBuf * ibuf)
return 1;
}
-static int save_jstjpeg(char * name, struct ImBuf * ibuf)
+static int save_jstjpeg(const char *name, struct ImBuf *ibuf)
{
char fieldname[1024];
struct ImBuf * tbuf;
@@ -726,7 +726,7 @@ static int save_jstjpeg(char * name, struct ImBuf * ibuf)
return returnval;
}
-static int save_maxjpeg(char * name, struct ImBuf * ibuf)
+static int save_maxjpeg(const char *name, struct ImBuf *ibuf)
{
FILE * outfile;
struct jpeg_compress_struct _cinfo, *cinfo = &_cinfo;
@@ -765,7 +765,7 @@ static int save_maxjpeg(char * name, struct ImBuf * ibuf)
return 1;
}
-int imb_savejpeg(struct ImBuf * ibuf, char * name, int flags)
+int imb_savejpeg(struct ImBuf *ibuf, const char *name, int flags)
{
ibuf->flags = flags;
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp
index 2be935a9565..964e57f6cfe 100644
--- a/source/blender/imbuf/intern/openexr/openexr_api.cpp
+++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp
@@ -187,7 +187,7 @@ static void openexr_header_metadata(Header *header, struct ImBuf *ibuf)
header->insert(info->key, StringAttribute(info->value));
}
-static int imb_save_openexr_half(struct ImBuf *ibuf, char *name, int flags)
+static int imb_save_openexr_half(struct ImBuf *ibuf, const char *name, int flags)
{
int channels = ibuf->channels;
int width = ibuf->x;
@@ -314,7 +314,7 @@ static int imb_save_openexr_half(struct ImBuf *ibuf, char *name, int flags)
return (1);
}
-static int imb_save_openexr_float(struct ImBuf *ibuf, char *name, int flags)
+static int imb_save_openexr_float(struct ImBuf *ibuf, const char *name, int flags)
{
int channels = ibuf->channels;
int width = ibuf->x;
@@ -372,7 +372,7 @@ static int imb_save_openexr_float(struct ImBuf *ibuf, char *name, int flags)
}
-int imb_save_openexr(struct ImBuf *ibuf, char *name, int flags)
+int imb_save_openexr(struct ImBuf *ibuf, const char *name, int flags)
{
if (flags & IB_mem)
{
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.h b/source/blender/imbuf/intern/openexr/openexr_api.h
index c7e4c7d2f57..8ca6dcd36e9 100644
--- a/source/blender/imbuf/intern/openexr/openexr_api.h
+++ b/source/blender/imbuf/intern/openexr/openexr_api.h
@@ -46,7 +46,7 @@ extern "C" {
int imb_is_a_openexr (unsigned char *mem);
-int imb_save_openexr (struct ImBuf *ibuf, char *name, int flags);
+int imb_save_openexr (struct ImBuf *ibuf, const char *name, int flags);
struct ImBuf *imb_load_openexr (unsigned char *mem, size_t size, int flags);
diff --git a/source/blender/imbuf/intern/png.c b/source/blender/imbuf/intern/png.c
index b29a4ae0627..0acefac45b5 100644
--- a/source/blender/imbuf/intern/png.c
+++ b/source/blender/imbuf/intern/png.c
@@ -94,7 +94,7 @@ static void ReadData( png_structp png_ptr, png_bytep data, png_size_t length)
longjmp(png_jmpbuf(png_ptr), 1);
}
-int imb_savepng(struct ImBuf *ibuf, char *name, int flags)
+int imb_savepng(struct ImBuf *ibuf, const char *name, int flags)
{
png_structp png_ptr;
png_infop info_ptr;
diff --git a/source/blender/imbuf/intern/radiance_hdr.c b/source/blender/imbuf/intern/radiance_hdr.c
index b356f56ab74..9dbb4512e1f 100644
--- a/source/blender/imbuf/intern/radiance_hdr.c
+++ b/source/blender/imbuf/intern/radiance_hdr.c
@@ -333,7 +333,7 @@ static void writeHeader(FILE *file, int width, int height)
fputc(10, file);
}
-int imb_savehdr(struct ImBuf *ibuf, char *name, int flags)
+int imb_savehdr(struct ImBuf *ibuf, const char *name, int flags)
{
FILE* file = fopen(name, "wb");
float *fp= NULL;
diff --git a/source/blender/imbuf/intern/targa.c b/source/blender/imbuf/intern/targa.c
index bc88f2bed0d..a748cc1ab1d 100644
--- a/source/blender/imbuf/intern/targa.c
+++ b/source/blender/imbuf/intern/targa.c
@@ -233,7 +233,7 @@ static int dumptarga(struct ImBuf * ibuf, FILE * file)
}
-int imb_savetarga(struct ImBuf * ibuf, char *name, int flags)
+int imb_savetarga(struct ImBuf * ibuf, const char *name, int flags)
{
char buf[20]= {0};
FILE *fildes;
diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c
index eb5d1f2c039..c086a55a70a 100644
--- a/source/blender/imbuf/intern/tiff.c
+++ b/source/blender/imbuf/intern/tiff.c
@@ -642,7 +642,7 @@ void imb_loadtiletiff(ImBuf *ibuf, unsigned char *mem, size_t size, int tx, int
* @return: 1 if the function is successful, 0 on failure.
*/
-int imb_savetiff(ImBuf *ibuf, char *name, int flags)
+int imb_savetiff(ImBuf *ibuf, const char *name, int flags)
{
TIFF *image = NULL;
uint16 samplesperpixel, bitspersample;
diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c
index cd447e5e43a..0365b712f24 100644
--- a/source/blender/imbuf/intern/util.c
+++ b/source/blender/imbuf/intern/util.c
@@ -142,7 +142,7 @@ const char *imb_ext_audio[] = {
".eac3",
NULL};
-static int IMB_ispic_name(char *name)
+static int IMB_ispic_name(const char *name)
{
ImFileType *type;
struct stat st;
@@ -176,7 +176,7 @@ static int IMB_ispic_name(char *name)
return FALSE;
}
-int IMB_ispic(char *filename)
+int IMB_ispic(const char *filename)
{
if(U.uiflag & USER_FILTERFILEEXTS) {
if( (BLI_testextensie_array(filename, imb_ext_image)) ||
@@ -195,12 +195,12 @@ int IMB_ispic(char *filename)
-static int isavi (char *name) {
+static int isavi (const char *name) {
return AVI_is_avi (name);
}
#ifdef WITH_QUICKTIME
-static int isqtime (char *name) {
+static int isqtime (const char *name) {
return anim_is_quicktime (name);
}
#endif
@@ -248,7 +248,7 @@ static AVCodecContext* get_codec_from_stream(AVStream* stream)
#endif
-static int isffmpeg (char *filename) {
+static int isffmpeg (const char *filename) {
AVFormatContext *pFormatCtx;
unsigned int i;
int videoStream;
@@ -331,7 +331,7 @@ static int isredcode(char * filename)
#endif
-int imb_get_anim_type(char * name) {
+int imb_get_anim_type(const char * name) {
int type;
struct stat st;
@@ -372,7 +372,7 @@ int imb_get_anim_type(char * name) {
return(0);
}
-int IMB_isanim(char *filename) {
+int IMB_isanim(const char *filename) {
int type;
if(U.uiflag & USER_FILTERFILEEXTS) {
diff --git a/source/blender/imbuf/intern/writeimage.c b/source/blender/imbuf/intern/writeimage.c
index 98a7399c000..9c2855b0544 100644
--- a/source/blender/imbuf/intern/writeimage.c
+++ b/source/blender/imbuf/intern/writeimage.c
@@ -51,7 +51,7 @@ short IMB_saveiff(struct ImBuf *ibuf, const char *name, int flags)
IMB_rect_from_float(ibuf);
}
/* TODO. have const char for image write funcs */
- return type->save(ibuf, (char *)name, flags);
+ return type->save(ibuf, name, flags);
}
}
diff --git a/source/blender/python/generic/IDProp.c b/source/blender/python/generic/IDProp.c
index c64be00093c..4dfb76c6617 100644
--- a/source/blender/python/generic/IDProp.c
+++ b/source/blender/python/generic/IDProp.c
@@ -295,7 +295,7 @@ static int idp_sequence_type(PyObject *seq)
}
/* note: group can be a pointer array or a group */
-char *BPy_IDProperty_Map_ValidateAndCreate(char *name, IDProperty *group, PyObject *ob)
+const char *BPy_IDProperty_Map_ValidateAndCreate(const char *name, IDProperty *group, PyObject *ob)
{
IDProperty *prop = NULL;
IDPropertyTemplate val = {0};
@@ -352,7 +352,7 @@ char *BPy_IDProperty_Map_ValidateAndCreate(char *name, IDProperty *group, PyObje
case IDP_IDPARRAY:
prop= IDP_NewIDPArray(name);
for (i=0; i<val.array.len; i++) {
- char *error;
+ const char *error;
item = PySequence_GetItem(ob, i);
error= BPy_IDProperty_Map_ValidateAndCreate("", prop, item);
Py_DECREF(item);
@@ -432,7 +432,7 @@ int BPy_Wrap_SetMapItem(IDProperty *prop, PyObject *key, PyObject *val)
}
}
else {
- char *err;
+ const char *err;
if (!PyUnicode_Check(key)) {
PyErr_SetString( PyExc_TypeError, "only strings are allowed as subgroup keys" );
diff --git a/source/blender/python/generic/IDProp.h b/source/blender/python/generic/IDProp.h
index c0a07879c1d..cd5bff4788e 100644
--- a/source/blender/python/generic/IDProp.h
+++ b/source/blender/python/generic/IDProp.h
@@ -56,7 +56,7 @@ int BPy_Wrap_SetMapItem(struct IDProperty *prop, PyObject *key, PyObject *val);
PyObject *BPy_IDGroup_WrapData(struct ID *id, struct IDProperty *prop );
-char *BPy_IDProperty_Map_ValidateAndCreate(char *name, struct IDProperty *group, PyObject *ob);
+const char *BPy_IDProperty_Map_ValidateAndCreate(const char *name, struct IDProperty *group, PyObject *ob);
void IDProp_Init_Types(void);
diff --git a/source/blender/quicktime/apple/qtkit_import.m b/source/blender/quicktime/apple/qtkit_import.m
index f067d717a7c..06cfb82e904 100644
--- a/source/blender/quicktime/apple/qtkit_import.m
+++ b/source/blender/quicktime/apple/qtkit_import.m
@@ -79,7 +79,7 @@ void quicktime_exit(void)
}
-int anim_is_quicktime (char *name)
+int anim_is_quicktime (const char *name)
{
NSAutoreleasePool *pool;
diff --git a/source/blender/quicktime/apple/quicktime_import.c b/source/blender/quicktime/apple/quicktime_import.c
index 08196553a79..cec5a1735fc 100644
--- a/source/blender/quicktime/apple/quicktime_import.c
+++ b/source/blender/quicktime/apple/quicktime_import.c
@@ -170,7 +170,7 @@ char *get_valid_qtname(char *name)
#endif /* _WIN32 */
-int anim_is_quicktime (char *name)
+int anim_is_quicktime (const char *name)
{
FSSpec theFSSpec;
char theFullPath[255];
diff --git a/source/blender/quicktime/quicktime_import.h b/source/blender/quicktime/quicktime_import.h
index 150aa07b1c2..bfc71b65127 100644
--- a/source/blender/quicktime/quicktime_import.h
+++ b/source/blender/quicktime/quicktime_import.h
@@ -62,7 +62,7 @@ char *get_valid_qtname(char *name);
// quicktime movie import functions
-int anim_is_quicktime (char *name);
+int anim_is_quicktime (const char *name);
int startquicktime (struct anim *anim);
void free_anim_quicktime (struct anim *anim);
ImBuf *qtime_fetchibuf (struct anim *anim, int position);