summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/llcommon/llprocessor.cpp20
-rw-r--r--indra/llcommon/llsafehandle.h10
-rw-r--r--indra/newview/llparcelselection.cpp18
-rw-r--r--indra/newview/llparcelselection.h5
-rw-r--r--indra/newview/llselectmgr.cpp17
-rw-r--r--indra/newview/llselectmgr.h1
-rw-r--r--indra/newview/llviewerparcelmgr.cpp1
7 files changed, 19 insertions, 53 deletions
diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp
index 65b4507e2d..446c312ca9 100644
--- a/indra/llcommon/llprocessor.cpp
+++ b/indra/llcommon/llprocessor.cpp
@@ -26,9 +26,11 @@
#include "linden_common.h"
#include "llprocessor.h"
-
+#include "llstring.h"
+#include "stringize.h"
#include "llerror.h"
+#include <iomanip>
//#include <memory>
#if LL_WINDOWS
@@ -188,7 +190,7 @@ namespace
case 0xF: return "Intel Pentium 4";
case 0x10: return "Intel Itanium 2 (IA-64)";
}
- return "Unknown";
+ return STRINGIZE("Intel <unknown 0x" << std::hex << composed_family << ">");
}
std::string amd_CPUFamilyName(int composed_family)
@@ -201,26 +203,26 @@ namespace
case 0xF: return "AMD K8";
case 0x10: return "AMD K8L";
}
- return "Unknown";
+ return STRINGIZE("AMD <unknown 0x" << std::hex << composed_family << ">");
}
std::string compute_CPUFamilyName(const char* cpu_vendor, int family, int ext_family)
{
const char* intel_string = "GenuineIntel";
const char* amd_string = "AuthenticAMD";
- if(!strncmp(cpu_vendor, intel_string, strlen(intel_string)))
+ if (LLStringUtil::startsWith(cpu_vendor, intel_string))
{
U32 composed_family = family + ext_family;
return intel_CPUFamilyName(composed_family);
}
- else if(!strncmp(cpu_vendor, amd_string, strlen(amd_string)))
+ else if (LLStringUtil::startsWith(cpu_vendor, amd_string))
{
U32 composed_family = (family == 0xF)
? family + ext_family
: family;
return amd_CPUFamilyName(composed_family);
}
- return "Unknown";
+ return STRINGIZE("Unrecognized CPU vendor <" << cpu_vendor << ">");
}
} // end unnamed namespace
@@ -258,8 +260,8 @@ public:
return hasExtension("Altivec");
}
- std::string getCPUFamilyName() const { return getInfo(eFamilyName, "Unknown").asString(); }
- std::string getCPUBrandName() const { return getInfo(eBrandName, "Unknown").asString(); }
+ std::string getCPUFamilyName() const { return getInfo(eFamilyName, "Unset family").asString(); }
+ std::string getCPUBrandName() const { return getInfo(eBrandName, "Unset brand").asString(); }
// This is virtual to support a different linux format.
// *NOTE:Mani - I didn't want to screw up server use of this data...
@@ -271,7 +273,7 @@ public:
out << "//////////////////////////" << std::endl;
out << "Processor Name: " << getCPUBrandName() << std::endl;
out << "Frequency: " << getCPUFrequency() << " MHz" << std::endl;
- out << "Vendor: " << getInfo(eVendor, "Unknown").asString() << std::endl;
+ out << "Vendor: " << getInfo(eVendor, "Unset vendor").asString() << std::endl;
out << "Family: " << getCPUFamilyName() << " (" << getInfo(eFamily, 0) << ")" << std::endl;
out << "Extended family: " << getInfo(eExtendedFamily, 0) << std::endl;
out << "Model: " << getInfo(eModel, 0) << std::endl;
diff --git a/indra/llcommon/llsafehandle.h b/indra/llcommon/llsafehandle.h
index 4226bf04f0..af1c26dd4f 100644
--- a/indra/llcommon/llsafehandle.h
+++ b/indra/llcommon/llsafehandle.h
@@ -112,10 +112,6 @@ public:
return *this;
}
-public:
- typedef Type* (*NullFunc)();
- static const NullFunc sNullFunc;
-
protected:
void ref()
{
@@ -155,6 +151,12 @@ protected:
return ptr == NULL ? sNullFunc() : ptr;
}
+ static Type* sNullFunc()
+ {
+ static Type sInstance;
+ return &sInstance;
+ }
+
protected:
Type* mPointer;
};
diff --git a/indra/newview/llparcelselection.cpp b/indra/newview/llparcelselection.cpp
index 4d1901adc9..5c62159b93 100644
--- a/indra/newview/llparcelselection.cpp
+++ b/indra/newview/llparcelselection.cpp
@@ -31,13 +31,6 @@
#include "llparcel.h"
-// static
-LLPointer<LLParcelSelection> LLParcelSelection::sNullSelection;
-
-template<>
- const LLSafeHandle<LLParcelSelection>::NullFunc
- LLSafeHandle<LLParcelSelection>::sNullFunc = LLParcelSelection::getNullParcelSelection;
-
//
// LLParcelSelection
//
@@ -87,14 +80,3 @@ bool LLParcelSelection::hasOthersSelected() const
{
return mSelectedOtherCount != 0;
}
-
-// static
-LLParcelSelection* LLParcelSelection::getNullParcelSelection()
-{
- if (sNullSelection.isNull())
- {
- sNullSelection = new LLParcelSelection;
- }
-
- return sNullSelection;
-}
diff --git a/indra/newview/llparcelselection.h b/indra/newview/llparcelselection.h
index 1cbdfc6f74..06d9141efb 100644
--- a/indra/newview/llparcelselection.h
+++ b/indra/newview/llparcelselection.h
@@ -35,6 +35,7 @@ class LLParcel;
class LLParcelSelection : public LLRefCount
{
friend class LLViewerParcelMgr;
+ friend class LLSafeHandle<LLParcelSelection>;
protected:
~LLParcelSelection();
@@ -61,8 +62,6 @@ public:
// Is the entire parcel selected, or just a part?
BOOL getWholeParcelSelected() const;
- static LLParcelSelection* getNullParcelSelection();
-
private:
void setParcel(LLParcel* parcel) { mParcel = parcel; }
@@ -73,8 +72,6 @@ private:
S32 mSelectedSelfCount;
S32 mSelectedOtherCount;
S32 mSelectedPublicCount;
-
- static LLPointer<LLParcelSelection> sNullSelection;
};
typedef LLSafeHandle<LLParcelSelection> LLParcelSelectionHandle;
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index ee7c22800a..cbcd905ab6 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -132,11 +132,6 @@ LLColor4 LLSelectMgr::sHighlightParentColor;
LLColor4 LLSelectMgr::sHighlightChildColor;
LLColor4 LLSelectMgr::sContextSilhouetteColor;
-static LLObjectSelection *get_null_object_selection();
-template<>
- const LLSafeHandle<LLObjectSelection>::NullFunc
- LLSafeHandle<LLObjectSelection>::sNullFunc = get_null_object_selection;
-
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// struct LLDeRezInfo
//
@@ -156,27 +151,15 @@ struct LLDeRezInfo
//
-static LLPointer<LLObjectSelection> sNullSelection;
-
//
// Functions
//
void LLSelectMgr::cleanupGlobals()
{
- sNullSelection = NULL;
LLSelectMgr::getInstance()->clearSelections();
}
-LLObjectSelection *get_null_object_selection()
-{
- if (sNullSelection.isNull())
- {
- sNullSelection = new LLObjectSelection;
- }
- return sNullSelection;
-}
-
// Build time optimization, generate this function once here
template class LLSelectMgr* LLSingleton<class LLSelectMgr>::getInstance();
//-----------------------------------------------------------------------------
diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h
index 2a893af266..fbf889b2f1 100644
--- a/indra/newview/llselectmgr.h
+++ b/indra/newview/llselectmgr.h
@@ -233,6 +233,7 @@ protected:
class LLObjectSelection : public LLRefCount
{
friend class LLSelectMgr;
+ friend class LLSafeHandle<LLObjectSelection>;
protected:
~LLObjectSelection();
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp
index 2a126c9f01..325d523992 100644
--- a/indra/newview/llviewerparcelmgr.cpp
+++ b/indra/newview/llviewerparcelmgr.cpp
@@ -2456,7 +2456,6 @@ void sanitize_corners(const LLVector3d &corner1,
void LLViewerParcelMgr::cleanupGlobals()
{
- LLParcelSelection::sNullSelection = NULL;
}
LLViewerTexture* LLViewerParcelMgr::getBlockedImage() const