[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33167] trunk/blender/source/blender: use 'const char *' for imbuf and file ops.
Campbell Barton
ideasman42 at gmail.com
Fri Nov 19 03:14:19 CET 2010
Revision: 33167
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33167
Author: campbellbarton
Date: 2010-11-19 03:14:18 +0100 (Fri, 19 Nov 2010)
Log Message:
-----------
use 'const char *' for imbuf and file ops.
Modified Paths:
--------------
trunk/blender/source/blender/avi/AVI_avi.h
trunk/blender/source/blender/avi/intern/avi.c
trunk/blender/source/blender/blenkernel/BKE_idprop.h
trunk/blender/source/blender/blenkernel/BKE_packedFile.h
trunk/blender/source/blender/blenkernel/BKE_sound.h
trunk/blender/source/blender/blenkernel/intern/idprop.c
trunk/blender/source/blender/blenkernel/intern/packedFile.c
trunk/blender/source/blender/blenkernel/intern/sound.c
trunk/blender/source/blender/blenlib/BLI_fileops.h
trunk/blender/source/blender/blenlib/intern/fileops.c
trunk/blender/source/blender/editors/curve/editfont.c
trunk/blender/source/blender/editors/include/UI_interface_icons.h
trunk/blender/source/blender/editors/interface/interface_icons.c
trunk/blender/source/blender/imbuf/IMB_imbuf.h
trunk/blender/source/blender/imbuf/intern/IMB_filetype.h
trunk/blender/source/blender/imbuf/intern/anim_movie.c
trunk/blender/source/blender/imbuf/intern/bmp.c
trunk/blender/source/blender/imbuf/intern/cineon/cineon_dpx.c
trunk/blender/source/blender/imbuf/intern/dds/dds_api.cpp
trunk/blender/source/blender/imbuf/intern/dds/dds_api.h
trunk/blender/source/blender/imbuf/intern/iris.c
trunk/blender/source/blender/imbuf/intern/jp2.c
trunk/blender/source/blender/imbuf/intern/jpeg.c
trunk/blender/source/blender/imbuf/intern/openexr/openexr_api.cpp
trunk/blender/source/blender/imbuf/intern/openexr/openexr_api.h
trunk/blender/source/blender/imbuf/intern/png.c
trunk/blender/source/blender/imbuf/intern/radiance_hdr.c
trunk/blender/source/blender/imbuf/intern/targa.c
trunk/blender/source/blender/imbuf/intern/tiff.c
trunk/blender/source/blender/imbuf/intern/util.c
trunk/blender/source/blender/imbuf/intern/writeimage.c
trunk/blender/source/blender/python/generic/IDProp.c
trunk/blender/source/blender/python/generic/IDProp.h
trunk/blender/source/blender/quicktime/apple/qtkit_import.m
trunk/blender/source/blender/quicktime/apple/quicktime_import.c
trunk/blender/source/blender/quicktime/quicktime_import.h
Modified: trunk/blender/source/blender/avi/AVI_avi.h
===================================================================
--- trunk/blender/source/blender/avi/AVI_avi.h 2010-11-19 01:06:46 UTC (rev 33166)
+++ trunk/blender/source/blender/avi/AVI_avi.h 2010-11-19 02:14:18 UTC (rev 33167)
@@ -232,7 +232,7 @@
/**
* Test whether this is an avi-format.
*/
-int AVI_is_avi (char *name);
+int AVI_is_avi (const char *name);
/**
@@ -277,7 +277,7 @@
/**
* 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.
Modified: trunk/blender/source/blender/avi/intern/avi.c
===================================================================
--- trunk/blender/source/blender/avi/intern/avi.c 2010-11-19 01:06:46 UTC (rev 33166)
+++ trunk/blender/source/blender/avi/intern/avi.c 2010-11-19 02:14:18 UTC (rev 33167)
@@ -211,7 +211,7 @@
}
*/
-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 @@
}
-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");
Modified: trunk/blender/source/blender/blenkernel/BKE_idprop.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_idprop.h 2010-11-19 01:06:46 UTC (rev 33166)
+++ trunk/blender/source/blender/blenkernel/BKE_idprop.h 2010-11-19 02:14:18 UTC (rev 33167)
@@ -72,8 +72,8 @@
/* ---------- 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);
Modified: trunk/blender/source/blender/blenkernel/BKE_packedFile.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_packedFile.h 2010-11-19 01:06:46 UTC (rev 33166)
+++ trunk/blender/source/blender/blenkernel/BKE_packedFile.h 2010-11-19 02:14:18 UTC (rev 33167)
@@ -54,14 +54,14 @@
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);
Modified: trunk/blender/source/blender/blenkernel/BKE_sound.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_sound.h 2010-11-19 01:06:46 UTC (rev 33166)
+++ trunk/blender/source/blender/blenkernel/BKE_sound.h 2010-11-19 02:14:18 UTC (rev 33167)
@@ -47,7 +47,7 @@
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
Modified: trunk/blender/source/blender/blenkernel/intern/idprop.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/idprop.c 2010-11-19 01:06:46 UTC (rev 33166)
+++ trunk/blender/source/blender/blenkernel/intern/idprop.c 2010-11-19 02:14:18 UTC (rev 33167)
@@ -341,7 +341,7 @@
}
-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 @@
BLI_strncpy(prop->data.pointer, st, stlen);
}
-void IDP_ConcatStringC(IDProperty *prop, char *st)
+void IDP_ConcatStringC(IDProperty *prop, const char *st)
{
int newlen;
Modified: trunk/blender/source/blender/blenkernel/intern/packedFile.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/packedFile.c 2010-11-19 01:06:46 UTC (rev 33166)
+++ trunk/blender/source/blender/blenkernel/intern/packedFile.c 2010-11-19 02:14:18 UTC (rev 33167)
@@ -263,7 +263,7 @@
*/
-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 @@
*/
-int checkPackedFile(char *filename, PackedFile *pf)
+int checkPackedFile(const char *filename, PackedFile *pf)
{
struct stat st;
int ret_val, i, len, file;
Modified: trunk/blender/source/blender/blenkernel/intern/sound.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/sound.c 2010-11-19 01:06:46 UTC (rev 33166)
+++ trunk/blender/source/blender/blenkernel/intern/sound.c 2010-11-19 02:14:18 UTC (rev 33167)
@@ -120,7 +120,7 @@
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;
Modified: trunk/blender/source/blender/blenlib/BLI_fileops.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_fileops.h 2010-11-19 01:06:46 UTC (rev 33166)
+++ trunk/blender/source/blender/blenlib/BLI_fileops.h 2010-11-19 02:14:18 UTC (rev 33167)
@@ -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 :( */
Modified: trunk/blender/source/blender/blenlib/intern/fileops.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/fileops.c 2010-11-19 01:06:46 UTC (rev 33166)
+++ trunk/blender/source/blender/blenlib/intern/fileops.c 2010-11-19 02:14:18 UTC (rev 33167)
@@ -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 @@
}
/* 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 @@
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 @@
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_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 @@
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 @@
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 @@
* */
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 @@
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 @@
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;
Modified: trunk/blender/source/blender/editors/curve/editfont.c
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list