[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39160] trunk/blender/intern/ghost/intern/ GHOST_SystemPathsX11.cpp: simplify x11 path code, had unneeded NULL checks and std namespace

Campbell Barton ideasman42 at gmail.com
Sun Aug 7 19:38:36 CEST 2011


Revision: 39160
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39160
Author:   campbellbarton
Date:     2011-08-07 17:38:36 +0000 (Sun, 07 Aug 2011)
Log Message:
-----------
simplify x11 path code, had unneeded NULL checks and std namespace

Modified Paths:
--------------
    trunk/blender/intern/ghost/intern/GHOST_SystemPathsX11.cpp

Modified: trunk/blender/intern/ghost/intern/GHOST_SystemPathsX11.cpp
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_SystemPathsX11.cpp	2011-08-07 17:22:47 UTC (rev 39159)
+++ trunk/blender/intern/ghost/intern/GHOST_SystemPathsX11.cpp	2011-08-07 17:38:36 UTC (rev 39160)
@@ -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 @@
 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




More information about the Bf-blender-cvs mailing list