diff --git a/indra/lib/python/indra/base/llsd.py b/indra/lib/python/indra/base/llsd.py
index 0faf4df57fcafac586b2a564cc2eeae2c59e5cef..9561a56710e39f8347afbf42b0a49fbbdca877cc 100644
--- a/indra/lib/python/indra/base/llsd.py
+++ b/indra/lib/python/indra/base/llsd.py
@@ -240,8 +240,12 @@ class LLSDXMLFormatter(object):
     def format(self, something):
         return '<?xml version="1.0" ?>' + self.elt("llsd", self.generate(something))
 
+_g_xml_formatter = None
 def format_xml(something):
-    return LLSDXMLFormatter().format(something)
+    global _g_xml_formatter
+    if _g_xml_formatter is None:
+        _g_xml_formatter = LLSDXMLFormatter()
+    return _g_xml_formatter.format(something)
 
 class LLSDNotationFormatter(object):
     def __init__(self):
diff --git a/indra/lib/python/indra/util/term.py b/indra/lib/python/indra/util/term.py
new file mode 100644
index 0000000000000000000000000000000000000000..1f9dd550919c5edc78ca4b242b16b094ed127d56
--- /dev/null
+++ b/indra/lib/python/indra/util/term.py
@@ -0,0 +1,222 @@
+'''
+@file term.py
+@brief a better shutil.copytree replacement
+
+$LicenseInfo:firstyear=2007&license=mit$
+
+Copyright (c) 2007, Linden Research, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+    The above copyright notice and this permission notice shall be included in
+    all copies or substantial portions of the Software.
+
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+    THE SOFTWARE.
+    $/LicenseInfo$
+'''
+
+#http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/475116
+
+import sys, re
+
+class TerminalController:
+    """
+    A class that can be used to portably generate formatted output to
+    a terminal.  
+    
+    `TerminalController` defines a set of instance variables whose
+    values are initialized to the control sequence necessary to
+    perform a given action.  These can be simply included in normal
+    output to the terminal:
+
+        >>> term = TerminalController()
+        >>> print 'This is '+term.GREEN+'green'+term.NORMAL
+
+    Alternatively, the `render()` method can used, which replaces
+    '${action}' with the string required to perform 'action':
+
+        >>> term = TerminalController()
+        >>> print term.render('This is ${GREEN}green${NORMAL}')
+
+    If the terminal doesn't support a given action, then the value of
+    the corresponding instance variable will be set to ''.  As a
+    result, the above code will still work on terminals that do not
+    support color, except that their output will not be colored.
+    Also, this means that you can test whether the terminal supports a
+    given action by simply testing the truth value of the
+    corresponding instance variable:
+
+        >>> term = TerminalController()
+        >>> if term.CLEAR_SCREEN:
+        ...     print 'This terminal supports clearning the screen.'
+
+    Finally, if the width and height of the terminal are known, then
+    they will be stored in the `COLS` and `LINES` attributes.
+    """
+    # Cursor movement:
+    BOL = ''             #: Move the cursor to the beginning of the line
+    UP = ''              #: Move the cursor up one line
+    DOWN = ''            #: Move the cursor down one line
+    LEFT = ''            #: Move the cursor left one char
+    RIGHT = ''           #: Move the cursor right one char
+
+    # Deletion:
+    CLEAR_SCREEN = ''    #: Clear the screen and move to home position
+    CLEAR_EOL = ''       #: Clear to the end of the line.
+    CLEAR_BOL = ''       #: Clear to the beginning of the line.
+    CLEAR_EOS = ''       #: Clear to the end of the screen
+
+    # Output modes:
+    BOLD = ''            #: Turn on bold mode
+    BLINK = ''           #: Turn on blink mode
+    DIM = ''             #: Turn on half-bright mode
+    REVERSE = ''         #: Turn on reverse-video mode
+    NORMAL = ''          #: Turn off all modes
+
+    # Cursor display:
+    HIDE_CURSOR = ''     #: Make the cursor invisible
+    SHOW_CURSOR = ''     #: Make the cursor visible
+
+    # Terminal size:
+    COLS = None          #: Width of the terminal (None for unknown)
+    LINES = None         #: Height of the terminal (None for unknown)
+
+    # Foreground colors:
+    BLACK = BLUE = GREEN = CYAN = RED = MAGENTA = YELLOW = WHITE = ''
+    
+    # Background colors:
+    BG_BLACK = BG_BLUE = BG_GREEN = BG_CYAN = ''
+    BG_RED = BG_MAGENTA = BG_YELLOW = BG_WHITE = ''
+    
+    _STRING_CAPABILITIES = """
+    BOL=cr UP=cuu1 DOWN=cud1 LEFT=cub1 RIGHT=cuf1
+    CLEAR_SCREEN=clear CLEAR_EOL=el CLEAR_BOL=el1 CLEAR_EOS=ed BOLD=bold
+    BLINK=blink DIM=dim REVERSE=rev UNDERLINE=smul NORMAL=sgr0
+    HIDE_CURSOR=cinvis SHOW_CURSOR=cnorm""".split()
+    _COLORS = """BLACK BLUE GREEN CYAN RED MAGENTA YELLOW WHITE""".split()
+    _ANSICOLORS = "BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE".split()
+
+    def __init__(self, term_stream=sys.stdout):
+        """
+        Create a `TerminalController` and initialize its attributes
+        with appropriate values for the current terminal.
+        `term_stream` is the stream that will be used for terminal
+        output; if this stream is not a tty, then the terminal is
+        assumed to be a dumb terminal (i.e., have no capabilities).
+        """
+        # Curses isn't available on all platforms
+        try: import curses
+        except: return
+
+        # If the stream isn't a tty, then assume it has no capabilities.
+        if not term_stream.isatty(): return
+
+        # Check the terminal type.  If we fail, then assume that the
+        # terminal has no capabilities.
+        try: curses.setupterm()
+        except: return
+
+        # Look up numeric capabilities.
+        self.COLS = curses.tigetnum('cols')
+        self.LINES = curses.tigetnum('lines')
+        
+        # Look up string capabilities.
+        for capability in self._STRING_CAPABILITIES:
+            (attrib, cap_name) = capability.split('=')
+            setattr(self, attrib, self._tigetstr(cap_name) or '')
+
+        # Colors
+        set_fg = self._tigetstr('setf')
+        if set_fg:
+            for i,color in zip(range(len(self._COLORS)), self._COLORS):
+                setattr(self, color, curses.tparm(set_fg, i) or '')
+        set_fg_ansi = self._tigetstr('setaf')
+        if set_fg_ansi:
+            for i,color in zip(range(len(self._ANSICOLORS)), self._ANSICOLORS):
+                setattr(self, color, curses.tparm(set_fg_ansi, i) or '')
+        set_bg = self._tigetstr('setb')
+        if set_bg:
+            for i,color in zip(range(len(self._COLORS)), self._COLORS):
+                setattr(self, 'BG_'+color, curses.tparm(set_bg, i) or '')
+        set_bg_ansi = self._tigetstr('setab')
+        if set_bg_ansi:
+            for i,color in zip(range(len(self._ANSICOLORS)), self._ANSICOLORS):
+                setattr(self, 'BG_'+color, curses.tparm(set_bg_ansi, i) or '')
+
+    def _tigetstr(self, cap_name):
+        # String capabilities can include "delays" of the form "$<2>".
+        # For any modern terminal, we should be able to just ignore
+        # these, so strip them out.
+        import curses
+        cap = curses.tigetstr(cap_name) or ''
+        return re.sub(r'\$<\d+>[/*]?', '', cap)
+
+    def render(self, template):
+        """
+        Replace each $-substitutions in the given template string with
+        the corresponding terminal control string (if it's defined) or
+        '' (if it's not).
+        """
+        return re.sub(r'\$\$|\${\w+}', self._render_sub, template)
+
+    def _render_sub(self, match):
+        s = match.group()
+        if s == '$$': return s
+        else: return getattr(self, s[2:-1])
+
+#######################################################################
+# Example use case: progress bar
+#######################################################################
+
+class ProgressBar:
+    """
+    A 3-line progress bar, which looks like::
+    
+                                Header
+        20% [===========----------------------------------]
+                           progress message
+
+    The progress bar is colored, if the terminal supports color
+    output; and adjusts to the width of the terminal.
+    """
+    BAR = '%3d%% ${GREEN}[${BOLD}%s%s${NORMAL}${GREEN}]${NORMAL}\n'
+    HEADER = '${BOLD}${CYAN}%s${NORMAL}\n\n'
+        
+    def __init__(self, term, header):
+        self.term = term
+        if not (self.term.CLEAR_EOL and self.term.UP and self.term.BOL):
+            raise ValueError("Terminal isn't capable enough -- you "
+                             "should use a simpler progress dispaly.")
+        self.width = self.term.COLS or 75
+        self.bar = term.render(self.BAR)
+        self.header = self.term.render(self.HEADER % header.center(self.width))
+        self.cleared = 1 #: true if we haven't drawn the bar yet.
+        self.update(0, '')
+
+    def update(self, percent, message):
+        if self.cleared:
+            sys.stdout.write(self.header)
+            self.cleared = 0
+        n = int((self.width-10)*percent)
+        sys.stdout.write(
+            self.term.BOL + self.term.UP + self.term.CLEAR_EOL +
+            (self.bar % (100*percent, '='*n, '-'*(self.width-10-n))) +
+            self.term.CLEAR_EOL + message.center(self.width))
+
+    def clear(self):
+        if not self.cleared:
+            sys.stdout.write(self.term.BOL + self.term.CLEAR_EOL +
+                             self.term.UP + self.term.CLEAR_EOL +
+                             self.term.UP + self.term.CLEAR_EOL)
+            self.cleared = 1
diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp
index 91d96904bafff31cfe8c89fd445c41d22adc733e..ce59349d554dc5e8ac7adfdef7a9018e0467db1b 100644
--- a/indra/llcharacter/llkeyframemotion.cpp
+++ b/indra/llcharacter/llkeyframemotion.cpp
@@ -71,6 +71,15 @@ static F32 MAX_CONSTRAINTS = 10;
 // JointMotionList
 //-----------------------------------------------------------------------------
 LLKeyframeMotion::JointMotionList::JointMotionList()
+	: mDuration(0.f),
+	  mLoop(FALSE),
+	  mLoopInPoint(0.f),
+	  mLoopOutPoint(0.f),
+	  mEaseInDuration(0.f),
+	  mEaseOutDuration(0.f),
+	  mBasePriority(LLJoint::LOW_PRIORITY),
+	  mHandPose(LLHandMotion::HAND_POSE_SPREAD),
+	  mMaxPriority(LLJoint::LOW_PRIORITY)
 {
 }
 
@@ -2116,11 +2125,19 @@ void LLKeyframeDataCache::clear()
 //-----------------------------------------------------------------------------
 LLKeyframeMotion::JointConstraint::JointConstraint(JointConstraintSharedData* shared_data) : mSharedData(shared_data) 
 {
+	mWeight = 0.f;
 	mTotalLength = 0.f;
 	mActive = FALSE;
 	mSourceVolume = NULL;
 	mTargetVolume = NULL;
 	mFixupDistanceRMS = 0.f;
+
+	int i;
+	for (i=0; i<MAX_CHAIN_LENGTH; ++i)
+	{
+		mJointLengths[i] = 0.f;
+		mJointLengthFractions[i] = 0.f;
+	}
 }
 
 //-----------------------------------------------------------------------------
diff --git a/indra/llcharacter/llkeyframemotion.h b/indra/llcharacter/llkeyframemotion.h
index c383e5e99e555c1d961c45653222bdf349451a13..a50447c3bfe42aa58a5bf13501874f87a7631c75 100644
--- a/indra/llcharacter/llkeyframemotion.h
+++ b/indra/llcharacter/llkeyframemotion.h
@@ -224,7 +224,11 @@ protected:
 			mEaseOutStopTime(0.f), 
 			mUseTargetOffset(FALSE),
 			mConstraintType(TYPE_POINT),
-			mConstraintTargetType(TYPE_BODY) {};
+			mConstraintTargetType(TYPE_BODY),
+			mSourceConstraintVolume(0),
+			mTargetConstraintVolume(0),
+			mJointStateIndices(NULL)
+		{ };
 		~JointConstraintSharedData() { delete [] mJointStateIndices; }
 
 		S32						mSourceConstraintVolume;
diff --git a/indra/llcharacter/llkeyframewalkmotion.cpp b/indra/llcharacter/llkeyframewalkmotion.cpp
index 0d7e34bb4f3c40dca4ad1175dc0797456db4ff6a..471acd8ac3b0ec55d8842764d45a07dc84b7931e 100644
--- a/indra/llcharacter/llkeyframewalkmotion.cpp
+++ b/indra/llcharacter/llkeyframewalkmotion.cpp
@@ -139,9 +139,16 @@ BOOL LLKeyframeWalkMotion::onUpdate(F32 time, U8* joint_mask)
 // LLWalkAdjustMotion()
 // Class Constructor
 //-----------------------------------------------------------------------------
