aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llcommon
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:02 -0500
committerJacek Antonelli2008-08-15 23:45:02 -0500
commitd644fc64407dcd14ffcee6a0e9fbe28ee3a4e9bd (patch)
tree7ed0c2c27d717801238a2e6b5749cd5bf88c3059 /linden/indra/llcommon
parentSecond Life viewer sources 1.17.3.0 (diff)
downloadmeta-impy-d644fc64407dcd14ffcee6a0e9fbe28ee3a4e9bd.zip
meta-impy-d644fc64407dcd14ffcee6a0e9fbe28ee3a4e9bd.tar.gz
meta-impy-d644fc64407dcd14ffcee6a0e9fbe28ee3a4e9bd.tar.bz2
meta-impy-d644fc64407dcd14ffcee6a0e9fbe28ee3a4e9bd.tar.xz
Second Life viewer sources 1.18.0.6
Diffstat (limited to '')
-rw-r--r--linden/indra/llcommon/lldarray.h19
-rw-r--r--linden/indra/llcommon/llpreprocessor.h22
-rw-r--r--linden/indra/llcommon/llprocessor.cpp8
-rw-r--r--linden/indra/llcommon/llprocessor.h1
-rw-r--r--linden/indra/llcommon/llskiplist.h12
-rw-r--r--linden/indra/llcommon/llstreamtools.h2
-rw-r--r--linden/indra/llcommon/llstring.h4
-rw-r--r--linden/indra/llcommon/llsys.cpp25
-rw-r--r--linden/indra/llcommon/llsys.h12
-rw-r--r--linden/indra/llcommon/llversion.h6
10 files changed, 44 insertions, 67 deletions
diff --git a/linden/indra/llcommon/lldarray.h b/linden/indra/llcommon/lldarray.h
index 291da19..7942e77 100644
--- a/linden/indra/llcommon/lldarray.h
+++ b/linden/indra/llcommon/lldarray.h
@@ -189,16 +189,17 @@ public:
189 189
190 void reset() { mVector.resize(0); mIndexMap.resize(0); } 190 void reset() { mVector.resize(0); mIndexMap.resize(0); }
191 bool empty() const { return mVector.empty(); } 191 bool empty() const { return mVector.empty(); }
192 size_type size() const { return mVector.empty(); } 192 size_type size() const { return mVector.size(); }
193 193
194 Type& operator[](const Key& k) 194 Type& operator[](const Key& k)
195 { 195 {
196 typename std::map<Key, U32>::iterator iter = mIndexMap.find(k); 196 typename std::map<Key, U32>::const_iterator iter = mIndexMap.find(k);
197 if (iter == mIndexMap.end()) 197 if (iter == mIndexMap.end())
198 { 198 {
199 U32 n = mVector.size(); 199 U32 n = mVector.size();
200 mIndexMap[k] = n; 200 mIndexMap[k] = n;
201 mVector.resize(n+1); 201 mVector.resize(n+1);
202 llassert(mVector.size() == mIndexMap.size());
202 return mVector[n]; 203 return mVector[n];
203 } 204 }
204 else 205 else
@@ -206,7 +207,19 @@ public:
206 return mVector[iter->second]; 207 return mVector[iter->second];
207 } 208 }
208 } 209 }
209 210
211 const_iterator find(const Key& k) const
212 {
213 typename std::map<Key, U32>::const_iterator iter = mIndexMap.find(k);
214 if(iter == mIndexMap.end())
215 {
216 return mVector.end();
217 }
218 else
219 {
220 return mVector.begin() + iter->second;
221 }
222 }
210}; 223};
211 224
212#endif 225#endif
diff --git a/linden/indra/llcommon/llpreprocessor.h b/linden/indra/llcommon/llpreprocessor.h
index 76145c5..495b9e8 100644
--- a/linden/indra/llcommon/llpreprocessor.h
+++ b/linden/indra/llcommon/llpreprocessor.h
@@ -71,22 +71,12 @@
71 #define MOZILLA_INTERNAL_API 1 71 #define MOZILLA_INTERNAL_API 1
72#endif 72#endif
73 73
74// Figure out differences between compilers 74// Deal with minor differences on Unixy OSes.
75#if defined(__GNUC__) 75#if LL_DARWIN || LL_LINUX
76 #define GCC_VERSION (__GNUC__ * 10000 \ 76 #define GCC_VERSION (__GNUC__ * 10000 \
77 + __GNUC_MINOR__ * 100 \ 77 + __GNUC_MINOR__ * 100 \
78 + __GNUC_PATCHLEVEL__) 78 + __GNUC_PATCHLEVEL__)
79 #ifndef LL_GNUC
80 #define LL_GNUC 1
81 #endif
82#elif defined(__MSVC_VER__) || defined(_MSC_VER)
83 #ifndef LL_MSVC
84 #define LL_MSVC 1
85 #endif
86#endif
87 79
88// Deal with minor differences on Unixy OSes.
89#if LL_DARWIN || LL_LINUX
90 // Different name, same functionality. 80 // Different name, same functionality.
91 #define stricmp strcasecmp 81 #define stricmp strcasecmp
92 #define strnicmp strncasecmp 82 #define strnicmp strncasecmp
@@ -99,9 +89,9 @@
99#endif 89#endif
100 90
101// Deal with the differeneces on Windows 91// Deal with the differeneces on Windows
102#if LL_MSVC 92#if LL_WINDOWS
103#define snprintf safe_snprintf /* Flawfinder: ignore */ 93#define snprintf safe_snprintf /* Flawfinder: ignore */
104#endif // LL_MSVC 94#endif // LL_WINDOWS
105 95
106// Static linking with apr on windows needs to be declared. 96// Static linking with apr on windows needs to be declared.
107#ifdef LL_WINDOWS 97#ifdef LL_WINDOWS
@@ -120,7 +110,7 @@
120 110
121 111
122// Deal with VC6 problems 112// Deal with VC6 problems
123#if LL_MSVC 113#if defined(LL_WINDOWS)
124#pragma warning( 3 : 4701 ) // "local variable used without being initialized" Treat this as level 3, not level 4. 114#pragma warning( 3 : 4701 ) // "local variable used without being initialized" Treat this as level 3, not level 4.
125#pragma warning( 3 : 4702 ) // "unreachable code" Treat this as level 3, not level 4. 115#pragma warning( 3 : 4702 ) // "unreachable code" Treat this as level 3, not level 4.
126#pragma warning( 3 : 4189 ) // "local variable initialized but not referenced" Treat this as level 3, not level 4. 116#pragma warning( 3 : 4189 ) // "local variable initialized but not referenced" Treat this as level 3, not level 4.
@@ -131,6 +121,6 @@
131#pragma warning( disable : 4503 ) // 'decorated name length exceeded, name was truncated'. Does not seem to affect compilation. 121#pragma warning( disable : 4503 ) // 'decorated name length exceeded, name was truncated'. Does not seem to affect compilation.
132#pragma warning( disable : 4800 ) // 'BOOL' : forcing value to bool 'true' or 'false' (performance warning) 122#pragma warning( disable : 4800 ) // 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
133#pragma warning( disable : 4996 ) // warning: deprecated 123#pragma warning( disable : 4996 ) // warning: deprecated
134#endif // LL_MSVC 124#endif // LL_WINDOWS
135 125
136#endif // not LL_LINDEN_PREPROCESSOR_H 126#endif // not LL_LINDEN_PREPROCESSOR_H
diff --git a/linden/indra/llcommon/llprocessor.cpp b/linden/indra/llcommon/llprocessor.cpp
index e76294d..bd21351 100644
--- a/linden/indra/llcommon/llprocessor.cpp
+++ b/linden/indra/llcommon/llprocessor.cpp
@@ -1538,7 +1538,6 @@ void CProcessor::GetStandardProcessorExtensions()
1538 CPUInfo._Ext.FXSR_FastStreamingSIMD_ExtensionsSaveRestore = CheckBit(edxreg, 24); 1538 CPUInfo._Ext.FXSR_FastStreamingSIMD_ExtensionsSaveRestore = CheckBit(edxreg, 24);
1539 CPUInfo._Ext.SSE_StreamingSIMD_Extensions = CheckBit(edxreg, 25); 1539 CPUInfo._Ext.SSE_StreamingSIMD_Extensions = CheckBit(edxreg, 25);
1540 CPUInfo._Ext.SSE2_StreamingSIMD2_Extensions = CheckBit(edxreg, 26); 1540 CPUInfo._Ext.SSE2_StreamingSIMD2_Extensions = CheckBit(edxreg, 26);
1541 CPUInfo._Ext.Altivec_Extensions = false;
1542 CPUInfo._Ext.SS_SelfSnoop = CheckBit(edxreg, 27); 1541 CPUInfo._Ext.SS_SelfSnoop = CheckBit(edxreg, 27);
1543 CPUInfo._Ext.HT_HyperThreading = CheckBit(edxreg, 28); 1542 CPUInfo._Ext.HT_HyperThreading = CheckBit(edxreg, 28);
1544 CPUInfo._Ext.HT_HyterThreadingSiblings = (ebxreg >> 16) & 0xFF; 1543 CPUInfo._Ext.HT_HyterThreadingSiblings = (ebxreg >> 16) & 0xFF;
@@ -1892,12 +1891,11 @@ const ProcessorInfo *CProcessor::GetCPUInfo()
1892 break; 1891 break;
1893 } 1892 }
1894 1893
1894 // It's kinda like MMX or SSE...
1895 CPUInfo._Ext.EMMX_MultimediaExtensions = 1895 CPUInfo._Ext.EMMX_MultimediaExtensions =
1896 CPUInfo._Ext.MMX_MultimediaExtensions = 1896 CPUInfo._Ext.MMX_MultimediaExtensions =
1897 CPUInfo._Ext.SSE_StreamingSIMD_Extensions = 1897 CPUInfo._Ext.SSE_StreamingSIMD_Extensions =
1898 CPUInfo._Ext.SSE2_StreamingSIMD2_Extensions = false; 1898 CPUInfo._Ext.SSE2_StreamingSIMD2_Extensions = hasFeature("hw.optional.altivec");
1899
1900 CPUInfo._Ext.Altivec_Extensions = hasFeature("hw.optional.altivec");
1901 1899
1902#endif 1900#endif
1903 1901
@@ -1914,7 +1912,6 @@ const ProcessorInfo *CProcessor::GetCPUInfo()
1914 CPUInfo._Ext.MMX_MultimediaExtensions = hasFeature("hw.optional.mmx"); 1912 CPUInfo._Ext.MMX_MultimediaExtensions = hasFeature("hw.optional.mmx");
1915 CPUInfo._Ext.SSE_StreamingSIMD_Extensions = hasFeature("hw.optional.sse"); 1913 CPUInfo._Ext.SSE_StreamingSIMD_Extensions = hasFeature("hw.optional.sse");
1916 CPUInfo._Ext.SSE2_StreamingSIMD2_Extensions = hasFeature("hw.optional.sse2"); 1914 CPUInfo._Ext.SSE2_StreamingSIMD2_Extensions = hasFeature("hw.optional.sse2");
1917 CPUInfo._Ext.Altivec_Extensions = false;
1918 CPUInfo._Ext.AA64_AMD64BitArchitecture = hasFeature("hw.optional.x86_64"); 1915 CPUInfo._Ext.AA64_AMD64BitArchitecture = hasFeature("hw.optional.x86_64");
1919 1916
1920#endif 1917#endif
@@ -2068,7 +2065,6 @@ bool CProcessor::CPUInfoToText(char *strBuffer, unsigned int uiMaxLen)
2068 BOOLADD("SS Self Snoop: ", CPUInfo._Ext.SS_SelfSnoop); 2065 BOOLADD("SS Self Snoop: ", CPUInfo._Ext.SS_SelfSnoop);
2069 BOOLADD("SSE Streaming SIMD Extensions: ", CPUInfo._Ext.SSE_StreamingSIMD_Extensions); 2066 BOOLADD("SSE Streaming SIMD Extensions: ", CPUInfo._Ext.SSE_StreamingSIMD_Extensions);
2070 BOOLADD("SSE2 Streaming SIMD 2 Extensions: ", CPUInfo._Ext.SSE2_StreamingSIMD2_Extensions); 2067 BOOLADD("SSE2 Streaming SIMD 2 Extensions: ", CPUInfo._Ext.SSE2_StreamingSIMD2_Extensions);
2071 BOOLADD("ALTVEC Altivec Extensions: ", CPUInfo._Ext.Altivec_Extensions);
2072 BOOLADD("TM Thermal Monitor: ", CPUInfo._Ext.TM_ThermalMonitor); 2068 BOOLADD("TM Thermal Monitor: ", CPUInfo._Ext.TM_ThermalMonitor);
2073 BOOLADD("TSC Time Stamp Counter: ", CPUInfo._Ext.TSC_TimeStampCounter); 2069 BOOLADD("TSC Time Stamp Counter: ", CPUInfo._Ext.TSC_TimeStampCounter);
2074 BOOLADD("VME Virtual 8086 Mode Enhancements: ", CPUInfo._Ext.VME_Virtual8086ModeEnhancements); 2070 BOOLADD("VME Virtual 8086 Mode Enhancements: ", CPUInfo._Ext.VME_Virtual8086ModeEnhancements);
diff --git a/linden/indra/llcommon/llprocessor.h b/linden/indra/llcommon/llprocessor.h
index 6db9328..fd9a5da 100644
--- a/linden/indra/llcommon/llprocessor.h
+++ b/linden/indra/llcommon/llprocessor.h
@@ -71,7 +71,6 @@ typedef struct ProcessorExtensions
71 bool FXSR_FastStreamingSIMD_ExtensionsSaveRestore; 71 bool FXSR_FastStreamingSIMD_ExtensionsSaveRestore;
72 bool SSE_StreamingSIMD_Extensions; 72 bool SSE_StreamingSIMD_Extensions;
73 bool SSE2_StreamingSIMD2_Extensions; 73 bool SSE2_StreamingSIMD2_Extensions;
74 bool Altivec_Extensions;
75 bool SS_SelfSnoop; 74 bool SS_SelfSnoop;
76 bool HT_HyperThreading; 75 bool HT_HyperThreading;
77 unsigned int HT_HyterThreadingSiblings; 76 unsigned int HT_HyterThreadingSiblings;
diff --git a/linden/indra/llcommon/llskiplist.h b/linden/indra/llcommon/llskiplist.h
index 40d0c8a..be3385d 100644
--- a/linden/indra/llcommon/llskiplist.h
+++ b/linden/indra/llcommon/llskiplist.h
@@ -28,10 +28,11 @@
28#ifndef LL_LLSKIPLIST_H 28#ifndef LL_LLSKIPLIST_H
29#define LL_LLSKIPLIST_H 29#define LL_LLSKIPLIST_H
30 30
31#include "llrand.h" 31#include "llerror.h"
32//#include "vmath.h"
32 33
33// NOTA BENE: Insert first needs to be < NOT <= 34// NOTA BENE: Insert first needs to be < NOT <=
34// Binary depth must be >= 2 35
35template <class DATA_TYPE, S32 BINARY_DEPTH = 10> 36template <class DATA_TYPE, S32 BINARY_DEPTH = 10>
36class LLSkipList 37class LLSkipList
37{ 38{
@@ -143,11 +144,14 @@ private:
143// Implementation 144// Implementation
144// 145//
145 146
146
147// Binary depth must be >= 2
148template <class DATA_TYPE, S32 BINARY_DEPTH> 147template <class DATA_TYPE, S32 BINARY_DEPTH>
149inline void LLSkipList<DATA_TYPE, BINARY_DEPTH>::init() 148inline void LLSkipList<DATA_TYPE, BINARY_DEPTH>::init()
150{ 149{
150 if (BINARY_DEPTH < 2)
151 {
152 llerrs << "Trying to create skip list with too little depth, "
153 "must be 2 or greater" << llendl;
154 }
151 S32 i; 155 S32 i;
152 for (i = 0; i < BINARY_DEPTH; i++) 156 for (i = 0; i < BINARY_DEPTH; i++)
153 { 157 {
diff --git a/linden/indra/llcommon/llstreamtools.h b/linden/indra/llcommon/llstreamtools.h
index c339dde..d64bd57 100644
--- a/linden/indra/llcommon/llstreamtools.h
+++ b/linden/indra/llcommon/llstreamtools.h
@@ -60,11 +60,13 @@ bool skip_to_end_of_next_keyword(const char* keyword, std::istream& input_stream
60//bool skip_to_start_of_next_keyword(const char* keyword, std::istream& input_stream); 60//bool skip_to_start_of_next_keyword(const char* keyword, std::istream& input_stream);
61 61
62// characters are pulled out of input_stream and appended to output_string 62// characters are pulled out of input_stream and appended to output_string
63// returns result of input_stream.good() after characters are pulled
63bool get_word(std::string& output_string, std::istream& input_stream); 64bool get_word(std::string& output_string, std::istream& input_stream);
64bool get_line(std::string& output_string, std::istream& input_stream); 65bool get_line(std::string& output_string, std::istream& input_stream);
65 66
66// characters are pulled out of input_stream (up to a max of 'n') 67// characters are pulled out of input_stream (up to a max of 'n')
67// and appended to output_string 68// and appended to output_string
69// returns result of input_stream.good() after characters are pulled
68bool get_word(std::string& output_string, std::istream& input_stream, int n); 70bool get_word(std::string& output_string, std::istream& input_stream, int n);
69bool get_line(std::string& output_string, std::istream& input_stream, int n); 71bool get_line(std::string& output_string, std::istream& input_stream, int n);
70 72
diff --git a/linden/indra/llcommon/llstring.h b/linden/indra/llcommon/llstring.h
index a24f944..adfdfb8 100644
--- a/linden/indra/llcommon/llstring.h
+++ b/linden/indra/llcommon/llstring.h
@@ -1074,9 +1074,6 @@ BOOL LLStringBase<T>::isHead( const std::basic_string<T>& string, const T* s )
1074template<class T> 1074template<class T>
1075BOOL LLStringBase<T>::read(std::basic_string<T>& string, const char* filename) /*Flawfinder: ignore*/ 1075BOOL LLStringBase<T>::read(std::basic_string<T>& string, const char* filename) /*Flawfinder: ignore*/
1076{ 1076{
1077#ifdef LL_LINUX
1078 printf("STUBBED: LLStringBase<T>::read at %s:%d\n", __FILE__, __LINE__);
1079#else
1080 llifstream ifs(filename, llifstream::binary); 1077 llifstream ifs(filename, llifstream::binary);
1081 if (!ifs.is_open()) 1078 if (!ifs.is_open())
1082 { 1079 {
@@ -1091,7 +1088,6 @@ BOOL LLStringBase<T>::read(std::basic_string<T>& string, const char* filename)
1091 string = oss.str(); 1088 string = oss.str();
1092 1089
1093 ifs.close(); 1090 ifs.close();
1094#endif
1095 return TRUE; 1091 return TRUE;
1096} 1092}
1097 1093
diff --git a/linden/indra/llcommon/llsys.cpp b/linden/indra/llcommon/llsys.cpp
index 33e5cda..48f2474 100644
--- a/linden/indra/llcommon/llsys.cpp
+++ b/linden/indra/llcommon/llsys.cpp
@@ -304,33 +304,12 @@ LLCPUInfo::LLCPUInfo()
304{ 304{
305 CProcessor proc; 305 CProcessor proc;
306 const ProcessorInfo* info = proc.GetCPUInfo(); 306 const ProcessorInfo* info = proc.GetCPUInfo();
307 // proc.WriteInfoTextFile("procInfo.txt"); 307 mHasSSE = (info->_Ext.SSE_StreamingSIMD_Extensions != 0);
308 mHasSSE = info->_Ext.SSE_StreamingSIMD_Extensions; 308 mHasSSE2 = (info->_Ext.SSE2_StreamingSIMD2_Extensions != 0);
309 mHasSSE2 = info->_Ext.SSE2_StreamingSIMD2_Extensions;
310 mHasAltivec = info->_Ext.Altivec_Extensions;
311 mCPUMhz = (S32)(proc.GetCPUFrequency(50)/1000000.0); 309 mCPUMhz = (S32)(proc.GetCPUFrequency(50)/1000000.0);
312 mFamily.assign( info->strFamily ); 310 mFamily.assign( info->strFamily );
313} 311}
314 312
315bool LLCPUInfo::hasAltivec() const
316{
317 return mHasAltivec;
318}
319
320bool LLCPUInfo::hasSSE() const
321{
322 return mHasSSE;
323}
324
325bool LLCPUInfo::hasSSE2() const
326{
327 return mHasSSE2;
328}
329
330S32 LLCPUInfo::getMhz() const
331{
332 return mCPUMhz;
333}
334 313
335std::string LLCPUInfo::getCPUString() const 314std::string LLCPUInfo::getCPUString() const
336{ 315{
diff --git a/linden/indra/llcommon/llsys.h b/linden/indra/llcommon/llsys.h
index 83ea081..2047d9a 100644
--- a/linden/indra/llcommon/llsys.h
+++ b/linden/indra/llcommon/llsys.h
@@ -72,18 +72,16 @@ public:
72 72
73 std::string getCPUString() const; 73 std::string getCPUString() const;
74 74
75 bool hasAltivec() const; 75 BOOL hasSSE() const { return mHasSSE; }
76 bool hasSSE() const; 76 BOOL hasSSE2() const { return mHasSSE2; }
77 bool hasSSE2() const; 77 S32 getMhz() const { return mCPUMhz; }
78 S32 getMhz() const;
79 78
80 // Family is "AMD Duron" or "Intel Pentium Pro" 79 // Family is "AMD Duron" or "Intel Pentium Pro"
81 const std::string& getFamily() const { return mFamily; } 80 const std::string& getFamily() const { return mFamily; }
82 81
83private: 82private:
84 bool mHasSSE; 83 BOOL mHasSSE;
85 bool mHasSSE2; 84 BOOL mHasSSE2;
86 bool mHasAltivec;
87 S32 mCPUMhz; 85 S32 mCPUMhz;
88 std::string mFamily; 86 std::string mFamily;
89}; 87};
diff --git a/linden/indra/llcommon/llversion.h b/linden/indra/llcommon/llversion.h
index eb8310e..9739d04 100644
--- a/linden/indra/llcommon/llversion.h
+++ b/linden/indra/llcommon/llversion.h
@@ -30,8 +30,8 @@
30#define LL_LLVERSION_H 30#define LL_LLVERSION_H
31 31
32const S32 LL_VERSION_MAJOR = 1; 32const S32 LL_VERSION_MAJOR = 1;
33const S32 LL_VERSION_MINOR = 17; 33const S32 LL_VERSION_MINOR = 18;
34const S32 LL_VERSION_PATCH = 3; 34const S32 LL_VERSION_PATCH = 0;
35const S32 LL_VERSION_BUILD = 0; 35const S32 LL_VERSION_BUILD = 6;
36 36
37#endif 37#endif