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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-02-26 18:28:56 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-02-26 18:28:56 +0300
commita12315e4ec1bb3d02a7a4d09afc450745a1784f6 (patch)
treeb78e727307399dd199220c7c69bf3545d4745019 /source/blender
parent38bd8dcf05aa8d22cc97ba08eec4f7a4b858f696 (diff)
use const char for return values of getenv().
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenlib/BLI_path_util.h2
-rw-r--r--source/blender/blenlib/intern/path_util.c18
-rw-r--r--source/blender/editors/space_file/fsmenu.c4
-rw-r--r--source/blender/imbuf/intern/thumbs.c2
4 files changed, 13 insertions, 13 deletions
diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h
index b3d657b7323..b3220937e19 100644
--- a/source/blender/blenlib/BLI_path_util.h
+++ b/source/blender/blenlib/BLI_path_util.h
@@ -40,7 +40,7 @@ extern "C" {
struct ListBase;
struct direntry;
-char *BLI_getDefaultDocumentFolder(void);
+const char *BLI_getDefaultDocumentFolder(void);
char *BLI_get_folder(int folder_id, const char *subfolder);
char *BLI_get_folder_create(int folder_id, const char *subfolder);
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index 2359a858d51..97712639a6c 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -812,12 +812,12 @@ void BLI_getlastdir(const char* dir, char *last, int maxlen)
/* This is now only used to really get the user's default document folder */
/* On Windows I chose the 'Users/<MyUserName>/Documents' since it's used
as default location to save documents */
-char *BLI_getDefaultDocumentFolder(void) {
+const char *BLI_getDefaultDocumentFolder(void) {
#if !defined(WIN32)
return getenv("HOME");
#else /* Windows */
- char * ret;
+ const char * ret;
static char documentfolder[MAXPATHLEN];
HRESULT hResult;
@@ -883,7 +883,7 @@ static int test_path(char *targetpath, const char *path_base, const char *path_s
static int test_env_path(char *path, const char *envvar)
{
- char *env = envvar?getenv(envvar):NULL;
+ const char *env = envvar?getenv(envvar):NULL;
if (!env) return 0;
if (BLI_is_dir(env)) {
@@ -1617,7 +1617,7 @@ static int add_win32_extension(char *name)
#ifdef _WIN32
char filename[FILE_MAXDIR+FILE_MAXFILE];
char ext[FILE_MAXDIR+FILE_MAXFILE];
- char *extensions = getenv("PATHEXT");
+ const char *extensions = getenv("PATHEXT");
if (extensions) {
char *temp;
do {
@@ -1652,7 +1652,7 @@ static int add_win32_extension(char *name)
void BLI_where_am_i(char *fullname, const int maxlen, const char *name)
{
char filename[FILE_MAXDIR+FILE_MAXFILE];
- char *path = NULL, *temp;
+ const char *path = NULL, *temp;
#ifdef _WIN32
const char *separator = ";";
@@ -1666,7 +1666,7 @@ void BLI_where_am_i(char *fullname, const int maxlen, const char *name)
path = br_find_exe( NULL );
if (path) {
BLI_strncpy(fullname, path, maxlen);
- free(path);
+ free((void *)path);
return;
}
#endif
@@ -1749,7 +1749,7 @@ void BLI_where_is_temp(char *fullname, const int maxlen, int usertemp)
#ifdef WIN32
if (fullname[0] == '\0') {
- char *tmp = getenv("TEMP"); /* Windows */
+ const char *tmp = getenv("TEMP"); /* Windows */
if (tmp && BLI_is_dir(tmp)) {
BLI_strncpy(fullname, tmp, maxlen);
}
@@ -1757,14 +1757,14 @@ void BLI_where_is_temp(char *fullname, const int maxlen, int usertemp)
#else
/* Other OS's - Try TMP and TMPDIR */
if (fullname[0] == '\0') {
- char *tmp = getenv("TMP");
+ const char *tmp = getenv("TMP");
if (tmp && BLI_is_dir(tmp)) {
BLI_strncpy(fullname, tmp, maxlen);
}
}
if (fullname[0] == '\0') {
- char *tmp = getenv("TMPDIR");
+ const char *tmp = getenv("TMPDIR");
if (tmp && BLI_is_dir(tmp)) {
BLI_strncpy(fullname, tmp, maxlen);
}
diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c
index 340c7f72e4a..78977e4e88f 100644
--- a/source/blender/editors/space_file/fsmenu.c
+++ b/source/blender/editors/space_file/fsmenu.c
@@ -312,7 +312,7 @@ void fsmenu_read_system(struct FSMenu* fsmenu)
#if (MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4)
OSErr err=noErr;
int i;
- char *home;
+ const char *home;
/* loop through all the OS X Volumes, and add them to the SYSTEM section */
for (i=1; err!=nsvErr; i++)
@@ -454,7 +454,7 @@ void fsmenu_read_system(struct FSMenu* fsmenu)
#else
/* unix */
{
- char *home= getenv("HOME");
+ const char *home= getenv("HOME");
if(home) {
BLI_snprintf(line, FILE_MAXDIR, "%s/", home);
diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c
index 24c5a755aef..1585206bb6b 100644
--- a/source/blender/imbuf/intern/thumbs.c
+++ b/source/blender/imbuf/intern/thumbs.c
@@ -69,7 +69,7 @@ static int get_thumb_dir( char* dir , ThumbSize size)
/* yes, applications shouldn't store data there, but so does GIMP :)*/
SHGetSpecialFolderPath(0, dir, CSIDL_PROFILE, 0);
#else
- char* home = getenv("HOME");
+ const char* home = getenv("HOME");
if (!home) return 0;
BLI_strncpy(dir, home, FILE_MAX);
#endif