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:
Diffstat (limited to 'intern/string')
-rw-r--r--intern/string/SConscript2
-rw-r--r--intern/string/STR_String.h14
-rw-r--r--intern/string/intern/STR_String.cpp6
-rw-r--r--intern/string/make/msvc_9_0/string.vcproj1
4 files changed, 20 insertions, 3 deletions
diff --git a/intern/string/SConscript b/intern/string/SConscript
index 8973ac88a66..4aca220183c 100644
--- a/intern/string/SConscript
+++ b/intern/string/SConscript
@@ -4,4 +4,4 @@ Import ('env')
sources = env.Glob('intern/*.cpp')
incs = '.'
-env.BlenderLib ('bf_string', sources, Split(incs), [], libtype=['intern'], priority = [50] )
+env.BlenderLib ('bf_string', sources, Split(incs), [], libtype=['intern','player'], priority = [50,10] )
diff --git a/intern/string/STR_String.h b/intern/string/STR_String.h
index 941430fd976..d8023a06f81 100644
--- a/intern/string/STR_String.h
+++ b/intern/string/STR_String.h
@@ -50,6 +50,13 @@
using namespace std;
+#ifdef WITH_CXX_GUARDEDALLOC
+#include "MEM_guardedalloc.h"
+#endif
+
+#ifdef _WIN32
+#define stricmp _stricmp
+#endif
class STR_String;
@@ -191,6 +198,13 @@ protected:
char *pData; // -> STR_String data
int Len; // Data length
int Max; // Space in data buffer
+
+
+#ifdef WITH_CXX_GUARDEDALLOC
+public:
+ void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "CXX:STR_String"); }
+ void operator delete( void *mem ) { MEM_freeN(mem); }
+#endif
};
inline STR_String operator+(rcSTR_String lhs, rcSTR_String rhs) { return STR_String(lhs.ReadPtr(), lhs.Length(), rhs.ReadPtr(), rhs.Length()); }
diff --git a/intern/string/intern/STR_String.cpp b/intern/string/intern/STR_String.cpp
index dcc52e2a3e7..646b1a853dc 100644
--- a/intern/string/intern/STR_String.cpp
+++ b/intern/string/intern/STR_String.cpp
@@ -559,7 +559,8 @@ STR_String& STR_String::TrimLeft()
{
int skip;
assertd(pData != NULL);
- for (skip=0; isSpace(pData[skip]); skip++, Len--);
+ for (skip=0; isSpace(pData[skip]); skip++, Len--)
+ {};
memmove(pData, pData+skip, Len+1);
return *this;
}
@@ -598,7 +599,8 @@ STR_String& STR_String::TrimLeft(char *set)
{
int skip;
assertd(pData != NULL);
- for (skip=0; Len && strchr(set, pData[skip]); skip++, Len--);
+ for (skip=0; Len && strchr(set, pData[skip]); skip++, Len--)
+ {};
memmove(pData, pData+skip, Len+1);
return *this;
}
diff --git a/intern/string/make/msvc_9_0/string.vcproj b/intern/string/make/msvc_9_0/string.vcproj
index 16df974ff9c..512d67623b6 100644
--- a/intern/string/make/msvc_9_0/string.vcproj
+++ b/intern/string/make/msvc_9_0/string.vcproj
@@ -118,6 +118,7 @@
/>
<Tool
Name="VCCLCompilerTool"
+ Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\.."
PreprocessorDefinitions="WIN32,NDEBUG,_LIB"