diff options
author | Maxime Curioni <maxime.curioni@gmail.com> | 2008-05-10 03:06:28 +0400 |
---|---|---|
committer | Maxime Curioni <maxime.curioni@gmail.com> | 2008-05-10 03:06:28 +0400 |
commit | fd9ad582983939741a4c4fa5f2707f29365d6c09 (patch) | |
tree | d8817227d5b5687af533316e18b4db40512884e6 /source/blender/freestyle/intern/system | |
parent | 64e4a3ec9aed6c8abe095e2cd1fe1552f7cde51c (diff) |
soc-2008-mxcurioni: towards Freestyle compilation, removing Qt's QString and QImage dependencies. Up to this commit, the following directories compile well (and without any warning): system, image, geometry, graph, winged_edge, view_map, stroke.
Modified code is commented by //soc and unused variables by //soc unused
Diffstat (limited to 'source/blender/freestyle/intern/system')
-rwxr-xr-x | source/blender/freestyle/intern/system/Interpreter.h | 2 | ||||
-rwxr-xr-x | source/blender/freestyle/intern/system/PseudoNoise.cpp | 2 | ||||
-rwxr-xr-x | source/blender/freestyle/intern/system/StringUtils.cpp | 20 |
3 files changed, 18 insertions, 6 deletions
diff --git a/source/blender/freestyle/intern/system/Interpreter.h b/source/blender/freestyle/intern/system/Interpreter.h index ce603b17238..45cb7793cfd 100755 --- a/source/blender/freestyle/intern/system/Interpreter.h +++ b/source/blender/freestyle/intern/system/Interpreter.h @@ -40,6 +40,8 @@ class LIB_SYSTEM_EXPORT Interpreter Interpreter() { _language = "Unknown"; } + virtual ~Interpreter() {}; //soc + virtual int interpretCmd(const string& cmd) = 0; virtual int interpretFile(const string& filename) = 0; diff --git a/source/blender/freestyle/intern/system/PseudoNoise.cpp b/source/blender/freestyle/intern/system/PseudoNoise.cpp index 59332229ae2..4d62f967cde 100755 --- a/source/blender/freestyle/intern/system/PseudoNoise.cpp +++ b/source/blender/freestyle/intern/system/PseudoNoise.cpp @@ -36,7 +36,7 @@ PseudoNoise::init (long seed) { _values = new real[NB_VALUE_NOISE]; RandGen::srand48(seed); - for (int i=0; i<NB_VALUE_NOISE; i++) + for (uint i=0; i<NB_VALUE_NOISE; i++) _values[i] = -1.0 + 2.0 * RandGen::drand48(); } diff --git a/source/blender/freestyle/intern/system/StringUtils.cpp b/source/blender/freestyle/intern/system/StringUtils.cpp index 2af76feeb37..1afee94d962 100755 --- a/source/blender/freestyle/intern/system/StringUtils.cpp +++ b/source/blender/freestyle/intern/system/StringUtils.cpp @@ -19,10 +19,14 @@ // /////////////////////////////////////////////////////////////////////////////// -#include <qfileinfo.h> +//soc #include <qfileinfo.h> #include "FreestyleConfig.h" #include "StringUtils.h" +//soc +#include "BKE_utildefines.h" +#include "BLI_blenlib.h" + namespace StringUtils { void getPathName(const string& path, const string& base, vector<string>& pathnames) { @@ -33,12 +37,18 @@ namespace StringUtils { pos < size; pos = sep + 1, sep = path.find(Config::PATH_SEP, pos)) { if (sep == (unsigned)string::npos) - sep = size; + sep = size; dir = path.substr(pos, sep - pos); - QFileInfo fi(dir.c_str()); - string res = (const char*)fi.absoluteFilePath().toAscii(); + +//soc QFileInfo fi(dir.c_str()); +//soc string res = (const char*)fi.absoluteFilePath().toAscii(); + char cleaned[FILE_MAX]; + BLI_strncpy(cleaned, dir.c_str(), FILE_MAX); + BLI_cleanup_file(NULL, cleaned); + string res(cleaned); + if (!base.empty()) - res += Config::DIR_SEP + base; + res += Config::DIR_SEP + base; pathnames.push_back(res); } } |