-LLWalkAdjustMotion::LLWalkAdjustMotion(const LLUUID &id) : LLMotion(id)
+LLWalkAdjustMotion::LLWalkAdjustMotion(const LLUUID &id) :
+	LLMotion(id),
+	mLastTime(0.f),
+	mAvgCorrection(0.f),
+	mSpeedAdjust(0.f),
+	mAnimSpeed(0.f),
+	mAvgSpeed(0.f),
+	mRelativeDir(0.f),
+	mAnkleOffset(0.f)
 {
-	mLastTime = 0.f;
 	mName = "walk_adjust";
 
 	mPelvisState = new LLJointState;
@@ -349,7 +356,8 @@ void LLWalkAdjustMotion::onDeactivate()
 // LLFlyAdjustMotion::LLFlyAdjustMotion()
 //-----------------------------------------------------------------------------
 LLFlyAdjustMotion::LLFlyAdjustMotion(const LLUUID &id)
-	: LLMotion(id)
+	: LLMotion(id),
+	  mRoll(0.f)
 {
 	mName = "fly_adjust";
 
diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp
index fff19dbefe11ffc8d29d6352c69da2aec79d5c8b..5bcae5e63584d90f2e442e0307b0e056ccebee24 100644
--- a/indra/llcharacter/llmotioncontroller.cpp
+++ b/indra/llcharacter/llmotioncontroller.cpp
@@ -155,18 +155,19 @@ LLMotion *LLMotionRegistry::createMotion( const LLUUID &id )
 // LLMotionController()
 // Class Constructor
 //-----------------------------------------------------------------------------
-LLMotionController::LLMotionController(  )
-{
-	mTime = 0.f;
-	mTimeOffset = 0.f;
-	mLastTime = 0.0f;
-	mHasRunOnce = FALSE;
-	mPaused = FALSE;
-	mPauseTime = 0.f;
-	mTimeStep = 0.f;
-	mTimeStepCount = 0;
-	mLastInterp = 0.f;
-	mTimeFactor = 1.f;
+LLMotionController::LLMotionController()
+	: mTimeFactor(1.f),
+	  mCharacter(NULL),
+	  mTime(0.f),
+	  mTimeOffset(0.f),
+	  mLastTime(0.0f),
+	  mHasRunOnce(FALSE),
+	  mPaused(FALSE),
+	  mPauseTime(0.f),
+	  mTimeStep(0.f),
+	  mTimeStepCount(0),
+	  mLastInterp(0.f)
+{
 }
 
 
diff --git a/indra/llcharacter/llmotioncontroller.h b/indra/llcharacter/llmotioncontroller.h
index effea0940a54092ce8ec993b465e04539d7446ba..c6749c5c369a4b8e5ea2cf8ee26f1748911ae0d4 100644
--- a/indra/llcharacter/llmotioncontroller.h
+++ b/indra/llcharacter/llmotioncontroller.h
@@ -227,10 +227,10 @@ protected:
 	F32					mLastTime;
 	BOOL				mHasRunOnce;
 	BOOL				mPaused;
+	F32					mPauseTime;
 	F32					mTimeStep;
 	S32					mTimeStepCount;
 	F32					mLastInterp;
-	F32					mPauseTime;
 
 	U8					mJointSignature[2][LL_CHARACTER_MAX_JOINTS];
 };
diff --git a/indra/llcharacter/llpose.cpp b/indra/llcharacter/llpose.cpp
index 2120cb223ebf2aed3b4a1878d0a36884d4b84e43..c57fbfdc5dfd549645116e5be1f4ca95fa4ec723 100644
--- a/indra/llcharacter/llpose.cpp
+++ b/indra/llcharacter/llpose.cpp
@@ -188,6 +188,7 @@ LLJointStateBlender::LLJointStateBlender()
 	{
 		mJointStates[i] = NULL;
 		mPriorities[i] = S32_MIN;
+		mAdditiveBlends[i] = FALSE;
 	}
 }
 
@@ -458,6 +459,7 @@ void LLJointStateBlender::resetCachedJoint()
 //-----------------------------------------------------------------------------
 
 LLPoseBlender::LLPoseBlender()
+	: mNextPoseSlot(0)
 {
 }
 
diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp
index d034334aab9bc6d9427cff4c211b12bf11cf9dcc..2c7c7e38a4885fd61b6e3ef347af75cf54f2edfc 100644
--- a/indra/llcommon/llapp.cpp
+++ b/indra/llcommon/llapp.cpp
@@ -492,6 +492,7 @@ void LLApp::setDefaultChildCallback(LLAppChildCallback callback)
 
 pid_t LLApp::fork()
 {
+	fflush(NULL); // flush all buffers before the child inherits them
 	pid_t pid = ::fork();
 	if( pid < 0 )
 	{
diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp
index e635011941b5d88e626e6986fe05bd3963bd4852..95038bea4c3a916f6532365c40a026bd32e0cadb 100644
--- a/indra/llcommon/llerror.cpp
+++ b/indra/llcommon/llerror.cpp
@@ -1040,18 +1040,15 @@ namespace LLError
 					<< "(" << site.mLine << ") : ";
 		}
 		
-		if (message.find(functionName(site.mFunction)) == std::string::npos)
-		{
 	#if LL_WINDOWS
-			// DevStudio: __FUNCTION__ already includes the full class name
+		// DevStudio: __FUNCTION__ already includes the full class name
 	#else
-			if (site.mClassInfo != typeid(NoClassInfo))
-			{
-				prefix << className(site.mClassInfo) << "::";
-			}
-	#endif
-			prefix << site.mFunction << ": ";
+		if (site.mClassInfo != typeid(NoClassInfo))
+		{
+			prefix << className(site.mClassInfo) << "::";
 		}
+	#endif
+		prefix << site.mFunction << ": ";
 
 		if (site.mPrintOnce)
 		{
diff --git a/indra/llcommon/lllslconstants.h b/indra/llcommon/lllslconstants.h
index e4c83582ce0411ca3ba45b5b840084a1d605ce4e..12467e4e6396adc601adb57c294208f5e7243dc2 100644
--- a/indra/llcommon/lllslconstants.h
+++ b/indra/llcommon/lllslconstants.h
@@ -181,4 +181,7 @@ const S32 OBJECT_OWNER = 6;
 const S32 OBJECT_GROUP = 7;
 const S32 OBJECT_CREATOR = 8;
 
+// llTextBox() magic token string - yes this is a hack.  sue me.
+const std::string TEXTBOX_MAGIC_TOKEN = "!!llTextBox!!";
+
 #endif
diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h
index 88d7e88edc7072dc45ad936c1d936fc608c44d00..8a1e1fe8cb378808d51655f03c1f43b456f999e7 100644
--- a/indra/llcommon/llstring.h
+++ b/indra/llcommon/llstring.h
@@ -39,15 +39,8 @@
 
 const char LL_UNKNOWN_CHAR = '?';
 
-class LLVector3;
-class LLVector3d;
-class LLQuaternion;
-class LLUUID;
-class LLColor4;
-class LLColor4U;
-
-#if (LL_DARWIN || LL_SOLARIS || (LL_LINUX && __GNUC__ > 2))
-// Template specialization of char_traits for U16s. Only necessary on Mac for now (exists on Windows, unused/broken on Linux/gcc2.95)
+#if LL_DARWIN || LL_LINUX || LL_SOLARIS
+// Template specialization of char_traits for U16s. Only necessary on Mac and Linux (exists on Windows already)
 namespace std
 {
 template<>
@@ -166,13 +159,13 @@ public:
 // but it might be worthwhile to just go with two implementations (LLString and LLWString) of
 // an interface class, unless we can think of a good reason to have a std::basic_string polymorphic base
 
-//****************************************************************
+// ****************************************************************
 // NOTA BENE: do *NOT* dynamically allocate memory inside of LLStringBase as the {*()^#%*)#%W^*)#%*)STL implentation
 // of basic_string doesn't provide a virtual destructor.  If we need to allocate resources specific to LLString
 // then we should either customize std::basic_string to linden::basic_string or change LLString to be a wrapper
 // that contains an instance of std::basic_string.  Similarly, overriding methods defined in std::basic_string will *not*
 // be called in a polymorphic manner (passing an instance of basic_string to a particular function)
-//****************************************************************
+// ****************************************************************
 
 template <class T>
 class LLStringBase : public std::basic_string<T> 
@@ -196,35 +189,6 @@ public:
 	LLStringBase(const T* s);
 	LLStringBase(const T* s, size_type n);
 	LLStringBase(const T* s, size_type pos, size_type n );
-	
-#if LL_LINUX || LL_SOLARIS
-	void clear() { assign(null); }
-	
-	LLStringBase<T>& assign(const T* s);
-	LLStringBase<T>& assign(const T* s, size_type n); 
-	LLStringBase<T>& assign(const LLStringBase& s);
-	LLStringBase<T>& assign(size_type n, const T& c);
-	LLStringBase<T>& assign(const T* a, const T* b);
-	LLStringBase<T>& assign(typename LLStringBase<T>::iterator &it1, typename LLStringBase<T>::iterator &it2);
-	LLStringBase<T>& assign(typename LLStringBase<T>::const_iterator &it1, typename LLStringBase<T>::const_iterator &it2);
-
-    // workaround for bug in gcc2 STL headers.
-    #if ((__GNUC__ <= 2) && (!defined _STLPORT_VERSION))
-    const T* c_str () const
-    {
-        if (length () == 0)
-        {
-            static const T zero = 0;
-            return &zero;
-        }
-
-        //terminate ();
-        { string_char_traits<T>::assign(const_cast<T*>(data())[length()], string_char_traits<T>::eos()); }
-
-        return data ();
-    }
-    #endif
-#endif
 
 	bool operator==(const T* _Right) const { return _Right ? (std::basic_string<T>::compare(_Right) == 0) : this->empty(); }
 	
@@ -787,78 +751,6 @@ LLStringBase<T>::LLStringBase(const T* s, size_type pos, size_type n ) : std::ba
 	}
 }
 
-#if LL_LINUX || LL_SOLARIS
-template<class T> 
-LLStringBase<T>& LLStringBase<T>::assign(const T* s)
-{
-	if (s)
-	{
-		std::basic_string<T>::assign(s);
-	}
-	else
-	{
-		assign(LLStringBase<T>::null);
-	}
-	return *this;
-}
-
-template<class T> 
-LLStringBase<T>& LLStringBase<T>::assign(const T* s, size_type n)
-{
-	if (s)
-	{
-		std::basic_string<T>::assign(s, n);
-	}
-	else
-	{
-		assign(LLStringBase<T>::null);
-	}
-	return *this;
-}
-
-template<class T> 
-LLStringBase<T>& LLStringBase<T>::assign(const LLStringBase<T>& s)
-{
-	std::basic_string<T>::assign(s);
-	return *this;
-}
-
-template<class T> 
-LLStringBase<T>& LLStringBase<T>::assign(size_type n, const T& c)
-{
-    std::basic_string<T>::assign(n, c);
-    return *this;
-}
-
-template<class T> 
-LLStringBase<T>& LLStringBase<T>::assign(const T* a, const T* b)
-{
-    if (a > b)
-        assign(LLStringBase<T>::null);
-    else
-        assign(a, (size_type) (b-a));
-    return *this;
-}
-
-template<class T>
-LLStringBase<T>& LLStringBase<T>::assign(typename LLStringBase<T>::iterator &it1, typename LLStringBase<T>::iterator &it2)
-{
-    assign(LLStringBase<T>::null);
-    while(it1 != it2)
-        *this += *it1++;
-    return *this;
-}
-
-template<class T>
-LLStringBase<T>& LLStringBase<T>::assign(typename LLStringBase<T>::const_iterator &it1, typename LLStringBase<T>::const_iterator &it2)
-{
-    assign(LLStringBase<T>::null);
-    while(it1 != it2)
-        *this += *it1++;
-    return *this;
-}
-#endif
-
 //static
 template<class T> 
 void LLStringBase<T>::toUpper(std::basic_string<T>& string)	
diff --git a/indra/llimage/llimagejpeg.cpp b/indra/llimage/llimagejpeg.cpp
index f9b36bd1f6742672ec09f4a82379be19fea02560..1ec92460bd51dac292b686fb48fcf31203d6c623 100644
--- a/indra/llimage/llimagejpeg.cpp
+++ b/indra/llimage/llimagejpeg.cpp
@@ -40,7 +40,8 @@ LLImageJPEG::LLImageJPEG()
 	LLImageFormatted(IMG_CODEC_JPEG),
 	mOutputBuffer( NULL ),
 	mOutputBufferSize( 0 ),
-	mEncodeQuality( 75 ) 		// on a scale from 1 to 100
+	mEncodeQuality( 75 ), // on a scale from 1 to 100
+	mSetjmpBuffer()
 {
 }
 
diff --git a/indra/llimage/llimagetga.cpp b/indra/llimage/llimagetga.cpp
index 69a32975a049ebc8287ff4c63133a6c04d4f0997..a9fc02bf8d7a80567016ba76b103a402396d1ae7 100644
--- a/indra/llimage/llimagetga.cpp
+++ b/indra/llimage/llimagetga.cpp
@@ -63,7 +63,30 @@ LLImageTGA::LLImageTGA()
 	  mColorMapStart( 0 ),
 	  mColorMapLength( 0 ),
 	  mColorMapBytesPerEntry( 0 ),
-	  mIs15Bit( FALSE )
+	  mIs15Bit( FALSE ),
+
+	  mAttributeBits(0),
+	  mColorMapDepth(0),
+	  mColorMapIndexHi(0),
+	  mColorMapIndexLo(0),
+	  mColorMapLengthHi(0),
+	  mColorMapLengthLo(0),
+	  mColorMapType(0),
+	  mDataOffset(0),
+	  mHeightHi(0),
+	  mHeightLo(0),
+	  mIDLength(0),
+	  mImageType(0),
+	  mInterleave(0),
+	  mOriginRightBit(0),
+	  mOriginTopBit(0),
+	  mPixelSize(0),
+	  mWidthHi(0),
+	  mWidthLo(0),
+	  mXOffsetHi(0),
+	  mXOffsetLo(0),
+	  mYOffsetHi(0),
+	  mYOffsetLo(0)
 {
 }
 
diff --git a/indra/llimage/llpngwrapper.cpp b/indra/llimage/llpngwrapper.cpp
index 74a09b2106027749e9f383ff23ac6cc5cbfd2e23..7b0c1ea9311f6c2cf2dfc97ff43d60e657e2ba4c 100644
--- a/indra/llimage/llpngwrapper.cpp
+++ b/indra/llimage/llpngwrapper.cpp
@@ -42,17 +42,22 @@
 
 LLPngWrapper::LLPngWrapper()
 	: mReadPngPtr( NULL ),
-      mReadInfoPtr( NULL ),
+	  mReadInfoPtr( NULL ),
 	  mWritePngPtr( NULL ),
 	  mWriteInfoPtr( NULL ),
 	  mRowPointers( NULL ),
+	  mWidth( 0 ),
+	  mHeight( 0 ),
 	  mBitDepth( 0 ),
 	  mColorType( 0 ),
 	  mChannels( 0 ),
 	  mInterlaceType( 0 ),
 	  mCompressionType( 0 ),
 	  mFilterMethod( 0 ),
-	  mFinalSize( 0 )
+	  mFinalSize( 0 ),
+	  mHasBKGD(false),
+	  mBackgroundColor(),
+	  mGamma(0.f)
 {
 }
 
diff --git a/indra/llimage/llpngwrapper.h b/indra/llimage/llpngwrapper.h
index 1c66b8a31cb827b4542b6ac448efbe5d67df4945..fd21ae697fb62d0fb9c27a8e9756ee8ea7bb9a2f 100644
--- a/indra/llimage/llpngwrapper.h
+++ b/indra/llimage/llpngwrapper.h
@@ -93,7 +93,7 @@ private:
 
 	U32 mFinalSize;
 
-	BOOL mHasBKGD;
+	bool mHasBKGD;
 	png_color_16p mBackgroundColor;
 
 	F64 mGamma;
diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp
index 15beeec8661a0b15b5fec64e1d86e53ad4b2adfd..0b11b6009e6b3e94f15bdda2d2cee267bef99dd5 100644
--- a/indra/llinventory/llparcel.cpp
+++ b/indra/llinventory/llparcel.cpp
@@ -1,33 +1,33 @@
 /** 
-* @file llparcel.cpp
-* @brief A land parcel.
-*
-* $LicenseInfo:firstyear=2002&license=viewergpl$
-* 
-* Copyright (c) 2002-2007, Linden Research, Inc.
-* 
-* Second Life Viewer Source Code
-* The source code in this file ("Source Code") is provided by Linden Lab
-* to you under the terms of the GNU General Public License, version 2.0
-* ("GPL"), unless you have obtained a separate licensing agreement
-* ("Other License"), formally executed by you and Linden Lab.	 Terms of
-* the GPL can be found in doc/GPL-license.txt in this distribution, or
-* online at http://secondlife.com/developers/opensource/gplv2
-* 
-* There are special exceptions to the terms and conditions of the GPL as
-* it is applied to this Source Code. View the full text of the exception
-* in the file doc/FLOSS-exception.txt in this software distribution, or
-* online at http://secondlife.com/developers/opensource/flossexception
-* 
-* By copying, modifying or distributing this software, you acknowledge
-* that you have read and understood your obligations described above,
-* and agree to abide by those obligations.
-* 
-* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
-* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
-* COMPLETENESS OR PERFORMANCE.
-* $/LicenseInfo$
-*/
+ * @file llparcel.cpp
+ * @brief A land parcel.
+ *
+ * $LicenseInfo:firstyear=2002&license=viewergpl$
+ * 
+ * Copyright (c) 2002-2007, Linden Research, Inc.
+ * 
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab.	 Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlife.com/developers/opensource/gplv2
+ * 
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at http://secondlife.com/developers/opensource/flossexception
+ * 
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ * 
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ * $/LicenseInfo$
+ */
 
 #include "linden_common.h"
 
@@ -241,6 +241,9 @@ void LLParcel::init(const LLUUID &owner_id,
 	setSelectedPrimCount(0);
 	setTempPrimCount(0);
 	setCleanOtherTime(0);
+    setRegionPushOverride(FALSE);
+    setRegionDenyAnonymousOverride(FALSE);
+    setRegionDenyAgeUnverifiedOverride(FALSE);
 	setParcelPrimBonus(parcel_object_bonus);
 
 	setPreviousOwnerID(LLUUID::null);
diff --git a/indra/llinventory/llpermissions.cpp b/indra/llinventory/llpermissions.cpp
index 1788fedf50f2ecd778fcdbf969c4bb46e74ba5cf..b137eeff331d4836003d348c697375d5379add44 100644
--- a/indra/llinventory/llpermissions.cpp
+++ b/indra/llinventory/llpermissions.cpp
@@ -826,7 +826,7 @@ LLXMLNode *LLPermissions::exportFileXML() const
 {
 	LLXMLNode *ret = new LLXMLNode("permissions", FALSE);
 
-	ret->createChild("group_owned", TRUE)->setBoolValue(1, (const BOOL*)&mIsGroupOwned);
+	ret->createChild("group_owned", TRUE)->setBoolValue(mIsGroupOwned);
 
 	ret->createChild("base_mask", FALSE)->setByteValue(4, (U8*)&mMaskBase, LLXMLNode::ENCODING_HEX);
 	ret->createChild("owner_mask", FALSE)->setByteValue(4, (U8*)&mMaskOwner, LLXMLNode::ENCODING_HEX);
@@ -869,7 +869,11 @@ bool LLPermissions::importXML(LLXMLNode* node)
 		if (node->getChild("group_id", sub_node))
 			success = success && (1 == sub_node->getUUIDValue(1, &mGroup));
 		if (node->getChild("group_owned", sub_node))
-			success = success && (1 == sub_node->getBoolValue(1, (BOOL*)&mIsGroupOwned));
+		{
+			BOOL tmpbool = FALSE;
+			success = success && (1 == sub_node->getBoolValue(1, &tmpbool));
+			mIsGroupOwned = (bool)tmpbool;
+		}
 		if (!success)
 		{
 			lldebugs << "LLPermissions::importXML() failed for node named '" 
diff --git a/indra/llinventory/lltransactionflags.cpp b/indra/llinventory/lltransactionflags.cpp
index d4c97d11bffa949ea0bffb15a9047b6df8fc3a38..9b49a6b589c0a9d58c3c3356aabbe0cd62ea573a 100644
--- a/indra/llinventory/lltransactionflags.cpp
+++ b/indra/llinventory/lltransactionflags.cpp
@@ -95,12 +95,16 @@ std::string build_transfer_message_to_source(
 	const LLUUID& dest_id,
 	const std::string& dest_name,
 	S32 transaction_type,
-	const char* description)
+	const char* desc)
 {
+	std::string description(ll_safe_string(desc));
 	lldebugs << "build_transfer_message_to_source: " << amount << " "
 		<< source_id << " " << dest_id << " " << dest_name << " "
-		<< (description?description:"(no desc)") << llendl;
-	if((0 == amount) || source_id.isNull()) return ll_safe_string(description);
+		<< transaction_type << " "
+		<< (description.empty()?"(no desc)":description.c_str())
+		<< llendl;
+	if(source_id.isNull()) return description;
+	if((0 == amount) && description.empty()) return description;
 	std::ostringstream ostr;
 	if(dest_id.isNull())
 	{
@@ -123,7 +127,7 @@ std::string build_transfer_message_to_source(
 	else
 	{
 		ostr << "You paid " << dest_name << " L$" << amount;
-		append_reason(ostr, transaction_type, description);
+		append_reason(ostr, transaction_type, description.c_str());
 	}
 	ostr << ".";
 	return ostr.str();
@@ -139,7 +143,8 @@ std::string build_transfer_message_to_destination(
 {
 	lldebugs << "build_transfer_message_to_dest: " << amount << " "
 		<< dest_id << " " << source_id << " " << source_name << " "
-		<< (description?description:"(no desc)") << llendl;
+		<< transaction_type << " " << (description?description:"(no desc)")
+		<< llendl;
 	if(0 == amount) return std::string();
 	if(dest_id.isNull()) return ll_safe_string(description);
 	std::ostringstream ostr;
diff --git a/indra/llinventory/lltransactionflags.h b/indra/llinventory/lltransactionflags.h
index f5ee9d68edccc64d2c03ba28870968a7150805ee..3bf08af2825b7f58fa42dad47c187751a349acab 100644
--- a/indra/llinventory/lltransactionflags.h
+++ b/indra/llinventory/lltransactionflags.h
@@ -31,6 +31,8 @@
 #ifndef LL_LLTRANSACTIONFLAGS_H
 #define LL_LLTRANSACTIONFLAGS_H
 
+class LLUUID;
+
 typedef U8 TransactionFlags;
 
 // defined in common/llinventory/lltransactionflags.cpp
diff --git a/indra/llmath/llcamera.h b/indra/llmath/llcamera.h
index bd894753f8f3c0ca2be2155b282a9e4e6e6e49ef..82c712e5e7aed6d6b81855dbef0668a1abee1368 100644
--- a/indra/llmath/llcamera.h
+++ b/indra/llmath/llcamera.h
@@ -115,11 +115,12 @@ protected:
 	LLPlane mWorldPlanes[PLANE_NUM];
 	LLPlane mHorizPlanes[HORIZ_PLANE_NUM];
 
-	typedef struct 
+	struct frustum_plane
 	{
+        frustum_plane() : mask(0) {}
 		LLPlane p;
 		U8 mask;
-	} frustum_plane;
+	};
 	frustum_plane mAgentPlanes[7];  //frustum planes in agent space a la gluUnproject (I'm a bastard, I know) - DaveP
 									
 	U32 mPlaneCount;  //defaults to 6, if setUserClipPlane is called, uses user supplied clip plane in
diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h
index 4bc8495ad36b7b35556ac189cbdf20eaf1af32ce..c395ed737878886ea819ea8bc44e03f556343f7e 100644
--- a/indra/llmath/llvolume.h
+++ b/indra/llmath/llvolume.h
@@ -189,15 +189,20 @@ class LLProfileParams
 {
 public:
 	LLProfileParams()
+		: mCurveType(LL_PCODE_PROFILE_SQUARE),
+		  mBegin(0.f),
+		  mEnd(1.f),
+		  mHollow(0.f),
+		  mCRC(0)
 	{
-		mCurveType = LL_PCODE_PROFILE_SQUARE;
-		mBegin     = 0.f;
-		mEnd       = 1.f;
-		mHollow    = 0.f;
 	}
 
 	LLProfileParams(U8 curve, F32 begin, F32 end, F32 hollow)
-		: mCurveType(curve), mBegin(begin), mEnd(end), mHollow(hollow)
+		: mCurveType(curve),
+		  mBegin(begin),
+		  mEnd(end),
+		  mHollow(hollow),
+		  mCRC(0)
 	{
 	}
 
@@ -222,6 +227,7 @@ public:
 			temp_f32 = 1.f;
 		}
 		mHollow = temp_f32;
+		mCRC = 0;
 	}
 
 	bool operator==(const LLProfileParams &params) const;
@@ -309,27 +315,36 @@ class LLPathParams
 {
 public:
 	LLPathParams()
+		:
+		mCurveType(LL_PCODE_PATH_LINE),
+		mBegin(0.f),
+		mEnd(1.f),
+		mScale(1.f,1.f),
+		mShear(0.f,0.f),
+		mTwistBegin(0.f),
+		mTwistEnd(0.f),
+		mRadiusOffset(0.f),
+		mTaper(0.f,0.f),
+		mRevolutions(1.f),
+		mSkew(0.f),
+		mCRC(0)
 	{
-		mBegin     = 0.f;
-		mEnd       = 1.f;
-		mScale.setVec(1.f,1.f);
-		mShear.setVec(0.f,0.f);
-		mCurveType = LL_PCODE_PATH_LINE;
-		mTwistBegin		= 0.f;
-		mTwistEnd     	= 0.f;
-		mRadiusOffset	= 0.f;
-		mTaper.setVec(0.f,0.f);
-		mRevolutions	= 1.f;
-		mSkew			= 0.f;
 	}
 
 	LLPathParams(U8 curve, F32 begin, F32 end, F32 scx, F32 scy, F32 shx, F32 shy, F32 twistend, F32 twistbegin, F32 radiusoffset, F32 tx, F32 ty, F32 revolutions, F32 skew)
-		: mCurveType(curve), mBegin(begin), mEnd(end), mTwistBegin(twistbegin), mTwistEnd(twistend), 
-		  mRadiusOffset(radiusoffset), mRevolutions(revolutions), mSkew(skew)
+		: mCurveType(curve),
+		  mBegin(begin),
+		  mEnd(end),
+		  mScale(scx,scy),
+		  mShear(shx,shy),
+		  mTwistBegin(twistbegin),
+		  mTwistEnd(twistend), 
+		  mRadiusOffset(radiusoffset),
+		  mTaper(tx,ty),
+		  mRevolutions(revolutions),
+		  mSkew(skew),
+		  mCRC(0)
 	{
-		mScale.setVec(scx,scy);
-		mShear.setVec(shx,shy);
-		mTaper.setVec(tx,ty);
 	}
 
 	LLPathParams(U8 curve, U16 begin, U16 end, U8 scx, U8 scy, U8 shx, U8 shy, U8 twistend, U8 twistbegin, U8 radiusoffset, U8 tx, U8 ty, U8 revolutions, U8 skew)
@@ -347,6 +362,8 @@ public:
 		mTaper.setVec(U8_TO_F32(tx) * TAPER_QUANTA,U8_TO_F32(ty) * TAPER_QUANTA);
 		mRevolutions = ((F32)revolutions) * REV_QUANTA + 1.0f;
 		mSkew = U8_TO_F32(skew) * SCALE_QUANTA;
+
+		mCRC = 0;
 	}
 
 	bool operator==(const LLPathParams &params) const;
@@ -525,6 +542,7 @@ class LLVolumeParams
 {
 public:
 	LLVolumeParams()
+		: mSculptType(LL_SCULPT_TYPE_NONE)
 	{
 	}
 
@@ -649,7 +667,9 @@ public:
 		  mConcave(FALSE),
 		  mDirty(TRUE),
 		  mTotalOut(0),
-		  mTotal(2)
+		  mTotal(2),
+		  mMinX(0.f),
+		  mMaxX(0.f)
 	{
 	}
 
@@ -678,8 +698,6 @@ public:
 	std::vector<Face>      mFaces;
 	std::vector<LLVector3> mEdgeNormals;
 	std::vector<LLVector3> mEdgeCenters;
-	F32			  mMaxX;
-	F32			  mMinX;
 
 	friend std::ostream& operator<<(std::ostream &s, const LLProfile &profile);
 
@@ -698,6 +716,9 @@ protected:
 
 	S32			  mTotalOut;
 	S32			  mTotal;
+
+	F32			  mMaxX;
+	F32			  mMinX;
 };
 
 //-------------------------------------------------------------------
diff --git a/indra/llmessage/llsdmessagereader.cpp b/indra/llmessage/llsdmessagereader.cpp
index e69c3e34ff8e0cf8c9a11ca9a5e10d2f8caf8b5e..ad4e21efa9ca521c0752a9681f0d4a2824ffeb07 100755
--- a/indra/llmessage/llsdmessagereader.cpp
+++ b/indra/llmessage/llsdmessagereader.cpp
@@ -37,7 +37,8 @@
 #include "llsdmessagebuilder.h"
 #include "llsdutil.h"
 
-LLSDMessageReader::LLSDMessageReader()
+LLSDMessageReader::LLSDMessageReader() :
+	mMessageName(NULL)
 {
 }
 
diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h
index 47683d0ab4ff8088f9da2a96ec7aae8c979c1c6a..04a6a181eb73a871eec138a6819c6f1008c5124f 100644
--- a/indra/llui/llscrolllistctrl.h
+++ b/indra/llui/llscrolllistctrl.h
@@ -212,7 +212,8 @@ public:
 		mMaxContentWidth(0),
 		mIndex(-1), 
 		mParentCtrl(NULL), 
-		mHeader(NULL) 
+		mHeader(NULL),
+		mFontAlignment(LLFontGL::LEFT)
 	{ }
 
 	LLScrollListColumn(const LLSD &sd)
@@ -260,6 +261,7 @@ public:
 		mIndex = -1;
 		mParentCtrl = NULL;
 		mHeader = NULL;
+		mFontAlignment = LLFontGL::LEFT;
 	}
 
 	// Public data is fine so long as this remains a simple struct-like data class.
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 5617eb4873649e6f84d35f1323335e9b25782145..f0f3ac3bdc1f928d7454f6d095a1e9b4ec64cc68 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -4003,7 +4003,11 @@ BOOL LLTextEditor::exportBuffer(LLString &buffer )
 //////////////////////////////////////////////////////////////////////////
 // LLTextSegment
 
-LLTextSegment::LLTextSegment(S32 start) : mStart(start)
+LLTextSegment::LLTextSegment(S32 start) :
+	mStart(start),
+	mEnd(0),
+	mToken(NULL),
+	mIsDefault(FALSE)
 {
 } 
 LLTextSegment::LLTextSegment( const LLStyleSP& style, S32 start, S32 end ) :
diff --git a/indra/llwindow/llkeyboard.cpp b/indra/llwindow/llkeyboard.cpp
index 83abcce3c11cb143379e2fc70a4a70e0a2498a0d..9ed3c9b12d741d1f5b84b794fb339f8254d1f3d1 100644
--- a/indra/llwindow/llkeyboard.cpp
+++ b/indra/llwindow/llkeyboard.cpp
@@ -67,6 +67,7 @@ LLKeyboard::LLKeyboard() : mCallbacks(NULL), mNumpadDistinct(ND_NUMLOCK_OFF)
 
 	mInsertMode = LL_KIM_INSERT;
 	mCurTranslatedKey = KEY_NONE;
+	mCurScanKey = KEY_NONE;
 
 	addKeyName(' ', "Space" );
 	addKeyName(KEY_RETURN, "Enter" );
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index 3e39ecfa2e4bfdb8ec824c07578513e33426c025..8ca0b4b4b83caec684b880e2835fa328f4129027 100644
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -2762,7 +2762,7 @@ void spawn_web_browser(const char* escaped_url)
 	cmd += "launch_url.sh";
 	char* const argv[] = {(char*)cmd.c_str(), (char*)escaped_url, NULL};
 
-	fflush(NULL);
+	fflush(NULL); // flush all buffers before the child inherits them
 	pid_t pid = fork();
 	if (pid == 0)
 	{ // child
diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp
index bf9a9a14a5f761897d78a4989af4a3d4d192a940..1fcacb46a5ae049f6e1107e8d89eb64f7960df6c 100644
--- a/indra/llxml/llxmlnode.cpp
+++ b/indra/llxml/llxmlnode.cpp
@@ -55,6 +55,7 @@ BOOL LLXMLNode::sStripWhitespaceValues = FALSE;
 
 LLXMLNode::LLXMLNode() : 
 	mID(""),
+	mParser(NULL),
 	mIsAttribute(FALSE),
 	mVersionMajor(0), 
 	mVersionMinor(0), 
@@ -72,6 +73,7 @@ LLXMLNode::LLXMLNode() :
 
 LLXMLNode::LLXMLNode(const LLString& name, BOOL is_attribute) : 
 	mID(""),
+	mParser(NULL),
 	mIsAttribute(is_attribute),
 	mVersionMajor(0), 
 	mVersionMinor(0), 
@@ -89,6 +91,7 @@ LLXMLNode::LLXMLNode(const LLString& name, BOOL is_attribute) :
 
 LLXMLNode::LLXMLNode(LLStringTableEntry* name, BOOL is_attribute) : 
 	mID(""),
+	mParser(NULL),
 	mIsAttribute(is_attribute),
 	mVersionMajor(0), 
 	mVersionMinor(0), 
diff --git a/indra/llxml/llxmlnode.h b/indra/llxml/llxmlnode.h
index 19156cf5561eb3724a8da435bc4615cebea6b36d..12160680f160779690847e35b95641e43e20df10 100644
--- a/indra/llxml/llxmlnode.h
+++ b/indra/llxml/llxmlnode.h
@@ -49,6 +49,13 @@
 #include "llstringtable.h"
 
 
+class LLVector3;
+class LLVector3d;
+class LLQuaternion;
+class LLUUID;
+class LLColor4;
+class LLColor4U;
+
 
 struct CompareAttributes
 {
diff --git a/indra/lscript/lscript_library/lscript_library.cpp b/indra/lscript/lscript_library/lscript_library.cpp
index 47ea62b88869df88c92851f0a7ebd2863b649767..3a5b6eacc07c4b93453390cf4704c4ebfdba8c06 100644
--- a/indra/lscript/lscript_library/lscript_library.cpp
+++ b/indra/lscript/lscript_library/lscript_library.cpp
@@ -436,10 +436,12 @@ void LLScriptLibrary::init()
 	
 	addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llStringTrim", "s", "si", "string llStringTrim(string src, integer trim_type)\nTrim leading and/or trailing spaces from a string.\nUses trim_type of STRING_TRIM, STRING_TRIM_HEAD or STRING_TRIM_TAIL."));
 	addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llRegionSay", NULL, "is", "llRegionSay(integer channel, string msg)\nbroadcasts msg to entire region on channel (not 0.)"));
-
 	addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetObjectDetails", "l", "kl", "list llGetObjectDetails(key id, list params)\nGets the object details specified in params for the object with key id.\nDetails are OBJECT_NAME, _DESC, _POS, _ROT, _VELOCITY, _OWNER, _GROUP, _CREATOR."));
+	addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llSetClickAction", NULL, "i", "llSetClickAction(integer action)\nSets the action performed when a prim is clicked upon."));
 
-		addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llSetClickAction", NULL, "i", "llSetClickAction(integer action)\nSets the action performed when a prim is clicked upon."));
+	addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetRegionAgentCount", "i", NULL, "int llGetRegionAgentCount()\nreturns the number of agents in a region"));
+	addFunction(new LLScriptLibraryFunction(10.f, 1.f, dummy_func, "llTextBox", NULL, "ksi", "llTextBox(key avatar, string message, integer chat_channel\nShows a dialog box on the avatar's screen with the message.\nA text box asks for input, and if entered the text is chatted on chat_channel."));
+	addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetAgentLanguage", "s", "k", "string llGetAgentLanguage(key id)\nGets the agents preferred language.."));
 
 	// energy, sleep, dummy_func, name, return type, parameters, help text, gods-only
 
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index d895d7e991d0918d64f6eff78972d58025c474e5..165582c0a7eb5b763556c00a13cfe661c22e6952 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -3808,6 +3808,17 @@
         <key>Value</key>
             <string>default</string>
         </map>
+    <key>LanguageIsPublic</key>
+        <map>
+        <key>Comment</key>
+            <string>Let other residents see our language information</string>
+        <key>Persist</key>
+            <integer>1</integer>
+        <key>Type</key>
+            <string>Boolean</string>
+        <key>Value</key>
+            <integer>1</integer>
+        </map>
     <key>LastFeatureVersion</key>
         <map>
         <key>Comment</key>
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 7ce985542f682c0accbcad6700a469d16f415b73..a46db09e3e9942a6aca821e7e27e74701b13ed1c 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -4770,6 +4770,9 @@ void LLAgent::buildFullnameAndTitle(std::string& name) const
 
 BOOL LLAgent::isInGroup(const LLUUID& group_id) const
 {
+	if (isGodlike())
+		return true;
+
 	S32 count = mGroups.count();
 	for(S32 i = 0; i < count; ++i)
 	{
@@ -4784,6 +4787,9 @@ BOOL LLAgent::isInGroup(const LLUUID& group_id) const
 // This implementation should mirror LLAgentInfo::hasPowerInGroup
 BOOL LLAgent::hasPowerInGroup(const LLUUID& group_id, U64 power) const
 {
+	if (isGodlike())
+		return true;
+
 	// GP_NO_POWERS can also mean no power is enough to grant an ability.
 	if (GP_NO_POWERS == power) return FALSE;
 
@@ -4805,6 +4811,9 @@ BOOL LLAgent::hasPowerInActiveGroup(U64 power) const
 
 U64 LLAgent::getPowerInGroup(const LLUUID& group_id) const
 {
+	if (isGodlike())
+		return GP_ALL_POWERS;
+	
 	S32 count = mGroups.count();
 	for(S32 i = 0; i < count; ++i)
 	{
diff --git a/indra/newview/llagentlanguage.cpp b/indra/newview/llagentlanguage.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..7401f95f29a8feb1d5f486c87373444864b80d12
--- /dev/null
+++ b/indra/newview/llagentlanguage.cpp
@@ -0,0 +1,65 @@
+/**
+ * @file llagentlanguage.cpp
+ * @brief Transmit language information to server
+ *
+ * $LicenseInfo:firstyear=2006&license=viewergpl$
+ *
+ * Copyright (c) 2006-2007, Linden Research, Inc.
+ *
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab.  Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlife.com/developers/opensource/gplv2
+ *
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at http://secondlife.com/developers/opensource/flossexception
+ *
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ *
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+#include "llagentlanguage.h"
+#include "llagent.h"
+#include "llviewercontrol.h"
+#include "llviewerregion.h"
+
+LLAgentLanguage::LLAgentLanguage()
+{
+	gSavedSettings.getControl("Language")->getSignal()->connect(boost::bind(&update));
+	gSavedSettings.getControl("SystemLanguage")->getSignal()->connect(boost::bind(&update));
+	gSavedSettings.getControl("LanguageIsPublic")->getSignal()->connect(boost::bind(&update));
+}
+
+
+// send language settings to the sim
+// static
+bool LLAgentLanguage::update()
+{
+	LLSD body;
+	std::string url = gAgent.getRegion()->getCapability("UpdateAgentLanguage");
+	if (!url.empty())
+	{
+		std::string language = gSavedSettings.getString("Language");
+		if (language == "default")
+			language = gSavedSettings.getString("SystemLanguage");
+		
+		body["language"] = language;
+		body["language_is_public"] = gSavedSettings.getBOOL("LanguageIsPublic");
+		
+		LLHTTPClient::post(url, body, new LLHTTPClient::Responder);
+	}
+    return true;
+}
+
diff --git a/indra/newview/llagentlanguage.h b/indra/newview/llagentlanguage.h
new file mode 100644
index 0000000000000000000000000000000000000000..8d708b27fc3e17902d29393ce224c6e058af7dec
--- /dev/null
+++ b/indra/newview/llagentlanguage.h
@@ -0,0 +1,45 @@
+/**
+ * @file llagentlanguage.h
+ * @brief Transmit language information to server
+ *
+ * $LicenseInfo:firstyear=2006&license=viewergpl$
+ *
+ * Copyright (c) 2006-2007, Linden Research, Inc.
+ *
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab.  Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlife.com/developers/opensource/gplv2
+ *
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at http://secondlife.com/developers/opensource/flossexception
+ *
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ *
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLAGENTLANGUAGE_H
+#define LL_LLAGENTLANGUAGE_H
+
+#include "llmemory.h"
+#include "llevent.h"
+
+class LLAgentLanguage: public LLSingleton<LLAgentLanguage>, public LLSimpleListener
+{
+ public:
+	LLAgentLanguage();
+	static bool update();
+};
+
+#endif // LL_LLAGENTLANGUAGE_H
diff --git a/indra/newview/llagentpilot.cpp b/indra/newview/llagentpilot.cpp
index f0bd452109fec7acb6be5cbc7ab71229aa97038b..136afb78aa47de002bb44737f6e4c3731751481f 100644
--- a/indra/newview/llagentpilot.cpp
+++ b/indra/newview/llagentpilot.cpp
@@ -45,12 +45,15 @@ LLAgentPilot gAgentPilot;
 
 BOOL LLAgentPilot::sLoop = TRUE;
 
-LLAgentPilot::LLAgentPilot()
+LLAgentPilot::LLAgentPilot() :
+	mNumRuns(-1),
+	mQuitAfterRuns(FALSE),
+	mRecording(FALSE),
+	mLastRecordTime(0.f),
+	mStarted(FALSE),
+	mPlaying(FALSE),
+	mCurrentAction(0)
 {
-	mRecording = FALSE;
-	mPlaying = FALSE;
-	mStarted = FALSE;
-	mNumRuns = -1;
 }
 
 LLAgentPilot::~LLAgentPilot()
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index b1b59a71f8548fc5c33d23588fbbce41c78163a3..2c9dec380135a863bd43c459d91de9198f866afe 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1980,11 +1980,12 @@ bool LLAppViewer::initConfiguration()
 				cmd += "linux-crash-logger.bin";
 #else // LL_SOLARIS
 				cmd += "bin/solaris-crash-logger";
-#endif
+#endif // LL_LINUX
 				char* const cmdargv[] =
 					{(char*)cmd.c_str(),
 					 (char*)"-previous",
 					 NULL};
+				fflush(NULL); // flush all buffers before the child inherits them
 				pid_t pid = fork();
 				if (pid == 0)
 				{ // child
diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp
index b43c9db40a4c7d0e45ca231fcc65db13fda3c1c0..3d2ae03d63a7e8b165f8998448c22a2b9079066f 100644
--- a/indra/newview/llassetuploadresponders.cpp
+++ b/indra/newview/llassetuploadresponders.cpp
@@ -76,6 +76,7 @@ LLAssetUploadResponder::LLAssetUploadResponder(const LLSD &post_data,
 											   const std::string& file_name)
 	: LLHTTPClient::Responder(),
 	  mPostData(post_data),
+	  mAssetType(LLAssetType::AT_NONE),
 	  mFileName(file_name)
 {
 }
diff --git a/indra/newview/llcurrencyuimanager.cpp b/indra/newview/llcurrencyuimanager.cpp
index 6aee25deca9d9794ae16f4e73938247254e3e4df..bbcb7e64d448f75c920f9d14ef3861f83788c021 100644
--- a/indra/newview/llcurrencyuimanager.cpp
+++ b/indra/newview/llcurrencyuimanager.cpp
@@ -122,6 +122,7 @@ LLCurrencyUIManager::Impl::Impl(LLPanel& dialog)
 	mError(false),
 	mUserCurrencyBuy(1000), mUserEnteredCurrencyBuy(false),
 	mSiteCurrencyEstimated(false),
+	  mSiteCurrencyEstimatedCost(0),
 	mBought(false),
 	mTransactionType(TransactionNone), mTransaction(0),
 	mCurrencyChanged(false)
diff --git a/indra/newview/lleventnotifier.cpp b/indra/newview/lleventnotifier.cpp
index 8e2069207f28bb86c8725b15cc92bfaa2794eab0..d7fe6777e2a30f87e954c8e79bb3f2418596e970 100644
--- a/indra/newview/lleventnotifier.cpp
+++ b/indra/newview/lleventnotifier.cpp
@@ -203,7 +203,8 @@ void LLEventNotifier::notifyCallback(S32 option, void *user_data)
 
 LLEventNotification::LLEventNotification() :
 	mEventID(0),
-	mEventName("")
+	mEventName(""),
+	mEventDate(0)
 {
 }
 
diff --git a/indra/newview/llfloatergroupinvite.cpp b/indra/newview/llfloatergroupinvite.cpp
index a82e6e914e6d3cbbccf61315694ac3a3d5c68841..b875bd5baa27c15def6f320d1b0bb91a8fcab3f5 100644
--- a/indra/newview/llfloatergroupinvite.cpp
+++ b/indra/newview/llfloatergroupinvite.cpp
@@ -57,9 +57,10 @@ public:
 //
 std::map<LLUUID, LLFloaterGroupInvite*> LLFloaterGroupInvite::impl::sInstances;
 
-LLFloaterGroupInvite::impl::impl(const LLUUID& group_id)
+LLFloaterGroupInvite::impl::impl(const LLUUID& group_id) :
+	mGroupID(group_id),
+	mInvitePanelp(NULL)
 {
-	mGroupID = group_id;
 }
 
 LLFloaterGroupInvite::impl::~impl()
diff --git a/indra/newview/llfollowcam.cpp b/indra/newview/llfollowcam.cpp
index a370554ef6c9d711538e5379972e00e7a4e3934d..bc91f4a579a2e661d7b68f230379ef2e8d604e43 100644
--- a/indra/newview/llfollowcam.cpp
+++ b/indra/newview/llfollowcam.cpp
@@ -264,6 +264,7 @@ LLFollowCam::LLFollowCam() : LLFollowCamParams()
 	mSubjectRotation					= LLQuaternion::DEFAULT;
 
 	mZoomedToMinimumDistance			= false;
+	mPitchCos = mPitchSin = 0.f;
 	mPitchSineAndCosineNeedToBeUpdated	= true; 
 
 	mSimulatedDistance = mDistance;
diff --git a/indra/newview/llfollowcam.h b/indra/newview/llfollowcam.h
index ab8ffb1fa484afee5595e5458f9caeb1ec25c13f..1c5eb796970202ac3cd324f7c2e22f9c94f243f2 100644
--- a/indra/newview/llfollowcam.h
+++ b/indra/newview/llfollowcam.h
@@ -169,8 +169,6 @@ public:
 	// protected members of FollowCam
 	//------------------------------------------
 protected:
-	F32		mPositionLagTimeScale;		// derived from mPositionLag
-	F32		mFocusLagTimeScale;			// derived from mFocusLag
 	F32		mPitchCos;					// derived from mPitch
 	F32		mPitchSin;					// derived from mPitch
 	LLGlobalVec		mSimulatedPositionGlobal;		// where the camera is (global coordinates), simulated
diff --git a/indra/newview/llhudeffectlookat.cpp b/indra/newview/llhudeffectlookat.cpp
index 7dd20debd9d902e8ab7cc490d1926fce2ca32e96..f48a404a61e27422f44679b0c5e810c73987f8de 100644
--- a/indra/newview/llhudeffectlookat.cpp
+++ b/indra/newview/llhudeffectlookat.cpp
@@ -73,8 +73,11 @@ const F32 MAX_TIMEOUT = F32_MAX / 2.f;
 class LLAttention
 {
 public:
-	LLAttention(){}
-	LLAttention(F32 timeout, F32 priority, char *name, LLColor3 color) :
+	LLAttention()
+		: mTimeout(0.f),
+		  mPriority(0.f)
+	{}
+	LLAttention(F32 timeout, F32 priority, LLString name, LLColor3 color) :
 	  mTimeout(timeout), mPriority(priority), mName(name), mColor(color)
 	{
 	}
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 5ae7c2a4e7fa83502d90ba7edaec114b935adf17..729165a2a41107a7b9f97c011afbb4ac143921ab 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -1369,7 +1369,9 @@ bool LLFindWearables::operator()(LLInventoryCategory* cat,
 class LLRightClickInventoryFetchObserver : public LLInventoryFetchObserver
 {
 public:
-	LLRightClickInventoryFetchObserver()  {};
+	LLRightClickInventoryFetchObserver() :
+		mCopyItems(false)
+	{ };
 	LLRightClickInventoryFetchObserver(const LLUUID& cat_id, bool copy_items) :
 		mCatID(cat_id),
 		mCopyItems(copy_items)
@@ -2237,7 +2239,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 		if(accept && drop)
 		{
 			if (inv_item->getType() == LLAssetType::AT_GESTURE
-				&& gGestureManager.isGestureActive(inv_item->getUUID()))
+				&& gGestureManager.isGestureActive(inv_item->getUUID()) && move_is_into_trash)
 			{
 				gGestureManager.deactivateGesture(inv_item->getUUID());
 			}
diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp
index fb86366cc629d6801013641483f5a7edf4d1b55f..42df0c2ac822a008930fdcb636920681b6303af5 100644
--- a/indra/newview/llpanelgroup.cpp
+++ b/indra/newview/llpanelgroup.cpp
@@ -193,7 +193,7 @@ void LLPanelGroup::updateTabVisibility()
 		LLPanelGroupTab* panelp =
 			(LLPanelGroupTab*) mTabContainer->getPanelByIndex(i);
 
-		BOOL visible = panelp->isVisibleByAgent(&gAgent);
+		BOOL visible = panelp->isVisibleByAgent(&gAgent) || gAgent.isGodlike();
 		mTabContainer->enableTabButton(i, visible);
 
 		if ( !visible && mCurrentTab == panelp )
diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp
index c04b1b72cd6d8115eebe9429198cd315f254334c..5f11c4ac80d06e250fb3e31df0243a6c5bbb259f 100644
--- a/indra/newview/llpanelgrouproles.cpp
+++ b/indra/newview/llpanelgrouproles.cpp
@@ -61,6 +61,9 @@ bool agentCanRemoveFromRole(const LLUUID& group_id,
 bool agentCanAddToRole(const LLUUID& group_id,
 					   const LLUUID& role_id)
 {
+	if (gAgent.isGodlike())
+		return true;
+    
 	LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(group_id);
 	if (!gdatap) 
 	{
@@ -177,9 +180,6 @@ BOOL LLPanelGroupRoles::postBuild()
 
 BOOL LLPanelGroupRoles::isVisibleByAgent(LLAgent* agentp)
 {
-	if (agentp->isGodlike())
-		return TRUE;
-	
 	/* This power was removed to make group roles simpler
 	return agentp->hasPowerInGroup(mGroupID, 
 								   GP_ROLE_CREATE |
@@ -1131,6 +1131,9 @@ void LLPanelGroupMembersSubTab::handleMemberSelect()
 	}
 	mAssignedRolesList->setEnabled(TRUE);
 
+	if (gAgent.isGodlike())
+		can_eject_members = TRUE;
+
 	if (!can_eject_members && !member_is_owner)
 	{
 		// Maybe we can eject them because we are an owner...
diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp
index 7110ea4f93f6ec793fc52ba5b14c96aaad1d8a00..449783285c3d826e0fd24a830757750afed55076 100644
--- a/indra/newview/llpanelpermissions.cpp
+++ b/indra/newview/llpanelpermissions.cpp
@@ -98,8 +98,8 @@ BOOL LLPanelPermissions::postBuild()
 	
 	this->childSetCommitCallback("checkbox for sale",LLPanelPermissions::onCommitSaleInfo,this);
 
-	this->childSetCommitCallback("EdCost",LLPanelPermissions::onCommitSaleInfo,this);
-	this->childSetPrevalidate("EdCost",LLLineEditor::prevalidateNonNegativeS32);
+	this->childSetCommitCallback("Edit Cost",LLPanelPermissions::onCommitSaleInfo,this);
+	this->childSetPrevalidate("Edit Cost",LLLineEditor::prevalidateNonNegativeS32);
 
 	this->childSetCommitCallback("sale type",LLPanelPermissions::onCommitSaleType,this);
 	
@@ -229,9 +229,10 @@ void LLPanelPermissions::refresh()
 			RadioSaleType->setEnabled(FALSE);
 		}
 		
-		childSetEnabled("Price:  L$",false);
-		childSetText("EdCost",LLString::null);
-		childSetEnabled("EdCost",false);
+		childSetEnabled("Cost",false);
+		childSetText("Cost",LLString(childGetText("Cost Default")));
+		childSetText("Edit Cost",LLString::null);
+		childSetEnabled("Edit Cost",false);
 		
 		childSetEnabled("label click action",false);
 		LLComboBox*	ComboClickAction = getChild<LLComboBox>("clickaction");
@@ -416,56 +417,92 @@ void LLPanelPermissions::refresh()
 	childSetText("prim info",object_info_string);
 	childSetEnabled("prim info",true);
 
-	S32 price;
-	BOOL is_for_sale = LLSelectMgr::getInstance()->selectIsForSale(price);
-	if (!is_for_sale)
-	{
-		price = DEFAULT_PRICE;
-	}
-
-	BOOL self_owned = (gAgent.getID() == mOwnerID);
-	BOOL group_owned = LLSelectMgr::getInstance()->selectIsGroupOwned() ;
-	BOOL public_owned = (mOwnerID.isNull() && !LLSelectMgr::getInstance()->selectIsGroupOwned());
-	BOOL can_transfer = LLSelectMgr::getInstance()->selectGetRootsTransfer();
-	BOOL can_copy = LLSelectMgr::getInstance()->selectGetRootsCopy();
+	S32 total_sale_price = 0;
+	S32 individual_sale_price = 0;
+	BOOL is_for_sale_mixed = FALSE;
+	BOOL is_sale_price_mixed = FALSE;
+	U32 num_for_sale = FALSE;
+    LLSelectMgr::getInstance()->selectGetAggregateSaleInfo(num_for_sale,
+										   is_for_sale_mixed,
+										   is_sale_price_mixed,
+										   total_sale_price,
+										   individual_sale_price);
+
+	const BOOL self_owned = (gAgent.getID() == mOwnerID);
+	const BOOL group_owned = LLSelectMgr::getInstance()->selectIsGroupOwned() ;
+	const BOOL public_owned = (mOwnerID.isNull() && !LLSelectMgr::getInstance()->selectIsGroupOwned());
+	const BOOL can_transfer = LLSelectMgr::getInstance()->selectGetRootsTransfer();
+	const BOOL can_copy = LLSelectMgr::getInstance()->selectGetRootsCopy();
 
 	if(!owners_identical)
 	{
-		childSetEnabled("Price:  L$",false);
-		childSetText("EdCost",LLString::null);
-		childSetEnabled("EdCost",false);
+		childSetEnabled("Cost",false);
+		childSetText("Edit Cost",LLString::null);
+		childSetEnabled("Edit Cost",false);
 	}
+	// You own these objects.
 	else if(self_owned || (group_owned && gAgent.hasPowerInGroup(group_id,GP_OBJECT_SET_SALE)))
 	{
-		LLLineEditor*	EditPrice = getChild<LLLineEditor>("EdCost");
-		if(keyboard_focus_view != EditPrice)
+		// If there are multiple items for sale then set text to PRICE PER UNIT.
+		if (num_for_sale > 1)
 		{
-			childSetText("EdCost",llformat("%d",price));
+			childSetText("Cost",childGetText("Cost Per Unit"));
 		}
-		if(is_for_sale && is_one_object && can_transfer)
+		else
 		{
-			childSetEnabled("Price:  L$",true);
-			childSetEnabled("EdCost",true);
+			childSetText("Cost",childGetText("Cost Default"));
 		}
-		else
+		
+		LLLineEditor *editPrice = getChild<LLLineEditor>("Edit Cost");
+		if(keyboard_focus_view != editPrice)
 		{
-			childSetEnabled("Price:  L$",false);
-			childSetEnabled("EdCost",false);
+			// If the sale price is mixed then set the cost to MIXED, otherwise
+			// set to the actual cost.
+			if (num_for_sale > 0 && is_for_sale_mixed)
+			{
+				childSetText("Edit Cost",childGetText("Sale Mixed"));
+			}
+			else if (num_for_sale > 0 && is_sale_price_mixed)
+			{
+				childSetText("Edit Cost",childGetText("Cost Mixed"));
+			}
+			else 
+			{
+				childSetText("Edit Cost",llformat("%d",individual_sale_price));
+			}
 		}
+		// The edit fields are only enabled if you can sell this object
+		// and the sale price is not mixed.
+		bool enable_edit = (num_for_sale && can_transfer) ? !is_for_sale_mixed : false;
+		childSetEnabled("Cost",enable_edit);
+		childSetEnabled("Edit Cost",enable_edit);
 	}
+	// Someone, not you, owns these objects.
 	else if(!public_owned)
 	{
-		// ...someone, not you, owns it
-		childSetEnabled("Price:  L$",false);
-		childSetText("EdCost",llformat("%d",price));
-		childSetEnabled("EdCost",false);
+		childSetEnabled("Cost",false);
+		childSetEnabled("Edit Cost",false);
+		
+		// Don't show a price if none of the items are for sale.
+		if (num_for_sale)
+			childSetText("Edit Cost",llformat("%d",total_sale_price));
+		else
+			childSetText("Edit Cost",LLString::null);
+
+		// If multiple items are for sale, set text to TOTAL PRICE.
+		if (num_for_sale > 1)
+			childSetText("Cost",childGetText("Cost Total"));
+		else
+			childSetText("Cost",childGetText("Cost Default"));
 	}
+	// This is a public object.
 	else
 	{
-		// ...public object
-		childSetEnabled("Price:  L$",false);
-		childSetText("EdCost",LLString::null);
-		childSetEnabled("EdCost",false);
+		childSetEnabled("Cost",false);
+		childSetText("Cost",childGetText("Cost Default"));
+		
+		childSetText("Edit Cost",LLString::null);
+		childSetEnabled("Edit Cost",false);
 	}
 
 	// Enable and disable the permissions checkboxes
@@ -601,8 +638,11 @@ void LLPanelPermissions::refresh()
 
 	if (has_change_sale_ability && (owner_mask_on & PERM_TRANSFER))
 	{
-		childSetEnabled("checkbox for sale", can_transfer || (!can_transfer && is_for_sale));
-		childSetEnabled("sale type",is_for_sale && can_transfer);
+		childSetEnabled("checkbox for sale", can_transfer || (!can_transfer && num_for_sale));
+		// Set the checkbox to tentative if the prices of each object selected
+		// are not the same.
+		childSetTentative("checkbox for sale", is_for_sale_mixed);
+		childSetEnabled("sale type",num_for_sale && can_transfer && !is_sale_price_mixed);
 
 		childSetEnabled("Next owner can:", TRUE);
 		childSetEnabled("checkbox next owner can modify",base_mask_on & PERM_MODIFY);
@@ -744,21 +784,23 @@ void LLPanelPermissions::refresh()
 		if (valid_sale_info)
 		{
 			RadioSaleType->setSelectedIndex((S32)sale_type - 1);
+			RadioSaleType->setTentative(FALSE); // unfortunately this doesn't do anything at the moment.
 		}
 		else
 		{
 			// default option is sell copy, determined to be safest
 			RadioSaleType->setSelectedIndex((S32)LLSaleInfo::FS_COPY - 1);
+			RadioSaleType->setTentative(TRUE); // unfortunately this doesn't do anything at the moment.
 		}
 	}
 
-	childSetValue("checkbox for sale", is_for_sale);
+	childSetValue("checkbox for sale", num_for_sale != 0);
 
 	// HACK: There are some old objects in world that are set for sale,
 	// but are no-transfer.  We need to let users turn for-sale off, but only
 	// if for-sale is set.
 	bool cannot_actually_sell = !can_transfer || (!can_copy && sale_type == LLSaleInfo::FS_COPY);
-	if (is_for_sale && has_change_sale_ability && cannot_actually_sell)
+	if (num_for_sale && has_change_sale_ability && cannot_actually_sell)
 	{
 		childSetEnabled("checkbox for sale", true);
 	}
@@ -982,9 +1024,10 @@ void LLPanelPermissions::setAllSaleInfo()
 	llinfos << "LLPanelPermissions::setAllSaleInfo()" << llendl;
 	LLSaleInfo::EForSale sale_type = LLSaleInfo::FS_NOT;
 
-	LLCheckBoxCtrl*	mCheckPurchase = getChild<LLCheckBoxCtrl>("checkbox for sale");
-
-	if(mCheckPurchase && mCheckPurchase->get())
+	LLCheckBoxCtrl *checkPurchase = getChild<LLCheckBoxCtrl>("checkbox for sale");
+	
+	// Set the sale type if the object(s) are for sale.
+	if(checkPurchase && checkPurchase->get())
 	{
 		LLRadioGroup* RadioSaleType = getChild<LLRadioGroup>("sale type");
 		if(RadioSaleType)
@@ -1006,23 +1049,37 @@ void LLPanelPermissions::setAllSaleInfo()
 			}
 		}
 	}
-	LLLineEditor*	mEditPrice = getChild<LLLineEditor>("EdCost");
 
 	S32 price = -1;
-	if(mEditPrice)
+	
+	LLLineEditor *editPrice = getChild<LLLineEditor>("Edit Cost");
+	if (editPrice)
 	{
-		price = atoi(mEditPrice->getText().c_str());
+		// Don't extract the price if it's labeled as MIXED or is empty.
+		const char *editPriceString = editPrice->getText().c_str();
+		if (0 != strcmp(editPriceString,childGetText("Cost Mixed").c_str()) &&
+			0 != strcmp(editPriceString,""))
+		{
+			price = atoi(editPriceString);
+		}
+		else
+		{
+			price = DEFAULT_PRICE;
+		}
 	}
-	// Invalid data - turn off the sale
+	// If somehow an invalid price, turn the sale off.
 	if (price < 0)
-	{
 		sale_type = LLSaleInfo::FS_NOT;
-		price = 0;
-	}
 
+	// Force the sale price of not-for-sale items to DEFAULT_PRICE.
+	if (sale_type == LLSaleInfo::FS_NOT)
+	{
+		price = DEFAULT_PRICE;
+	}
+	// Pack up the sale info and send the update.
 	LLSaleInfo sale_info(sale_type, price);
 	LLSelectMgr::getInstance()->selectionSetObjectSaleInfo(sale_info);
-
+	
 	// If turned off for-sale, make sure click-action buy is turned
 	// off as well
 	if (sale_type == LLSaleInfo::FS_NOT)
diff --git a/indra/newview/llpolymesh.cpp b/indra/newview/llpolymesh.cpp
index f4cbbe28c881d271f1cd429525c8ced41698f372..64315e9e305471b0ccc8f6cd058eaa7da5937ae9 100644
--- a/indra/newview/llpolymesh.cpp
+++ b/indra/newview/llpolymesh.cpp
@@ -687,6 +687,12 @@ LLPolyMesh::LLPolyMesh(LLPolyMeshSharedData *shared_data, LLPolyMesh *reference_
 	mAvatarp = NULL;
 	mVertexData = NULL;
 
+	mCurVertexCount = 0;
+	mFaceIndexCount = 0;
+	mFaceIndexOffset = 0;
+	mFaceVertexCount = 0;
+	mFaceVertexOffset = 0;
+
 	if (shared_data->isLOD() && reference_mesh)
 	{
 		mCoords = reference_mesh->mCoords;
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 9d7f183807d288c1c6c4470e8bd8e06a3f4acb37..103f350b0a7adc6df6a155c8a594abd9da4af574 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -2823,27 +2823,53 @@ void LLSelectMgr::selectForceDelete()
 		SEND_ONLY_ROOTS);
 }
 
-
-// returns TRUE if anything is for sale. calculates the total price
-// and stores that value in price.
-BOOL LLSelectMgr::selectIsForSale(S32& price)
+void LLSelectMgr::selectGetAggregateSaleInfo(U32 &num_for_sale,
+											 BOOL &is_for_sale_mixed, 
+											 BOOL &is_sale_price_mixed,
+											 S32 &total_sale_price,
+											 S32 &individual_sale_price)
 {
-	BOOL any_for_sale = FALSE;
-	price = 0;
+	num_for_sale = 0;
+	is_for_sale_mixed = FALSE;
+	is_sale_price_mixed = FALSE;
+	total_sale_price = 0;
+	individual_sale_price = 0;
+
 
+	// Empty set.
+	if (getSelection()->root_begin() == getSelection()->root_end())
+		return;
+	
+	LLSelectNode *node = *(getSelection()->root_begin());
+	const BOOL first_node_for_sale = node->mSaleInfo.isForSale();
+	const S32 first_node_sale_price = node->mSaleInfo.getSalePrice();
+	
 	for (LLObjectSelection::root_iterator iter = getSelection()->root_begin();
 		 iter != getSelection()->root_end(); iter++)
 	{
 		LLSelectNode* node = *iter;
-		if (node->mSaleInfo.isForSale())
+		const BOOL node_for_sale = node->mSaleInfo.isForSale();
+		const S32 node_sale_price = node->mSaleInfo.getSalePrice();
+		
+		// Set mixed if the fields don't match the first node's fields.
+		if (node_for_sale != first_node_for_sale) 
+			is_for_sale_mixed = TRUE;
+		if (node_sale_price != first_node_sale_price)
+			is_sale_price_mixed = TRUE;
+		
+		if (node_for_sale)
 		{
-			price += node->mSaleInfo.getSalePrice();
-			any_for_sale = TRUE;
+			total_sale_price += node_sale_price;
+			num_for_sale ++;
 		}
 	}
-
-	return any_for_sale;
-
+	
+	individual_sale_price = first_node_sale_price;
+	if (is_for_sale_mixed)
+	{
+		is_sale_price_mixed = TRUE;
+		individual_sale_price = 0;
+	}
 }
 
 // returns TRUE if all nodes are valid. method also stores an
@@ -3499,8 +3525,6 @@ void LLSelectMgr::selectionSetObjectCategory(const LLCategory& category)
 
 void LLSelectMgr::selectionSetObjectSaleInfo(const LLSaleInfo& sale_info)
 {
-	// Only one sale info at a time for now
-	if(mSelectedObjects->getRootObjectCount() != 1) return;
 	sendListToRegions("ObjectSaleInfo",
 					  packAgentAndSessionID,
 					  packObjectSaleInfo,
diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h
index 4a8f99db1fed54ef93bf6e072a400dffd07b0408..6ae688bae615d354eadf45e21feb617b5a0d8d29 100644
--- a/indra/newview/llselectmgr.h
+++ b/indra/newview/llselectmgr.h
@@ -558,10 +558,14 @@ public:
 	// returns TRUE if all the nodes are valid. Accumulates
 	// permissions in the parameter.
 	BOOL selectGetPermissions(LLPermissions& perm);
-
-	// returns TRUE if anything is for sale. calculates the total
-	// price and stores that value in price.
-	BOOL selectIsForSale(S32& price);
+	
+	// Get a bunch of useful sale information for the object(s) selected.
+	// "_mixed" is true if not all objects have the same setting.
+	void selectGetAggregateSaleInfo(U32 &num_for_sale,
+									BOOL &is_for_sale_mixed, 
+									BOOL &is_sale_price_mixed,
+									S32 &total_sale_price,
+									S32 &individual_sale_price);
 
 	// returns TRUE if all nodes are valid. 
 	BOOL selectGetCategory(LLCategory& category);
diff --git a/indra/newview/llsprite.cpp b/indra/newview/llsprite.cpp
index f74173425cf17996ef4c7f4a14beba6f6dbd1ec9..1348f85201ed3dee1ec45229fa88d246106a2734 100644
--- a/indra/newview/llsprite.cpp
+++ b/indra/newview/llsprite.cpp
@@ -59,30 +59,18 @@ LLVector3 LLSprite::sNormal(0.0f,0.0f,0.0f);
 //////////////////////////////////////////////////////////////////////
 
 // A simple initialization
-LLSprite::LLSprite(const LLUUID &image_uuid)
+LLSprite::LLSprite(const LLUUID &image_uuid) :
+	mImageID(image_uuid),
+	mImagep(NULL),
+	mPitch(0.f),
+	mYaw(0.f),
+	mPosition(0.0f, 0.0f, 0.0f),
+	mFollow(TRUE),
+	mUseCameraUp(TRUE),
+	mColor(0.5f, 0.5f, 0.5f, 1.0f),
+	mTexMode(GL_REPLACE)
 {
-	mImageID = image_uuid;
-	mImagep = NULL;
-
 	setSize(1.0f, 1.0f);
-	setPosition(LLVector3(0.0f, 0.0f, 0.0f));
-	mTexMode = GL_REPLACE;
-	mColor.setVec(0.5f, 0.5f, 0.5f, 1.0f);
-	mFollow = TRUE;
-	mUseCameraUp = TRUE;
-}
-
-LLSprite::LLSprite(const LLUUID &image_uuid, const F32 width, const F32 height, const BOOL b_usemipmap)
-{
-	mImageID = image_uuid;
-	mImagep = NULL;
-
-	setSize(width,height);
-	setPosition(LLVector3(0.0f, 0.0f, 0.0f));
-	mTexMode = GL_REPLACE;
-	mColor.setVec(0.5f, 0.5f, 0.5f, 1.0f);
-	mFollow = TRUE;
-	mUseCameraUp = TRUE;
 }
 
 //////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/llsprite.h b/indra/newview/llsprite.h
index 04d30b8e7cb6363dc2cc3297d1d0bbcb66d418d7..322150e85b3b373196b5cf420315ceaa4c457c44 100644
--- a/indra/newview/llsprite.h
+++ b/indra/newview/llsprite.h
@@ -49,7 +49,6 @@ class LLSprite
 {
 public:
 	LLSprite(const LLUUID &image_uuid);
-	LLSprite(const LLUUID &image_uuid, const F32 width, const F32 height, const BOOL b_usemipmap = TRUE);
 	~LLSprite();
 
 	void render(LLViewerCamera * camerap);
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index d931e8463894c80fd5da0659df50d5a421e2c719..c493e8f04995472639ee9050378a4e57afd8acba 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -174,6 +174,11 @@
 #include "llpostprocess.h"
 #include "llwlparammanager.h"
 #include "llwaterparammanager.h"
+#include "llagentlanguage.h"
+
+#if LL_LIBXUL_ENABLED
+#include "llmozlib.h"
+#endif // LL_LIBXUL_ENABLED
 
 #if LL_WINDOWS
 #include "llwindebug.h"
@@ -469,7 +474,7 @@ BOOL idle_startup()
 		}
 		else
 		{
-			LLAppViewer::instance()->earlyExit("Unable to initialize communications.");
+			LLAppViewer::instance()->earlyExit("Message Template " + message_template_path + " not found.");
 		}
 
 		if(gMessageSystem && gMessageSystem->isOK())
@@ -2147,6 +2152,10 @@ BOOL idle_startup()
 		// JC - 7/20/2002
 		gViewerWindow->sendShapeToSim();
 
+		// Inform simulator of our language preference
+		LLAgentLanguage::update();
+
+		
 		// Ignore stipend information for now.  Money history is on the web site.
 		// if needed, show the L$ history window
 		//if (stipend_since_login && !gNoRender)
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp
index 94f8b8ae6789bab315b022ee8a867f545c97138b..6697b06659fc41259bf73483cffc40cdb05dc64c 100644
--- a/indra/newview/llstatusbar.cpp
+++ b/indra/newview/llstatusbar.cpp
@@ -1,33 +1,33 @@
 /** 
- * @file llstatusbar.cpp
- * @brief LLStatusBar class implementation
- *
- * $LicenseInfo:firstyear=2002&license=viewergpl$
- * 
- * Copyright (c) 2002-2007, Linden Research, Inc.
- * 
- * Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab.  Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlife.com/developers/opensource/gplv2
- * 
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at http://secondlife.com/developers/opensource/flossexception
- * 
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
- * 
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
- * $/LicenseInfo$
- */
+* @file llstatusbar.cpp
+* @brief LLStatusBar class implementation
+*
+* $LicenseInfo:firstyear=2002&license=viewergpl$
+* 
+* Copyright (c) 2002-2007, Linden Research, Inc.
+* 
+* Second Life Viewer Source Code
+* The source code in this file ("Source Code") is provided by Linden Lab
+* to you under the terms of the GNU General Public License, version 2.0
+* ("GPL"), unless you have obtained a separate licensing agreement
+* ("Other License"), formally executed by you and Linden Lab.  Terms of
+* the GPL can be found in doc/GPL-license.txt in this distribution, or
+* online at http://secondlife.com/developers/opensource/gplv2
+* 
+* There are special exceptions to the terms and conditions of the GPL as
+* it is applied to this Source Code. View the full text of the exception
+* in the file doc/FLOSS-exception.txt in this software distribution, or
+* online at http://secondlife.com/developers/opensource/flossexception
+* 
+* By copying, modifying or distributing this software, you acknowledge
+* that you have read and understood your obligations described above,
+* and agree to abide by those obligations.
+* 
+* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+* COMPLETENESS OR PERFORMANCE.
+* $/LicenseInfo$
+*/
 
 #include "llviewerprecompiledheaders.h"
 
@@ -121,10 +121,10 @@ const U32 LLStatusBar::MAX_DATE_STRING_LENGTH = 2000;
 
 LLStatusBar::LLStatusBar(const std::string& name, const LLRect& rect)
 :	LLPanel(name, LLRect(), FALSE),		// not mouse opaque
-	mBalance(0),
-	mHealth(100),
-	mSquareMetersCredit(0),
-	mSquareMetersCommitted(0)
+mBalance(0),
+mHealth(100),
+mSquareMetersCredit(0),
+mSquareMetersCommitted(0)
 {
 	// status bar can possible overlay menus?
 	setMouseOpaque(FALSE);
@@ -150,7 +150,7 @@ LLStatusBar::LLStatusBar(const std::string& name, const LLRect& rect)
 
 	mTextHealth = getChild<LLTextBox>("HealthText" );
 	mTextTime = getChild<LLTextBox>("TimeText" );
-	
+
 	childSetAction("scriptout", onClickScriptDebug, this);
 	childSetAction("health", onClickHealth, this);
 	childSetAction("no_fly", onClickFly, this);
@@ -233,8 +233,8 @@ void LLStatusBar::draw()
 	if (isBackgroundVisible())
 	{
 		gl_drop_shadow(0, getRect().getHeight(), getRect().getWidth(), 0, 
-				LLUI::sColorsGroup->getColor("ColorDropShadow"), 
-				LLUI::sConfigGroup->getS32("DropShadowFloater") );
+			LLUI::sColorsGroup->getColor("ColorDropShadow"), 
+			LLUI::sConfigGroup->getS32("DropShadowFloater") );
 	}
 	LLPanel::draw();
 }
@@ -252,7 +252,7 @@ void LLStatusBar::refresh()
 	mSGBandwidth->setThreshold(2, bwtotal);
 
 	// *TODO: Localize / translate time
-	
+
 	// Get current UTC time, adjusted for the user's clock
 	// being off.
 	U32 utc_time;
@@ -284,23 +284,23 @@ void LLStatusBar::refresh()
 	if (hour == 0) hour = 12;
 	std::ostringstream t;
 	t << std::setfill(' ') << std::setw(2) << hour << ":" 
-	  << std::setfill('0') << std::setw(2) << min 
-	  << " " << am_pm << " " << tz;
+		<< std::setfill('0') << std::setw(2) << min 
+		<< " " << am_pm << " " << tz;
 	mTextTime->setText(t.str());
 
 	// Year starts at 1900, set the tooltip to have the date
 	std::ostringstream date;
 	date	<< sDays[internal_time->tm_wday] << ", "
-			<< std::setfill('0') << std::setw(2) << internal_time->tm_mday << " "
-			<< sMonths[internal_time->tm_mon] << " "
-			<< internal_time->tm_year + 1900;
+		<< std::setfill('0') << std::setw(2) << internal_time->tm_mday << " "
+		<< sMonths[internal_time->tm_mon] << " "
+		<< internal_time->tm_year + 1900;
 	mTextTime->setToolTip(date.str());
 
 	LLRect r;
 	const S32 MENU_RIGHT = gMenuBarView->getRightmostMenuEdge();
 	S32 x = MENU_RIGHT + MENU_PARCEL_SPACING;
 	S32 y = 0;
-	
+
 	bool search_visible = gSavedSettings.getBOOL("ShowSearchBar");
 
 	// reshape menu bar to its content's width
@@ -394,8 +394,8 @@ void LLStatusBar::refresh()
 	BOOL no_scripts = FALSE;
 	if((region
 		&& ((region->getRegionFlags() & REGION_FLAGS_SKIP_SCRIPTS)
-			|| (region->getRegionFlags() & REGION_FLAGS_ESTATE_SKIP_SCRIPTS)))
-	   || (parcel && !parcel->getAllowOtherScripts()))
+		|| (region->getRegionFlags() & REGION_FLAGS_ESTATE_SKIP_SCRIPTS)))
+		|| (parcel && !parcel->getAllowOtherScripts()))
 	{
 		no_scripts = TRUE;
 	}
@@ -487,15 +487,15 @@ void LLStatusBar::refresh()
 
 		mRegionDetails.mTime = mTextTime->getText();
 		mRegionDetails.mBalance = mBalance;
-		mRegionDetails.mAccesString = region->getSimAccessString();
+		mRegionDetails.mAccessString = region->getSimAccessString();
 		mRegionDetails.mPing = region->getNetDetailsForLCD();
-		if (parcel && !parcel->getName().empty())
+		if (parcel)
 		{
 			location_name = region->getName()
 				+ llformat(" %d, %d, %d (%s) - %s", 
-						   pos_x, pos_y, pos_z,
-						   region->getSimAccessString(),
-						   parcel->getName().c_str());
+				pos_x, pos_y, pos_z,
+				region->getSimAccessString(),
+				parcel->getName().c_str());
 
 			// keep these around for the LCD to use
 			mRegionDetails.mRegionName = region->getName();
@@ -503,6 +503,7 @@ void LLStatusBar::refresh()
 			mRegionDetails.mX = pos_x;
 			mRegionDetails.mY = pos_y;
 			mRegionDetails.mZ = pos_z;
+
 			mRegionDetails.mArea = parcel->getArea();
 			mRegionDetails.mForSale = parcel->getForSale();
 			mRegionDetails.mTraffic = LLViewerParcelMgr::getInstance()->getDwelling();
@@ -557,7 +558,7 @@ void LLStatusBar::refresh()
 		// keep these around for the LCD to use
 		mRegionDetails.mRegionName = "Unknown";
 		mRegionDetails.mParcelName = "Unknown";
-		mRegionDetails.mAccesString = "Unknown";
+		mRegionDetails.mAccessString = "Unknown";
 		mRegionDetails.mX = 0;
 		mRegionDetails.mY = 0;
 		mRegionDetails.mZ = 0;
diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h
index 91bc787485fa5468003336c4bbe3b788e556d1e9..99bac2471f0a00075df1b5f6e9a3365d7fcdecc7 100644
--- a/indra/newview/llstatusbar.h
+++ b/indra/newview/llstatusbar.h
@@ -54,7 +54,7 @@ public:
 	LLRegionDetails() :
 		mRegionName("Unknown"),
 		mParcelName("Unknown"),
-		mAccesString("Unknown"),
+		mAccessString("Unknown"),
 		mX(0),
 		mY(0),
 		mZ(0),
@@ -68,7 +68,7 @@ public:
 	}
 	std::string mRegionName;
 	std::string	mParcelName;
-	std::string	mAccesString;
+	std::string	mAccessString;
 	S32		mX;
 	S32		mY;
 	S32		mZ;
diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp
index 6618e3d6315a657f97e76e1688c381b9f4dea3be..fa85d893881abb5ea334b60a7fed671bf87e1ebd 100644
--- a/indra/newview/llsurface.cpp
+++ b/indra/newview/llsurface.cpp
@@ -73,7 +73,9 @@ LLSurface::LLSurface(U32 type, LLViewerRegion *regionp) :
 	mGridsPerEdge(0),
 	mOOGridsPerEdge(0.f),
 	mPatchesPerEdge(0),
+	mNumberOfPatches(0),
 	mType(type),
+	mDetailTextureScale(0.f),
 	mOriginGlobal(0.0, 0.0, 0.0),
 	mSTexturep(NULL),
 	mWaterTexturep(NULL),
diff --git a/indra/newview/llsurface.h b/indra/newview/llsurface.h
index c806d804f1b3a8d994db9d598880f69383fc249d..4e57d7017d06533d06188c292ef7da0c46823603 100644
--- a/indra/newview/llsurface.h
+++ b/indra/newview/llsurface.h
@@ -217,9 +217,6 @@ protected:
 	F32			mMetersPerGrid;				// Converts (i,j) indecies to distance
 	F32			mMetersPerEdge;				// = mMetersPerGrid * (mGridsPerEdge-1)
 
-	F32			mSurfaceTexScale;			// Scale factors for automatic tex coord generation
-	F32			mDetailTexScale;
-
 	LLPatchVertexArray mPVArray;
 
 	BOOL		mHasZData;				// We've received any patch data for this surface.
diff --git a/indra/newview/llsurfacepatch.cpp b/indra/newview/llsurfacepatch.cpp
index 7a475f21ba6c85e5bd7db9339b0e27eab2de88fa..2877fc66e359d02f674c681a0bbe715e552f84ac 100644
--- a/indra/newview/llsurfacepatch.cpp
+++ b/indra/newview/llsurfacepatch.cpp
@@ -52,28 +52,29 @@ extern U64 gFrameTime;
 extern LLPipeline gPipeline;
 
 LLSurfacePatch::LLSurfacePatch() :
-						mDataZ(NULL),
-						mVObjp(NULL),
-						mLastUpdateTime(0),
-						mSurfacep(NULL)
-{
-	// This flag is used to communicate between adjacent surfaces and is set
-	// to non-zero values by higher classes.  
-	mConnectedEdge = NO_EDGE;
-	mCenterRegion = LLVector3(0.f, 0.f, 0.f);
-	mOriginRegion = LLVector3(0.f, 0.f, 0.f);
-	mHasReceivedData = FALSE;
-	mMinZ = 0.0f;
-	mMaxZ = 0.0f;
-	mMeanZ = 0.0f;
-	mMinComposition = 0.f;
-	mMeanComposition = 0.f;
-	mMaxComposition = 0.f;
-	mRadius = 0.f;
-	mDirty = FALSE;
-	mDirtyZStats = TRUE;
-	mHeightsGenerated = FALSE;
-	
+	mHasReceivedData(FALSE),
+	mSTexUpdate(FALSE),
+	mDirty(FALSE),
+	mDirtyZStats(TRUE),
+	mHeightsGenerated(FALSE),
+	mDataOffset(0),
+	mDataZ(NULL),
+	mVObjp(NULL),
+	mOriginRegion(0.f, 0.f, 0.f),
+	mCenterRegion(0.f, 0.f, 0.f),
+	mMinZ(0.f),
+	mMaxZ(0.f),
+	mMeanZ(0.f),
+	mRadius(0.f),
+	mMinComposition(0.f),
+	mMaxComposition(0.f),
+	mMeanComposition(0.f),
+	// This flag is used to communicate between adjacent surfaces and is
+	// set to non-zero values by higher classes.  
+	mConnectedEdge(NO_EDGE),
+	mLastUpdateTime(0),
+	mSurfacep(NULL)
+{	
 	S32 i;
 	for (i = 0; i < 8; i++)
 	{
diff --git a/indra/newview/llsurfacepatch.h b/indra/newview/llsurfacepatch.h
index 0f91e7715e613278900aadb194afde6838eb388d..c1f9fda8605fc0b0e7dfda08e4471d5f42dcab91 100644
--- a/indra/newview/llsurfacepatch.h
+++ b/indra/newview/llsurfacepatch.h
@@ -44,9 +44,17 @@ class LLAgent;
 
 // A patch shouldn't know about its visibility since that really depends on the 
 // camera that is looking (or not looking) at it.  So, anything about a patch
-// that is specific to a camera should be in the struct below.
-struct LLPatchVisibilityInfo
+// that is specific to a camera should be in the class below.
+class LLPatchVisibilityInfo
 {
+public:
+	LLPatchVisibilityInfo() :
+		mbIsVisible(FALSE),
+		mDistance(0.f),
+		mRenderLevel(0),
+		mRenderStride(0) { };
+	~LLPatchVisibilityInfo() { };
+
 	BOOL mbIsVisible;
 	F32 mDistance;			// Distance from camera
 	S32 mRenderLevel;
@@ -153,7 +161,7 @@ protected:
 	// Pointer to the LLVOSurfacePatch object which is used in the new renderer.
 	LLPointer<LLVOSurfacePatch> mVObjp;
 
-	// All of the camera-dependent stuff should be in its own structure...
+	// All of the camera-dependent stuff should be in its own class...
 	LLPatchVisibilityInfo mVisInfo;
 
 	// pointers to beginnings of patch data fields
diff --git a/indra/newview/lltoolgrab.cpp b/indra/newview/lltoolgrab.cpp
index 94501507ab54126baedc044a8c8e7a91c8a375ed..5073be3173e43412ebbb234eb8ca07eac2e47049 100644
--- a/indra/newview/lltoolgrab.cpp
+++ b/indra/newview/lltoolgrab.cpp
@@ -81,9 +81,16 @@ LLToolGrab::LLToolGrab( LLToolComposite* composite )
 	mHitLand(FALSE),
 	mHitObjectID(),
 	mGrabObject( NULL ),
+	mLastMouseX(0),
+	mLastMouseY(0),
 	mMouseDownX( -1 ),
 	mMouseDownY( -1 ),
+	mMouseMask(0),
+	mAccumDeltaX(0),
+	mAccumDeltaY(0),
 	mHasMoved( FALSE ),
+	mOutsideSlop(FALSE),
+	mDeselectedThisClick(FALSE),
 	mSpinGrabbing( FALSE ),
 	mSpinRotation(),
 	mHideBuildHighlight(FALSE)
diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp
index 874608d066cad91b5bf1802401776140e25056f1..5647b6be5a8a0d415302835ba153feb6e8091dca 100644
--- a/indra/newview/lltracker.cpp
+++ b/indra/newview/lltracker.cpp
@@ -90,7 +90,8 @@ LLTracker::LLTracker()
 	mHasLandmarkPosition(FALSE),
 	mLandmarkHasBeenVisited(FALSE),
 	mTrackedLocationName( "" ),
-	mIsTrackingLocation(FALSE)
+	mIsTrackingLocation(FALSE),
+	mHasReachedLocation(FALSE)
 { }
 
 
diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp
index 00473439a3445f064f007b91cb7d9f7643c2d4d4..a5032c5a301e95d56be0f1bb753e0b6d376fe226 100644
--- a/indra/newview/llviewerkeyboard.cpp
+++ b/indra/newview/llviewerkeyboard.cpp
@@ -564,7 +564,8 @@ void bind_keyboard_functions()
 	gViewerKeyboard.bindNamedFunction("start_gesture", start_gesture);
 }
 
-LLViewerKeyboard::LLViewerKeyboard()
+LLViewerKeyboard::LLViewerKeyboard() :
+	mNamedFunctionCount(0)
 {
 	for (S32 i = 0; i < MODE_COUNT; i++)
 	{
diff --git a/indra/newview/llviewerkeyboard.h b/indra/newview/llviewerkeyboard.h
index fd024d09021da88a1f5f90cd3050f091e721f0c5..df31e17c700a15d3d9bd686d03eace6e5c211d56 100644
--- a/indra/newview/llviewerkeyboard.h
+++ b/indra/newview/llviewerkeyboard.h
@@ -40,6 +40,9 @@ const S32 MAX_KEY_BINDINGS = 128; // was 60
 class LLNamedFunction
 {
 public:
+	LLNamedFunction() : mName(NULL), mFunction(NULL) { };
+	~LLNamedFunction() { };
+
 	const char *mName;
 	LLKeyFunc	mFunction;
 };
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index b902599e88eb1e55d79bfee249f9940c7dec37d1..7a6f87e019f13c188030d075ca5e6ac809262e72 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -1505,6 +1505,7 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port)
 ////////////////////////////////////////////////////////////////////////////
 
 LLViewerObjectList::OrphanInfo::OrphanInfo()
+	: mParentInfo(0)
 {
 }
 
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp
index 61aa51a6d86272a1544f412f10b3589de1b32d6e..f14d206b7f6be0ab5feb696ac6f34e0f77b8e28c 100644
--- a/indra/newview/llviewerparcelmgr.cpp
+++ b/indra/newview/llviewerparcelmgr.cpp
@@ -112,16 +112,20 @@ struct LLGodForceOwnerData
 //
 LLViewerParcelMgr::LLViewerParcelMgr()
 :	mSelected(FALSE),
+	mRequestResult(0),
 	mWestSouth(),
 	mEastNorth(),
 	mSelectedDwell(0.f),
 	mAgentParcelSequenceID(-1),
+	mHoverRequestResult(0),
 	mHoverWestSouth(),
 	mHoverEastNorth(),
 	mRenderCollision(FALSE),
 	mRenderSelection(TRUE),
 	mCollisionBanned(0),
-	mCollisionTimer()
+	mCollisionTimer(),
+	mMediaParcelId(0),
+	mMediaRegionId(0)
 {
 	mCurrentParcel = new LLParcel();
 	mCurrentParcelSelection = new LLParcelSelection(mCurrentParcel);
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index d3b7a77297f15d89e7beefd0142ed51bd336f8d9..632526c0614346b333ddba06562604ec22ee09fe 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -1394,6 +1394,7 @@ void LLViewerRegion::setSeedCapability(const std::string& url)
 	capabilityNames.append("SendUserReportWithScreenshot");
 	capabilityNames.append("ServerReleaseNotes");
 	capabilityNames.append("StartGroupProposal");
+	capabilityNames.append("UpdateAgentLanguage");
 	capabilityNames.append("UpdateGestureAgentInventory");
 	capabilityNames.append("UpdateNotecardAgentInventory");
 	capabilityNames.append("UpdateScriptAgentInventory");
diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp
index 96f69e947221daa28d3bee87f6c20ffcccdd9274..21ba12324c63f3b82e7dfe429fab1ac035cb6f56 100644
--- a/indra/newview/llvoiceclient.cpp
+++ b/indra/newview/llvoiceclient.cpp
@@ -218,6 +218,19 @@ void LLVivoxProtocolParser::reset()
 	ignoringTags = false;
 	accumulateText = false;
 	textBuffer.clear();
+
+	energy = 0.f;
+	ignoreDepth = 0;
+	isChannel = false;
+	isEvent = false;
+	isLocallyMuted = false;
+	isModeratorMuted = false;
+	isSpeaking = false;
+	participantType = 0;
+	returnCode = 0;
+	state = 0;
+	statusCode = 0;
+	volume = 0;
 }
 
 //virtual 
@@ -1329,6 +1342,7 @@ void LLVoiceClient::stateMachine()
 
 							fakeargv[i] = NULL;
 							
+							fflush(NULL); // flush all buffers before the child inherits them
 							pid_t id = vfork();
 							if(id == 0)
 							{
@@ -3018,7 +3032,7 @@ void LLVoiceClient::muteListChanged()
 /////////////////////////////
 // Managing list of participants
 LLVoiceClient::participantState::participantState(const std::string &uri) : 
-	 mURI(uri), mPTT(false), mIsSpeaking(false), mIsModeratorMuted(false), mPower(0.0), mServiceType(serviceTypeUnknown),
+	 mURI(uri), mPTT(false), mIsSpeaking(false), mIsModeratorMuted(false), mLastSpokeTimestamp(0.f), mPower(0.f), mVolume(0), mServiceType(serviceTypeUnknown),
 	 mOnMuteList(false), mUserVolume(100), mVolumeDirty(false), mAvatarIDValid(false)
 {
 }
diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp
index f1e0a6b55f75cf8d70d01354774eb78b5000f098..3068f2cbb1887dcf66bc57cc3ded5a72246ff46f 100644
--- a/indra/newview/llworld.cpp
+++ b/indra/newview/llworld.cpp
@@ -88,10 +88,6 @@ LLWorld::LLWorld() :
 	mLastPacketsIn(0),
 	mLastPacketsOut(0),
 	mLastPacketsLost(0),
-	mMinRegionX(0),
-	mMaxRegionX(0),
-	mMinRegionY(0),
-	mMaxRegionY(0),
 	mSpaceTimeUSec(0)
 {
 	for (S32 i = 0; i < 8; i++)
diff --git a/indra/newview/llworld.h b/indra/newview/llworld.h
index 9dd90480b629e7a18f5af1191029683218cf1264..d65c91a6a613fab59e1d6797b0cbae8a0b8f0b2b 100644
--- a/indra/newview/llworld.h
+++ b/indra/newview/llworld.h
@@ -170,22 +170,17 @@ private:
 	S32 mLastPacketsOut;
 	S32 mLastPacketsLost;
 
+	U64 mSpaceTimeUSec;
+
 	////////////////////////////
 	//
 	// Data for "Fake" objects
 	//
 
-	// Used to define the "Square" which we need to fill in
-	U32 mMinRegionX;
-	U32 mMaxRegionX;
-	U32 mMinRegionY;
-	U32 mMaxRegionY;
-
 	std::list<LLVOWater*> mHoleWaterObjects;
 	LLPointer<LLVOWater> mEdgeWaterObjects[8];
 
 	LLPointer<LLViewerImage> mDefaultWaterTexturep;
-	U64 mSpaceTimeUSec;
 };
 
 
diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp
index 6fc142eeabc25f24e52ce93116897a6a529f4f99..16b277f6a628d13bbc444bd74a434389f7cf0121 100644
--- a/indra/newview/llworldmap.cpp
+++ b/indra/newview/llworldmap.cpp
@@ -67,6 +67,7 @@ LLSimInfo::LLSimInfo()
 :	mHandle(0),
 	mName(),
 	mAgentsUpdateTime(0),
+	mShowAgentLocations(FALSE),
 	mAccess(0x0),
 	mRegionFlags(0x0),
 	mWaterHeight(0.f),