diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-08-07 21:38:36 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-08-07 21:38:36 +0400 |
commit | 5681380db0f46ec16f942ecba9002061ce37b87d (patch) | |
tree | e2eb4e61f377c9c17e52665fbf845cb685d5b60c /intern | |
parent | f12df1e3863ca2043947c64786e0f3c7f0fccca0 (diff) |
simplify x11 path code, had unneeded NULL checks and std namespace
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemPathsX11.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/intern/ghost/intern/GHOST_SystemPathsX11.cpp b/intern/ghost/intern/GHOST_SystemPathsX11.cpp index dd8935732c5..135f5c42dc5 100644 --- a/intern/ghost/intern/GHOST_SystemPathsX11.cpp +++ b/intern/ghost/intern/GHOST_SystemPathsX11.cpp @@ -43,7 +43,11 @@ #include <stdio.h> // for fprintf only #include <cstdlib> // for exit -using namespace std; +#ifdef PREFIX +static const char *static_path= PREFIX "/share" ; +#else +static const char *static_path= NULL; +#endif GHOST_SystemPathsX11::GHOST_SystemPathsX11() { @@ -56,21 +60,12 @@ GHOST_SystemPathsX11::~GHOST_SystemPathsX11() const GHOST_TUns8* GHOST_SystemPathsX11::getSystemDir() const { /* no prefix assumes a portable build which only uses bundled scripts */ -#ifdef PREFIX - return (GHOST_TUns8*) PREFIX "/share"; -#else - return NULL; -#endif + return (const GHOST_TUns8 *)static_path; } const GHOST_TUns8* GHOST_SystemPathsX11::getUserDir() const { - const char* env = getenv("HOME"); - if(env) { - return (GHOST_TUns8*) env; - } else { - return NULL; - } + return (const GHOST_TUns8 *)getenv("HOME"); } const GHOST_TUns8* GHOST_SystemPathsX11::getBinaryDir() const |