diff --git a/mozilla/content/xml/document/src/nsXMLContentSink.cpp b/mozilla/content/xml/document/src/nsXMLContentSink.cpp
index 349d1b3014f..7fb59fceecf 100644
--- a/mozilla/content/xml/document/src/nsXMLContentSink.cpp
+++ b/mozilla/content/xml/document/src/nsXMLContentSink.cpp
@@ -1454,7 +1454,7 @@ nsXMLContentSink::PushNameSpacesFrom(const PRUnichar** aAtts)
NS_ENSURE_TRUE(nameSpace, NS_ERROR_UNEXPECTED);
- static const NS_NAMED_LITERAL_STRING(kNameSpaceDef, "xmlns");
+ static NS_NAMED_LITERAL_STRING(kNameSpaceDef, "xmlns");
static const PRUint32 xmlns_len = kNameSpaceDef.Length();
diff --git a/mozilla/content/xul/document/src/nsXULContentSink.cpp b/mozilla/content/xul/document/src/nsXULContentSink.cpp
index bdbeaea48a4..d80997641f3 100644
--- a/mozilla/content/xul/document/src/nsXULContentSink.cpp
+++ b/mozilla/content/xul/document/src/nsXULContentSink.cpp
@@ -1145,7 +1145,7 @@ XULContentSinkImpl::PushNameSpacesFrom(const PRUnichar** aAttributes)
return NS_ERROR_OUT_OF_MEMORY;
}
- static const NS_NAMED_LITERAL_STRING(kNameSpaceDef, "xmlns");
+ static NS_NAMED_LITERAL_STRING(kNameSpaceDef, "xmlns");
static const PRUint32 xmlns_len = kNameSpaceDef.Length();
for (; *aAttributes; aAttributes += 2) {
diff --git a/mozilla/extensions/webservices/soap/src/nsSOAPMessage.cpp b/mozilla/extensions/webservices/soap/src/nsSOAPMessage.cpp
index fea52dbfbf0..edc2c9884ef 100644
--- a/mozilla/extensions/webservices/soap/src/nsSOAPMessage.cpp
+++ b/mozilla/extensions/webservices/soap/src/nsSOAPMessage.cpp
@@ -271,9 +271,9 @@ NS_IMETHODIMP
PRUint32 aParameterCount,
nsISOAPParameter ** aParameters)
{
- static const NS_NAMED_LITERAL_STRING(realEmptySOAPDocStr1,
+ static NS_NAMED_LITERAL_STRING(realEmptySOAPDocStr1,
"");
- static const NS_NAMED_LITERAL_STRING(realEmptySOAPDocStr2,
+ static NS_NAMED_LITERAL_STRING(realEmptySOAPDocStr2,
"");
static const nsAString *kEmptySOAPDocStr[] = {
&realEmptySOAPDocStr1, &realEmptySOAPDocStr2
diff --git a/mozilla/js/src/xpconnect/src/xpcconvert.cpp b/mozilla/js/src/xpconnect/src/xpcconvert.cpp
index 138085a559a..01fec4e99cd 100644
--- a/mozilla/js/src/xpconnect/src/xpcconvert.cpp
+++ b/mozilla/js/src/xpconnect/src/xpcconvert.cpp
@@ -661,8 +661,8 @@ XPCConvert::JSData2Native(XPCCallContext& ccx, void* d, jsval s,
}
case nsXPTType::T_DOMSTRING:
{
- static const NS_NAMED_LITERAL_STRING(sEmptyString, "");
- static const NS_NAMED_LITERAL_STRING(sVoidString, "undefined");
+ static NS_NAMED_LITERAL_STRING(sEmptyString, "");
+ static NS_NAMED_LITERAL_STRING(sVoidString, "undefined");
const PRUnichar* chars;
JSString* str = nsnull;
diff --git a/mozilla/js/src/xpconnect/tests/TestXPC.cpp b/mozilla/js/src/xpconnect/tests/TestXPC.cpp
index aa87f004a04..592a3bba941 100644
--- a/mozilla/js/src/xpconnect/tests/TestXPC.cpp
+++ b/mozilla/js/src/xpconnect/tests/TestXPC.cpp
@@ -439,7 +439,7 @@ TestArgFormatter(JSContext* jscontext, JSObject* glob, nsIXPConnect* xpc)
const char* a_in = "some string";
nsCOMPtr b_in = new nsTestXPCFoo();
nsCOMPtr c_in = do_CreateInstance("@mozilla.org/variant;1");
- static const NS_NAMED_LITERAL_STRING(d_in, "foo bar");
+ static NS_NAMED_LITERAL_STRING(d_in, "foo bar");
const char* e_in = "another meaningless chunck of text";
diff --git a/mozilla/parser/htmlparser/src/nsHTMLTokens.cpp b/mozilla/parser/htmlparser/src/nsHTMLTokens.cpp
index 19dd270b141..4294df9b203 100644
--- a/mozilla/parser/htmlparser/src/nsHTMLTokens.cpp
+++ b/mozilla/parser/htmlparser/src/nsHTMLTokens.cpp
@@ -524,7 +524,7 @@ nsresult CTextToken::ConsumeUntil(PRUnichar aChar,PRBool aIgnoreComments,nsScann
// assume that the prematured terminal string is the actual terminal string and goto step 1. This
// will be our last iteration.
- const NS_NAMED_LITERAL_STRING(ltslash, "");
+ NS_NAMED_LITERAL_STRING(ltslash, "");
const nsString theTerminalString = ltslash + aEndTagName;
PRUint32 termStrLen=theTerminalString.Length();
diff --git a/mozilla/xpcom/string/public/nsLiteralString.h b/mozilla/xpcom/string/public/nsLiteralString.h
index e90980d84a3..9d6b4734e09 100644
--- a/mozilla/xpcom/string/public/nsLiteralString.h
+++ b/mozilla/xpcom/string/public/nsLiteralString.h
@@ -82,13 +82,13 @@ literal_string( const nsACString::char_type* aPtr, PRUint32 aLength )
#define NS_LL(s) L##s
#define NS_MULTILINE_LITERAL_STRING(s) nsDependentString(NS_REINTERPRET_CAST(const nsAString::char_type*, s), PRUint32((sizeof(s)/sizeof(wchar_t))-1))
#define NS_MULTILINE_LITERAL_STRING_INIT(n,s) n(NS_REINTERPRET_CAST(const nsAString::char_type*, s), PRUint32((sizeof(s)/sizeof(wchar_t))-1))
- #define NS_NAMED_MULTILINE_LITERAL_STRING(n,s) nsDependentString n(NS_REINTERPRET_CAST(const nsAString::char_type*, s), PRUint32((sizeof(s)/sizeof(wchar_t))-1))
+ #define NS_NAMED_MULTILINE_LITERAL_STRING(n,s) const nsDependentString n(NS_REINTERPRET_CAST(const nsAString::char_type*, s), PRUint32((sizeof(s)/sizeof(wchar_t))-1))
typedef nsDependentString nsLiteralString;
#else
#define NS_LL(s) s
#define NS_MULTILINE_LITERAL_STRING(s) NS_ConvertASCIItoUTF16(s, PRUint32(sizeof(s)-1))
#define NS_MULTILINE_LITERAL_STRING_INIT(n,s) n(s, PRUint32(sizeof(s)-1))
- #define NS_NAMED_MULTILINE_LITERAL_STRING(n,s) NS_ConvertASCIItoUTF16 n(s, PRUint32(sizeof(s)-1))
+ #define NS_NAMED_MULTILINE_LITERAL_STRING(n,s) const NS_ConvertASCIItoUTF16 n(s, PRUint32(sizeof(s)-1))
typedef NS_ConvertASCIItoUTF16 nsLiteralString;
#endif
@@ -107,9 +107,9 @@ literal_string( const nsACString::char_type* aPtr, PRUint32 aLength )
#define NS_LITERAL_STRING_INIT(n,s) NS_MULTILINE_LITERAL_STRING_INIT(n, NS_LL(s))
#define NS_NAMED_LITERAL_STRING(n,s) NS_NAMED_MULTILINE_LITERAL_STRING(n, NS_LL(s))
-#define NS_LITERAL_CSTRING(s) nsDependentCString(s, PRUint32(sizeof(s)-1))
+#define NS_LITERAL_CSTRING(s) NS_STATIC_CAST(const nsAFlatCString&, nsDependentCString(s, PRUint32(sizeof(s)-1)))
#define NS_LITERAL_CSTRING_INIT(n,s) n(s, PRUint32(sizeof(s)-1))
-#define NS_NAMED_LITERAL_CSTRING(n,s) nsDependentCString n(s, PRUint32(sizeof(s)-1))
+#define NS_NAMED_LITERAL_CSTRING(n,s) const nsDependentCString n(s, PRUint32(sizeof(s)-1))
typedef nsDependentCString nsLiteralCString;
diff --git a/mozilla/xpfe/components/history/src/nsGlobalHistory.cpp b/mozilla/xpfe/components/history/src/nsGlobalHistory.cpp
index e0c6c7d694b..b505a3bd3b8 100644
--- a/mozilla/xpfe/components/history/src/nsGlobalHistory.cpp
+++ b/mozilla/xpfe/components/history/src/nsGlobalHistory.cpp
@@ -4264,12 +4264,12 @@ nsGlobalHistory::AutoCompleteSearch(const nsAString& aSearchString,
AutoCompleteSortClosure closure;
closure.history = this;
closure.prefixCount = AUTOCOMPLETE_PREFIX_LIST_COUNT;
- closure.prefixes[0] = NS_STATIC_CAST(nsAFlatString*, &prefixHWStr);
- closure.prefixes[1] = NS_STATIC_CAST(nsAFlatString*, &prefixHStr);
- closure.prefixes[2] = NS_STATIC_CAST(nsAFlatString*, &prefixHSWStr);
- closure.prefixes[3] = NS_STATIC_CAST(nsAFlatString*, &prefixHSStr);
- closure.prefixes[4] = NS_STATIC_CAST(nsAFlatString*, &prefixFFStr);
- closure.prefixes[5] = NS_STATIC_CAST(nsAFlatString*, &prefixFStr);
+ closure.prefixes[0] = &prefixHWStr;
+ closure.prefixes[1] = &prefixHStr;
+ closure.prefixes[2] = &prefixHSWStr;
+ closure.prefixes[3] = &prefixHSStr;
+ closure.prefixes[4] = &prefixFFStr;
+ closure.prefixes[5] = &prefixFStr;
// sort it
NS_QuickSort(items, count, sizeof(nsIAutoCompleteItem*),
diff --git a/mozilla/xpfe/components/history/src/nsGlobalHistory.h b/mozilla/xpfe/components/history/src/nsGlobalHistory.h
index c44dc41091a..8f487444db8 100644
--- a/mozilla/xpfe/components/history/src/nsGlobalHistory.h
+++ b/mozilla/xpfe/components/history/src/nsGlobalHistory.h
@@ -232,7 +232,7 @@ protected:
{
nsGlobalHistory* history;
size_t prefixCount;
- nsAFlatString* prefixes[AUTOCOMPLETE_PREFIX_LIST_COUNT];
+ const nsAFlatString* prefixes[AUTOCOMPLETE_PREFIX_LIST_COUNT];
};
// caching of PR_Now() so we don't call it every time we do