From fd1efd70c84651cf19dcebbc8f0e5b38659d0acb Mon Sep 17 00:00:00 2001 From: "scc%mozilla.org" Date: Mon, 12 Jun 2000 23:52:31 +0000 Subject: [PATCH] fix type equivalence between |PRUnichar| and |jschar| now that |PRUnchar| may be |wchar_t| on select platforms git-svn-id: svn://10.0.0.236/trunk@72073 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/base/src/nsDocument.cpp | 2 +- mozilla/content/base/src/nsGenericElement.cpp | 2 +- .../html/content/src/nsHTMLImageElement.cpp | 2 +- .../html/content/src/nsHTMLOptionElement.cpp | 4 ++-- .../html/document/src/nsHTMLDocument.cpp | 2 +- mozilla/content/xbl/src/nsXBLBinding.cpp | 4 ++-- .../xul/document/src/nsXULDocument.cpp | 2 +- mozilla/dom/src/base/nsGlobalWindow.cpp | 22 +++++++++---------- mozilla/dom/src/base/nsJSEnvironment.cpp | 10 ++++----- mozilla/dom/src/base/nsJSMimeTypeArray.cpp | 2 +- mozilla/dom/src/base/nsJSPlugin.cpp | 2 +- mozilla/dom/src/base/nsJSPluginArray.cpp | 2 +- mozilla/dom/src/base/nsJSUtils.cpp | 8 +++---- mozilla/dom/src/base/nsJSWindowCollection.cpp | 2 +- mozilla/dom/src/html/nsJSHTMLCollection.cpp | 2 +- .../dom/src/html/nsJSHTMLSelectElement.cpp | 2 +- .../src/html/nsJSNSHTMLOptionCollection.cpp | 2 +- .../intl/uconv/src/nsUnicodeDecodeHelper.cpp | 8 +++---- .../intl/uconv/src/nsUnicodeEncodeHelper.cpp | 4 ++-- .../unicharutil/src/nsCaseConversionImp2.cpp | 4 ++-- .../xpconnect/loader/mozJSComponentLoader.cpp | 2 +- mozilla/layout/base/src/nsDocument.cpp | 2 +- mozilla/layout/base/src/nsGenericElement.cpp | 2 +- .../html/content/src/nsHTMLImageElement.cpp | 2 +- .../html/content/src/nsHTMLOptionElement.cpp | 4 ++-- .../html/document/src/nsHTMLDocument.cpp | 2 +- mozilla/layout/xbl/src/nsXBLBinding.cpp | 4 ++-- mozilla/rdf/content/src/nsXULDocument.cpp | 2 +- mozilla/widget/src/mac/nsMacControl.cpp | 4 ++-- mozilla/widget/src/mac/nsMacEventHandler.cpp | 6 ++--- mozilla/widget/src/mac/nsMenu.cpp | 6 ++--- mozilla/widget/src/mac/nsMenuBar.cpp | 2 +- .../src/xpwidgets/nsPrimitiveHelpers.cpp | 2 +- mozilla/xpinstall/src/nsJSFile.cpp | 4 ++-- mozilla/xpinstall/src/nsJSInstall.cpp | 12 +++++----- .../src/nsJSInstallTriggerGlobal.cpp | 6 ++--- mozilla/xpinstall/src/nsSoftwareUpdateRun.cpp | 4 ++-- 37 files changed, 77 insertions(+), 77 deletions(-) diff --git a/mozilla/content/base/src/nsDocument.cpp b/mozilla/content/base/src/nsDocument.cpp index e942acae45e..ccf5d68392e 100644 --- a/mozilla/content/base/src/nsDocument.cpp +++ b/mozilla/content/base/src/nsDocument.cpp @@ -3046,7 +3046,7 @@ PRBool nsDocument::SetProperty(JSContext *aContext, JSObject *aObj, jsval aID if (JS_TypeOfValue(aContext, *aVp) == JSTYPE_FUNCTION && JSVAL_IS_STRING(aID)) { nsAutoString mPropName, mPrefix; - mPropName.Assign(JS_GetStringChars(JS_ValueToString(aContext, aID))); + mPropName.Assign(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(JS_ValueToString(aContext, aID)))); if (mPropName.Length() > 2) mPrefix.Assign(mPropName.GetUnicode(), 2); if (mPrefix.EqualsWithConversion("on")) { diff --git a/mozilla/content/base/src/nsGenericElement.cpp b/mozilla/content/base/src/nsGenericElement.cpp index 7a8671a0d8e..f9459a25af0 100644 --- a/mozilla/content/base/src/nsGenericElement.cpp +++ b/mozilla/content/base/src/nsGenericElement.cpp @@ -1673,7 +1673,7 @@ nsGenericElement::SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, js if (JS_TypeOfValue(aContext, *aVp) == JSTYPE_FUNCTION && JSVAL_IS_STRING(aID)) { nsAutoString propName, prefix; - propName.Assign(JS_GetStringChars(JS_ValueToString(aContext, aID))); + propName.Assign(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(JS_ValueToString(aContext, aID)))); if (propName.Length() > 2) prefix.Assign(propName.GetUnicode(), 2); if (prefix.EqualsWithConversion("on")) { diff --git a/mozilla/content/html/content/src/nsHTMLImageElement.cpp b/mozilla/content/html/content/src/nsHTMLImageElement.cpp index cce6e0c4581..7512f979509 100644 --- a/mozilla/content/html/content/src/nsHTMLImageElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLImageElement.cpp @@ -680,7 +680,7 @@ nsHTMLImageElement::SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, // Get the parameter passed in JSString *jsstring; if ((jsstring = JS_ValueToString(aContext, *aVp)) != nsnull) { - src.Assign(JS_GetStringChars(jsstring)); + src.Assign(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(jsstring))); } else { src.Truncate(); diff --git a/mozilla/content/html/content/src/nsHTMLOptionElement.cpp b/mozilla/content/html/content/src/nsHTMLOptionElement.cpp index 4eefc716dcb..6c18b5ce661 100644 --- a/mozilla/content/html/content/src/nsHTMLOptionElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLOptionElement.cpp @@ -686,7 +686,7 @@ nsHTMLOptionElement::Initialize(JSContext* aContext, return result; } - result = content->SetText(JS_GetStringChars(jsstr), + result = content->SetText(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(jsstr)), JS_GetStringLength(jsstr), PR_FALSE); NS_RELEASE(content); @@ -706,7 +706,7 @@ nsHTMLOptionElement::Initialize(JSContext* aContext, jsstr = JS_ValueToString(aContext, argv[1]); if (nsnull != jsstr) { // Set the value attribute for this element - nsAutoString value(JS_GetStringChars(jsstr)); + nsAutoString value(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(jsstr))); result = mInner.SetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::value, diff --git a/mozilla/content/html/document/src/nsHTMLDocument.cpp b/mozilla/content/html/document/src/nsHTMLDocument.cpp index b1ec5b2ae1c..a4ab174f4a1 100644 --- a/mozilla/content/html/document/src/nsHTMLDocument.cpp +++ b/mozilla/content/html/document/src/nsHTMLDocument.cpp @@ -2145,7 +2145,7 @@ nsHTMLDocument::ScriptWriteCommon(JSContext *cx, JSString *jsstring = JS_ValueToString(cx, argv[index]); if (nsnull != jsstring) { - str.Append(JS_GetStringChars(jsstring), JS_GetStringLength(jsstring)); + str.Append(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(jsstring)), JS_GetStringLength(jsstring)); } } diff --git a/mozilla/content/xbl/src/nsXBLBinding.cpp b/mozilla/content/xbl/src/nsXBLBinding.cpp index 83b4aa72138..8de46959f6e 100644 --- a/mozilla/content/xbl/src/nsXBLBinding.cpp +++ b/mozilla/content/xbl/src/nsXBLBinding.cpp @@ -916,7 +916,7 @@ nsXBLBinding::InstallProperties(nsIContent* aBoundElement) // destruction of any initial value that might be set. // This means we only have to worry about defining the getter // or setter. - ::JS_DefineUCProperty(cx, (JSObject*)classObject, name.GetUnicode(), + ::JS_DefineUCProperty(cx, (JSObject*)classObject, NS_REINTERPRET_CAST(const jschar*, name.GetUnicode()), name.Length(), JSVAL_VOID, (JSPropertyOp) getFunc, (JSPropertyOp) setFunc, @@ -949,7 +949,7 @@ nsXBLBinding::InstallProperties(nsIContent* aBoundElement) if (!undefined) { // Define that value as a property - ::JS_DefineUCProperty(cx, (JSObject*)scriptObject, name.GetUnicode(), + ::JS_DefineUCProperty(cx, (JSObject*)scriptObject, NS_REINTERPRET_CAST(const jschar*, name.GetUnicode()), name.Length(), result, nsnull, nsnull, attrs); diff --git a/mozilla/content/xul/document/src/nsXULDocument.cpp b/mozilla/content/xul/document/src/nsXULDocument.cpp index d60e66fb590..03add7d0af1 100644 --- a/mozilla/content/xul/document/src/nsXULDocument.cpp +++ b/mozilla/content/xul/document/src/nsXULDocument.cpp @@ -3739,7 +3739,7 @@ nsXULDocument::SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, jsval JSString* jsString = JS_ValueToString(aContext, *aVp); if (!jsString) return PR_FALSE; - nsAutoString title(JS_GetStringChars(jsString)); + nsAutoString title(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(jsString))); for (PRInt32 i = mPresShells.Count() - 1; i >= 0; --i) { nsIPresShell* shell = NS_STATIC_CAST(nsIPresShell*, mPresShells[i]); nsCOMPtr context; diff --git a/mozilla/dom/src/base/nsGlobalWindow.cpp b/mozilla/dom/src/base/nsGlobalWindow.cpp index fe0f70cfbf3..3b7fe058116 100644 --- a/mozilla/dom/src/base/nsGlobalWindow.cpp +++ b/mozilla/dom/src/base/nsGlobalWindow.cpp @@ -1231,7 +1231,7 @@ NS_IMETHODIMP GlobalWindowImpl::Prompt(JSContext* cx, jsval* argv, initial.GetUnicode(), &uniResult, &b); if (NS_SUCCEEDED(ret) && uniResult && b) { - JSString *jsret = JS_NewUCStringCopyZ(cx, uniResult); + JSString *jsret = JS_NewUCStringCopyZ(cx, NS_REINTERPRET_CAST(const jschar*, uniResult)); *aReturn = STRING_TO_JSVAL(jsret); } else @@ -1909,7 +1909,7 @@ PRBool GlobalWindowImpl::AddProperty(JSContext* aContext, JSObject* aObj, { nsString mPropName; nsAutoString mPrefix; - mPropName.Assign(JS_GetStringChars(JS_ValueToString(aContext, aID))); + mPropName.Assign(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(JS_ValueToString(aContext, aID)))); if(mPropName.Length() > 2) mPrefix.Assign(mPropName.GetUnicode(), 2); if(mPrefix.EqualsWithConversion("on")) @@ -1974,7 +1974,7 @@ PRBool GlobalWindowImpl::GetProperty(JSContext* aContext, JSObject* aObj, nsXPIDLString title; docShellAsWin->GetTitle(getter_Copies(title)); - JSString* jsString = JS_NewUCStringCopyZ(aContext, (const jschar*)title); + JSString* jsString = JS_NewUCStringCopyZ(aContext, NS_REINTERPRET_CAST(const jschar*, NS_STATIC_CAST(const PRUnichar*, title))); if (!jsString) return PR_FALSE; @@ -2004,7 +2004,7 @@ PRBool GlobalWindowImpl::SetProperty(JSContext* aContext, JSObject* aObj, { nsAutoString propName; nsAutoString prefix; - propName.Assign(JS_GetStringChars(JS_ValueToString(aContext, aID))); + propName.Assign(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(JS_ValueToString(aContext, aID)))); if(propName.Length() > 2) { prefix.Assign(propName.GetUnicode(), 2); @@ -2051,7 +2051,7 @@ PRBool GlobalWindowImpl::SetProperty(JSContext* aContext, JSObject* aObj, } else { - const PRUnichar* uniTitle = JS_GetStringChars(jsString); + const PRUnichar* uniTitle = NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(jsString)); docShellAsWin->SetTitle(uniTitle); } } @@ -2351,7 +2351,7 @@ NS_IMETHODIMP GlobalWindowImpl::SetObjectProperty(const PRUnichar* aProperty, cx, (JSObject*)mScriptObject, &propertyVal); NS_ENSURE_TRUE(JS_FALSE != JS_SetUCProperty(cx, (JSObject*)mScriptObject, - aProperty, nsCRT::strlen(aProperty), &propertyVal), NS_ERROR_FAILURE); + NS_REINTERPRET_CAST(const jschar*, aProperty), nsCRT::strlen(aProperty), &propertyVal), NS_ERROR_FAILURE); return NS_OK; } @@ -2374,7 +2374,7 @@ NS_IMETHODIMP GlobalWindowImpl::GetObjectProperty(const PRUnichar* aProperty, jsval propertyVal; - if(JS_FALSE == JS_LookupUCProperty(cx, (JSObject*)mScriptObject, aProperty, + if(JS_FALSE == JS_LookupUCProperty(cx, (JSObject*)mScriptObject, NS_REINTERPRET_CAST(const jschar*, aProperty), nsCRT::strlen(aProperty), &propertyVal)) return NS_ERROR_FAILURE; @@ -2560,7 +2560,7 @@ NS_IMETHODIMP GlobalWindowImpl::OpenInternal(JSContext* cx, jsval* argv, NS_ENSURE_TRUE(mJSStrURL, NS_ERROR_FAILURE); nsAutoString mURL; - mURL.Assign(JS_GetStringChars(mJSStrURL)); + mURL.Assign(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(mJSStrURL))); if(!mURL.IsEmpty()) { @@ -2583,7 +2583,7 @@ NS_IMETHODIMP GlobalWindowImpl::OpenInternal(JSContext* cx, jsval* argv, { // No document. Probably because this window's URL hasn't finished // loading. All we can do is hope the URL we've been given is absolute. - mAbsURL.Assign(JS_GetStringChars(mJSStrURL)); + mAbsURL.Assign(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(mJSStrURL))); // Make URI; if mAbsURL is relative (or otherwise bogus) this will fail. } NS_ENSURE_SUCCESS(NS_NewURI(getter_AddRefs(uriToLoad), mAbsURL), @@ -2597,7 +2597,7 @@ NS_IMETHODIMP GlobalWindowImpl::OpenInternal(JSContext* cx, jsval* argv, JSString *mJSStrName = JS_ValueToString(cx, argv[1]); NS_ENSURE_TRUE(mJSStrName, NS_ERROR_FAILURE); - name.Assign(JS_GetStringChars(mJSStrName)); + name.Assign(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(mJSStrName))); nameSpecified = PR_TRUE; // Check for an illegal name e.g. frame3.1 @@ -3323,7 +3323,7 @@ PRBool GlobalWindowImpl::RunTimeout(nsTimeoutImpl *aTimeout) if(timeout->expr) { /* Evaluate the timeout expression. */ - nsAutoString script = JS_GetStringChars(timeout->expr); + nsAutoString script = NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(timeout->expr)); nsAutoString blank; PRBool isUndefined; rv = mContext->EvaluateString(script, diff --git a/mozilla/dom/src/base/nsJSEnvironment.cpp b/mozilla/dom/src/base/nsJSEnvironment.cpp index 97056a31c42..ce0f9986329 100644 --- a/mozilla/dom/src/base/nsJSEnvironment.cpp +++ b/mozilla/dom/src/base/nsJSEnvironment.cpp @@ -123,8 +123,8 @@ NS_ScriptErrorReporter(JSContext *cx, fileUni.AssignWithConversion(report->filename); const PRUnichar *newFileUni = fileUni.ToNewUnicode(); PRUint32 column = report->uctokenptr - report->uclinebuf; - rv = errorObject->Init(report->ucmessage, newFileUni, - report->uclinebuf, report->lineno, + rv = errorObject->Init(NS_REINTERPRET_CAST(const PRUnichar*, report->ucmessage), newFileUni, + NS_REINTERPRET_CAST(const PRUnichar*, report->uclinebuf), report->lineno, column, report->flags, category); nsMemory::Free((void *)newFileUni); } else if (message) { @@ -153,7 +153,7 @@ NS_ScriptErrorReporter(JSContext *cx, error.AppendWithConversion(" line "); error.AppendInt(report->lineno, 10); error.AppendWithConversion(": "); - error.Append(report->ucmessage); + error.Append(NS_REINTERPRET_CAST(const PRUnichar*, report->ucmessage)); error.AppendWithConversion("\n"); if (status != nsEventStatus_eIgnore) error.AppendWithConversion("Error was suppressed by event handler\n"); @@ -475,7 +475,7 @@ nsJSContext::EvaluateString(const nsString& aScript, if (aIsUndefined) *aIsUndefined = JSVAL_IS_VOID(val); JSString* jsstring = ::JS_ValueToString(mContext, val); if (jsstring) - aRetValue.Assign(::JS_GetStringChars(jsstring)); + aRetValue.Assign(NS_REINTERPRET_CAST(const PRUnichar*, ::JS_GetStringChars(jsstring))); else rv = NS_ERROR_OUT_OF_MEMORY; } @@ -610,7 +610,7 @@ nsJSContext::ExecuteScript(void* aScriptObject, if (aRetValue) { JSString* jsstring = ::JS_ValueToString(mContext, val); if (jsstring) - aRetValue->Assign(::JS_GetStringChars(jsstring)); + aRetValue->Assign(NS_REINTERPRET_CAST(const PRUnichar*, ::JS_GetStringChars(jsstring))); else rv = NS_ERROR_OUT_OF_MEMORY; } diff --git a/mozilla/dom/src/base/nsJSMimeTypeArray.cpp b/mozilla/dom/src/base/nsJSMimeTypeArray.cpp index 66de719aea9..17b4421a63b 100644 --- a/mozilla/dom/src/base/nsJSMimeTypeArray.cpp +++ b/mozilla/dom/src/base/nsJSMimeTypeArray.cpp @@ -104,7 +104,7 @@ GetMimeTypeArrayProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) JSString *jsstring = JS_ValueToString(cx, id); if (nsnull != jsstring) { - name.Assign(JS_GetStringChars(jsstring)); + name.Assign(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(jsstring))); } else { name.SetLength(0); diff --git a/mozilla/dom/src/base/nsJSPlugin.cpp b/mozilla/dom/src/base/nsJSPlugin.cpp index a39d94b5e37..d2a327cf956 100644 --- a/mozilla/dom/src/base/nsJSPlugin.cpp +++ b/mozilla/dom/src/base/nsJSPlugin.cpp @@ -143,7 +143,7 @@ GetPluginProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) JSString *jsstring = JS_ValueToString(cx, id); if (nsnull != jsstring) { - name.Assign(JS_GetStringChars(jsstring)); + name.Assign(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(jsstring))); } else { name.SetLength(0); diff --git a/mozilla/dom/src/base/nsJSPluginArray.cpp b/mozilla/dom/src/base/nsJSPluginArray.cpp index 12678051954..7c57b406f0a 100644 --- a/mozilla/dom/src/base/nsJSPluginArray.cpp +++ b/mozilla/dom/src/base/nsJSPluginArray.cpp @@ -104,7 +104,7 @@ GetPluginArrayProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) JSString *jsstring = JS_ValueToString(cx, id); if (nsnull != jsstring) { - name.Assign(JS_GetStringChars(jsstring)); + name.Assign(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(jsstring))); } else { name.SetLength(0); diff --git a/mozilla/dom/src/base/nsJSUtils.cpp b/mozilla/dom/src/base/nsJSUtils.cpp index e628687f831..70f72dbc844 100644 --- a/mozilla/dom/src/base/nsJSUtils.cpp +++ b/mozilla/dom/src/base/nsJSUtils.cpp @@ -191,7 +191,7 @@ nsJSUtils::nsLookupGlobalName(nsISupports* aSupports, if (JSVAL_IS_STRING(aId)) { JSString* jsstring = JSVAL_TO_STRING(aId); - nsAutoString name(JS_GetStringChars(jsstring)); + nsAutoString name(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(jsstring))); nsIScriptNameSpaceManager* manager; nsIID classID; nsISupports* native; @@ -311,7 +311,7 @@ nsJSUtils::nsConvertStringToJSVal(const nsString& aProp, JSContext* aContext, jsval* aReturn) { - JSString *jsstring = JS_NewUCStringCopyN(aContext, aProp.GetUnicode(), aProp.Length()); + JSString *jsstring = JS_NewUCStringCopyN(aContext, NS_REINTERPRET_CAST(const jschar*, aProp.GetUnicode()), aProp.Length()); // set the return value *aReturn = STRING_TO_JSVAL(jsstring); } @@ -389,7 +389,7 @@ nsJSUtils::nsConvertJSValToString(nsString& aString, { JSString *jsstring; if ((jsstring = JS_ValueToString(aContext, aValue)) != nsnull) { - aString.Assign(JS_GetStringChars(jsstring)); + aString.Assign(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(jsstring))); } else { aString.Truncate(); @@ -493,7 +493,7 @@ nsJSUtils::nsGlobalResolve(JSContext* aContext, if (JSVAL_IS_STRING(aId)) { JSString* jsstring = JSVAL_TO_STRING(aId); - nsAutoString name(JS_GetStringChars(jsstring)); + nsAutoString name(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(jsstring))); nsIID classID; nsISupports* native; diff --git a/mozilla/dom/src/base/nsJSWindowCollection.cpp b/mozilla/dom/src/base/nsJSWindowCollection.cpp index 4850e39bf4e..be8b1c40a2f 100644 --- a/mozilla/dom/src/base/nsJSWindowCollection.cpp +++ b/mozilla/dom/src/base/nsJSWindowCollection.cpp @@ -104,7 +104,7 @@ GetWindowCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) JSString *jsstring = JS_ValueToString(cx, id); if (nsnull != jsstring) { - name.Assign(JS_GetStringChars(jsstring)); + name.Assign(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(jsstring))); } else { name.SetLength(0); diff --git a/mozilla/dom/src/html/nsJSHTMLCollection.cpp b/mozilla/dom/src/html/nsJSHTMLCollection.cpp index e5486a5731f..251cdc93adb 100644 --- a/mozilla/dom/src/html/nsJSHTMLCollection.cpp +++ b/mozilla/dom/src/html/nsJSHTMLCollection.cpp @@ -104,7 +104,7 @@ GetHTMLCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) JSString *jsstring = JS_ValueToString(cx, id); if (nsnull != jsstring) { - name.Assign(JS_GetStringChars(jsstring)); + name.Assign(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(jsstring))); } else { name.SetLength(0); diff --git a/mozilla/dom/src/html/nsJSHTMLSelectElement.cpp b/mozilla/dom/src/html/nsJSHTMLSelectElement.cpp index 6dbed7231dc..b70fd3c8b5d 100644 --- a/mozilla/dom/src/html/nsJSHTMLSelectElement.cpp +++ b/mozilla/dom/src/html/nsJSHTMLSelectElement.cpp @@ -252,7 +252,7 @@ GetHTMLSelectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) JSString *jsstring = JS_ValueToString(cx, id); if (nsnull != jsstring) { - name.Assign(JS_GetStringChars(jsstring)); + name.Assign(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(jsstring))); } else { name.SetLength(0); diff --git a/mozilla/dom/src/html/nsJSNSHTMLOptionCollection.cpp b/mozilla/dom/src/html/nsJSNSHTMLOptionCollection.cpp index a9d30ec28b3..26a6aadc9e4 100755 --- a/mozilla/dom/src/html/nsJSNSHTMLOptionCollection.cpp +++ b/mozilla/dom/src/html/nsJSNSHTMLOptionCollection.cpp @@ -117,7 +117,7 @@ GetNSHTMLOptionCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval JSString *jsstring = JS_ValueToString(cx, id); if (nsnull != jsstring) { - name.Assign(JS_GetStringChars(jsstring)); + name.Assign(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(jsstring))); } else { name.SetLength(0); diff --git a/mozilla/intl/uconv/src/nsUnicodeDecodeHelper.cpp b/mozilla/intl/uconv/src/nsUnicodeDecodeHelper.cpp index 63c17b136dd..c0d54e51987 100644 --- a/mozilla/intl/uconv/src/nsUnicodeDecodeHelper.cpp +++ b/mozilla/intl/uconv/src/nsUnicodeDecodeHelper.cpp @@ -115,13 +115,13 @@ NS_IMETHODIMP nsUnicodeDecodeHelper::ConvertByTable( nsresult res = NS_OK; while ((srcLen > 0) && (dest < destEnd)) { - if (!uScan(aShiftTable, NULL, (PRUint8 *)src, &med, srcLen, + if (!uScan(aShiftTable, NULL, (PRUint8 *)src, NS_REINTERPRET_CAST(PRUint16*, &med), srcLen, (PRUint32 *)&bcr)) { res = NS_OK_UDEC_MOREINPUT; break; } - if (!uMapCode((uTable*) aMappingTable, med, dest)) { + if (!uMapCode((uTable*) aMappingTable, NS_STATIC_CAST(PRUint16, med), NS_REINTERPRET_CAST(PRUint16*, dest))) { if (med < 0x20) { // somehow some table miss the 0x00 - 0x20 part *dest = med; @@ -173,13 +173,13 @@ NS_IMETHODIMP nsUnicodeDecodeHelper::ConvertByMultiTable( break; } - if (!uScan(aShiftTable[i], NULL, src, &med, srcLen, + if (!uScan(aShiftTable[i], NULL, src, NS_REINTERPRET_CAST(PRUint16*, &med), srcLen, (PRUint32 *)&bcr)) { res = NS_OK_UDEC_MOREINPUT; break; } - if (!uMapCode((uTable*) aMappingTable[i], med, dest)) { + if (!uMapCode((uTable*) aMappingTable[i], NS_STATIC_CAST(PRUint16, med), NS_REINTERPRET_CAST(PRUint16*, dest))) { if (med < 0x20) { // somehow some table miss the 0x00 - 0x20 part *dest = med; diff --git a/mozilla/intl/uconv/src/nsUnicodeEncodeHelper.cpp b/mozilla/intl/uconv/src/nsUnicodeEncodeHelper.cpp index 5b00b214ec1..9e80dc04867 100644 --- a/mozilla/intl/uconv/src/nsUnicodeEncodeHelper.cpp +++ b/mozilla/intl/uconv/src/nsUnicodeEncodeHelper.cpp @@ -109,7 +109,7 @@ NS_IMETHODIMP nsUnicodeEncodeHelper::ConvertByTable( nsresult res = NS_OK; while (src < srcEnd) { - if (!uMapCode((uTable*) aMappingTable, *(src++), &med)) { + if (!uMapCode((uTable*) aMappingTable, NS_STATIC_CAST(PRUnichar, *(src++)), NS_REINTERPRET_CAST(PRUint16*, &med))) { res = NS_ERROR_UENC_NOMAPPING; break; } @@ -151,7 +151,7 @@ NS_IMETHODIMP nsUnicodeEncodeHelper::ConvertByMultiTable( while (src < srcEnd) { for (i=0; iuctokenptr - rep->uclinebuf; - rv = errorObject->Init(rep->ucmessage, newFileUni, rep->uclinebuf, + rv = errorObject->Init(NS_REINTERPRET_CAST(const PRUnichar*, rep->ucmessage), newFileUni, NS_REINTERPRET_CAST(const PRUnichar*, rep->uclinebuf), rep->lineno, column, rep->flags, "component javascript"); nsMemory::Free((void *)newFileUni); diff --git a/mozilla/layout/base/src/nsDocument.cpp b/mozilla/layout/base/src/nsDocument.cpp index e942acae45e..ccf5d68392e 100644 --- a/mozilla/layout/base/src/nsDocument.cpp +++ b/mozilla/layout/base/src/nsDocument.cpp @@ -3046,7 +3046,7 @@ PRBool nsDocument::SetProperty(JSContext *aContext, JSObject *aObj, jsval aID if (JS_TypeOfValue(aContext, *aVp) == JSTYPE_FUNCTION && JSVAL_IS_STRING(aID)) { nsAutoString mPropName, mPrefix; - mPropName.Assign(JS_GetStringChars(JS_ValueToString(aContext, aID))); + mPropName.Assign(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(JS_ValueToString(aContext, aID)))); if (mPropName.Length() > 2) mPrefix.Assign(mPropName.GetUnicode(), 2); if (mPrefix.EqualsWithConversion("on")) { diff --git a/mozilla/layout/base/src/nsGenericElement.cpp b/mozilla/layout/base/src/nsGenericElement.cpp index 7a8671a0d8e..f9459a25af0 100644 --- a/mozilla/layout/base/src/nsGenericElement.cpp +++ b/mozilla/layout/base/src/nsGenericElement.cpp @@ -1673,7 +1673,7 @@ nsGenericElement::SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, js if (JS_TypeOfValue(aContext, *aVp) == JSTYPE_FUNCTION && JSVAL_IS_STRING(aID)) { nsAutoString propName, prefix; - propName.Assign(JS_GetStringChars(JS_ValueToString(aContext, aID))); + propName.Assign(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(JS_ValueToString(aContext, aID)))); if (propName.Length() > 2) prefix.Assign(propName.GetUnicode(), 2); if (prefix.EqualsWithConversion("on")) { diff --git a/mozilla/layout/html/content/src/nsHTMLImageElement.cpp b/mozilla/layout/html/content/src/nsHTMLImageElement.cpp index cce6e0c4581..7512f979509 100644 --- a/mozilla/layout/html/content/src/nsHTMLImageElement.cpp +++ b/mozilla/layout/html/content/src/nsHTMLImageElement.cpp @@ -680,7 +680,7 @@ nsHTMLImageElement::SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, // Get the parameter passed in JSString *jsstring; if ((jsstring = JS_ValueToString(aContext, *aVp)) != nsnull) { - src.Assign(JS_GetStringChars(jsstring)); + src.Assign(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(jsstring))); } else { src.Truncate(); diff --git a/mozilla/layout/html/content/src/nsHTMLOptionElement.cpp b/mozilla/layout/html/content/src/nsHTMLOptionElement.cpp index 4eefc716dcb..6c18b5ce661 100644 --- a/mozilla/layout/html/content/src/nsHTMLOptionElement.cpp +++ b/mozilla/layout/html/content/src/nsHTMLOptionElement.cpp @@ -686,7 +686,7 @@ nsHTMLOptionElement::Initialize(JSContext* aContext, return result; } - result = content->SetText(JS_GetStringChars(jsstr), + result = content->SetText(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(jsstr)), JS_GetStringLength(jsstr), PR_FALSE); NS_RELEASE(content); @@ -706,7 +706,7 @@ nsHTMLOptionElement::Initialize(JSContext* aContext, jsstr = JS_ValueToString(aContext, argv[1]); if (nsnull != jsstr) { // Set the value attribute for this element - nsAutoString value(JS_GetStringChars(jsstr)); + nsAutoString value(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(jsstr))); result = mInner.SetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::value, diff --git a/mozilla/layout/html/document/src/nsHTMLDocument.cpp b/mozilla/layout/html/document/src/nsHTMLDocument.cpp index b1ec5b2ae1c..a4ab174f4a1 100644 --- a/mozilla/layout/html/document/src/nsHTMLDocument.cpp +++ b/mozilla/layout/html/document/src/nsHTMLDocument.cpp @@ -2145,7 +2145,7 @@ nsHTMLDocument::ScriptWriteCommon(JSContext *cx, JSString *jsstring = JS_ValueToString(cx, argv[index]); if (nsnull != jsstring) { - str.Append(JS_GetStringChars(jsstring), JS_GetStringLength(jsstring)); + str.Append(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(jsstring)), JS_GetStringLength(jsstring)); } } diff --git a/mozilla/layout/xbl/src/nsXBLBinding.cpp b/mozilla/layout/xbl/src/nsXBLBinding.cpp index 83b4aa72138..8de46959f6e 100644 --- a/mozilla/layout/xbl/src/nsXBLBinding.cpp +++ b/mozilla/layout/xbl/src/nsXBLBinding.cpp @@ -916,7 +916,7 @@ nsXBLBinding::InstallProperties(nsIContent* aBoundElement) // destruction of any initial value that might be set. // This means we only have to worry about defining the getter // or setter. - ::JS_DefineUCProperty(cx, (JSObject*)classObject, name.GetUnicode(), + ::JS_DefineUCProperty(cx, (JSObject*)classObject, NS_REINTERPRET_CAST(const jschar*, name.GetUnicode()), name.Length(), JSVAL_VOID, (JSPropertyOp) getFunc, (JSPropertyOp) setFunc, @@ -949,7 +949,7 @@ nsXBLBinding::InstallProperties(nsIContent* aBoundElement) if (!undefined) { // Define that value as a property - ::JS_DefineUCProperty(cx, (JSObject*)scriptObject, name.GetUnicode(), + ::JS_DefineUCProperty(cx, (JSObject*)scriptObject, NS_REINTERPRET_CAST(const jschar*, name.GetUnicode()), name.Length(), result, nsnull, nsnull, attrs); diff --git a/mozilla/rdf/content/src/nsXULDocument.cpp b/mozilla/rdf/content/src/nsXULDocument.cpp index d60e66fb590..03add7d0af1 100644 --- a/mozilla/rdf/content/src/nsXULDocument.cpp +++ b/mozilla/rdf/content/src/nsXULDocument.cpp @@ -3739,7 +3739,7 @@ nsXULDocument::SetProperty(JSContext *aContext, JSObject *aObj, jsval aID, jsval JSString* jsString = JS_ValueToString(aContext, *aVp); if (!jsString) return PR_FALSE; - nsAutoString title(JS_GetStringChars(jsString)); + nsAutoString title(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(jsString))); for (PRInt32 i = mPresShells.Count() - 1; i >= 0; --i) { nsIPresShell* shell = NS_STATIC_CAST(nsIPresShell*, mPresShells[i]); nsCOMPtr context; diff --git a/mozilla/widget/src/mac/nsMacControl.cpp b/mozilla/widget/src/mac/nsMacControl.cpp index 5d646865c17..d84117043ff 100644 --- a/mozilla/widget/src/mac/nsMacControl.cpp +++ b/mozilla/widget/src/mac/nsMacControl.cpp @@ -507,7 +507,7 @@ void nsMacControl::NSStringSetControlTitle(ControlHandle theControl, nsString ti // convert from Unicode to script run // err = ::ConvertFromUnicodeToScriptCodeRun(unicodeTextRunInfo, - unicodeTextLengthInBytes,unicodeText, + unicodeTextLengthInBytes,NS_REINTERPRET_CAST(const PRUint16*, unicodeText), 0, /* no flags */ 0,NULL,NULL,NULL, /* no offset arrays */ scriptRunTextSizeInBytes,&unicodeTextReadInBytes,&scriptRunTextLengthInBytes, @@ -527,7 +527,7 @@ void nsMacControl::NSStringSetControlTitle(ControlHandle theControl, nsString ti // convert from Unicode to script run // err = ::ConvertFromUnicodeToScriptCodeRun(unicodeTextRunInfo, - unicodeTextLengthInBytes,unicodeText, + unicodeTextLengthInBytes,NS_REINTERPRET_CAST(const PRUint16*, unicodeText), 0, /* no flags */ 0,NULL,NULL,NULL, /* no offset arrays */ scriptRunTextSizeInBytes,&unicodeTextReadInBytes,&scriptRunTextLengthInBytes, diff --git a/mozilla/widget/src/mac/nsMacEventHandler.cpp b/mozilla/widget/src/mac/nsMacEventHandler.cpp index e9cfcaf7a74..773ec64118d 100644 --- a/mozilla/widget/src/mac/nsMacEventHandler.cpp +++ b/mozilla/widget/src/mac/nsMacEventHandler.cpp @@ -933,7 +933,7 @@ PRUint32 nsMacEventHandler::ConvertKeyEventToUnicode(EventRecord& aOSEvent) kUnicodeLooseMappingsMask, 0,NULL,NULL,NULL, sizeof(PRUnichar)*UNICODE_BUFFER_SIZE_FOR_KEY,&source_read, - &result_size,unicharResult); + &result_size,NS_REINTERPRET_CAST(PRUint16*, unicharResult)); ::DisposeTextToUnicodeInfo(&textToUnicodeInfo); NS_ASSERTION(err == noErr, "nsMacEventHandler::ConvertKeyEventToUnicode: ConverFromTextToUnicode failed."); // if we got the following result, then it mean we got more than one Unichar from it. @@ -1574,7 +1574,7 @@ nsresult nsMacEventHandler::HandleUpdateInputArea(char* text,Size text_size, Scr err = ::ConvertFromTextToUnicode(textToUnicodeInfo,committedLen,text,kUnicodeLooseMappingsMask, 0,NULL,NULL,NULL, mIMECompositionStr->mCapacity *sizeof(PRUnichar), - &source_read,&len,ubuf); + &source_read,&len,NS_REINTERPRET_CAST(PRUint16*, ubuf)); NS_ASSERTION(err==noErr,"nsMacEventHandler::UpdateInputArea: ConvertFromTextToUnicode failed.\n"); if (err!=noErr) { @@ -1723,7 +1723,7 @@ nsresult nsMacEventHandler::HandleUpdateInputArea(char* text,Size text_size, Scr err = ::ConvertFromTextToUnicode(textToUnicodeInfo,text_size-committedLen,text+committedLen,kUnicodeLooseMappingsMask, destinationLength,sourceOffset,&destinationLength,destinationOffset, mIMECompositionStr->mCapacity *sizeof(PRUnichar), - &source_read,&len, ubuf); + &source_read,&len, NS_REINTERPRET_CAST(PRUint16*, ubuf)); NS_ASSERTION(err==noErr,"nsMacEventHandler::UpdateInputArea: ConvertFromTextToUnicode failed.\n"); if (err!=noErr) { diff --git a/mozilla/widget/src/mac/nsMenu.cpp b/mozilla/widget/src/mac/nsMenu.cpp index fc9e629f53f..bc2885dfd2e 100644 --- a/mozilla/widget/src/mac/nsMenu.cpp +++ b/mozilla/widget/src/mac/nsMenu.cpp @@ -1062,7 +1062,7 @@ void nsMenu::NSStringSetMenuItemText(MenuHandle macMenuHandle, short menuItem, n scriptRunText = new char[scriptRunTextSizeInBytes + 1]; err = ::ConvertFromUnicodeToScriptCodeRun(mUnicodeTextRunConverter, - unicodeTextLengthInBytes,unicodeText, + unicodeTextLengthInBytes,NS_REINTERPRET_CAST(const PRUint16*, unicodeText), 0, /* no flags*/ 0,NULL,NULL,NULL, /* no offset arrays */ scriptRunTextSizeInBytes,&unicdeTextReadInBytes,&scriptRunTextLengthInBytes, @@ -1115,7 +1115,7 @@ MenuHandle nsMenu::NSStringNewMenu(short menuID, nsString& menuTitle) scriptRunText = new char[scriptRunTextSizeInBytes + 1]; // +1 for the null terminator. err = ::ConvertFromUnicodeToScriptCodeRun(mUnicodeTextRunConverter, - unicodeTextLengthInBytes,unicodeText, + unicodeTextLengthInBytes,NS_REINTERPRET_CAST(const PRUint16*, unicodeText), 0, /* no flags*/ 0,NULL,NULL,NULL, /* no offset arrays */ scriptRunTextSizeInBytes,&unicdeTextReadInBytes,&scriptRunTextLengthInBytes, @@ -1172,7 +1172,7 @@ MenuHandle nsMenu::NSStringNewChildMenu(short menuID, nsString& menuTitle) scriptRunText = new char[scriptRunTextSizeInBytes]; err = ::ConvertFromUnicodeToScriptCodeRun(mUnicodeTextRunConverter, - unicodeTextLengthInBytes,unicodeText, + unicodeTextLengthInBytes,NS_REINTERPRET_CAST(const PRUint16*, unicodeText), 0, /* no flags*/ 0,NULL,NULL,NULL, /* no offset arrays */ scriptRunTextSizeInBytes,&unicdeTextReadInBytes,&scriptRunTextLengthInBytes, diff --git a/mozilla/widget/src/mac/nsMenuBar.cpp b/mozilla/widget/src/mac/nsMenuBar.cpp index 167a9e46233..357d3d25525 100644 --- a/mozilla/widget/src/mac/nsMenuBar.cpp +++ b/mozilla/widget/src/mac/nsMenuBar.cpp @@ -539,7 +539,7 @@ nsMenuBar::NSStringSetMenuItemText(MenuHandle macMenuHandle, short menuItem, nsS scriptRunText = new char[scriptRunTextSizeInBytes + 1]; err = ::ConvertFromUnicodeToScriptCodeRun(mUnicodeTextRunConverter, - unicodeTextLengthInBytes,unicodeText, + unicodeTextLengthInBytes,NS_REINTERPRET_CAST(const PRUint16*, unicodeText), 0, /* no flags*/ 0,NULL,NULL,NULL, /* no offset arrays */ scriptRunTextSizeInBytes,&unicdeTextReadInBytes,&scriptRunTextLengthInBytes, diff --git a/mozilla/widget/src/xpwidgets/nsPrimitiveHelpers.cpp b/mozilla/widget/src/xpwidgets/nsPrimitiveHelpers.cpp index 1cba764f1f8..521c1f74308 100644 --- a/mozilla/widget/src/xpwidgets/nsPrimitiveHelpers.cpp +++ b/mozilla/widget/src/xpwidgets/nsPrimitiveHelpers.cpp @@ -116,7 +116,7 @@ nsPrimitiveHelpers :: CreateDataFromPrimitive ( const char* aFlavor, nsISupports else { nsCOMPtr doubleByteText ( do_QueryInterface(aPrimitive) ); if ( doubleByteText ) - doubleByteText->GetData ( NS_REINTERPRET_CAST(unsigned short**, aDataBuff) ); + doubleByteText->GetData ( NS_REINTERPRET_CAST(PRUnichar**, aDataBuff) ); } } diff --git a/mozilla/xpinstall/src/nsJSFile.cpp b/mozilla/xpinstall/src/nsJSFile.cpp index df6f9b06c97..e6c3c287882 100644 --- a/mozilla/xpinstall/src/nsJSFile.cpp +++ b/mozilla/xpinstall/src/nsJSFile.cpp @@ -161,7 +161,7 @@ InstallFileOpDirGetParent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, nativeRet->GetPath(&temp); nativeRetNSStr.AssignWithConversion(temp); - *rval = STRING_TO_JSVAL(JS_NewUCStringCopyN(cx, nativeRetNSStr.GetUnicode(), nativeRetNSStr.Length())); + *rval = STRING_TO_JSVAL(JS_NewUCStringCopyN(cx, NS_REINTERPRET_CAST(const jschar*, nativeRetNSStr.GetUnicode()), nativeRetNSStr.Length())); return JS_TRUE; } @@ -549,7 +549,7 @@ InstallFileOpFileGetNativeVersion(JSContext *cx, JSObject *obj, uintN argc, jsva return JS_TRUE; } - *rval = STRING_TO_JSVAL(JS_NewUCStringCopyN(cx, nativeRet.GetUnicode(), nativeRet.Length())); + *rval = STRING_TO_JSVAL(JS_NewUCStringCopyN(cx, NS_REINTERPRET_CAST(const jschar*, nativeRet.GetUnicode()), nativeRet.Length())); return JS_TRUE; } diff --git a/mozilla/xpinstall/src/nsJSInstall.cpp b/mozilla/xpinstall/src/nsJSInstall.cpp index bf84c6f0049..d0a050c5211 100644 --- a/mozilla/xpinstall/src/nsJSInstall.cpp +++ b/mozilla/xpinstall/src/nsJSInstall.cpp @@ -96,7 +96,7 @@ GetInstallProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) nsAutoString prop; if (NS_OK == a->GetUserPackageName(prop)) { - *vp = STRING_TO_JSVAL( JS_NewUCStringCopyN(cx, prop.GetUnicode(), prop.Length()) ); + *vp = STRING_TO_JSVAL( JS_NewUCStringCopyN(cx, NS_REINTERPRET_CAST(const jschar*, prop.GetUnicode()), prop.Length()) ); } else { @@ -110,7 +110,7 @@ GetInstallProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) nsAutoString prop; if (NS_OK == a->GetRegPackageName(prop)) { - *vp = STRING_TO_JSVAL( JS_NewUCStringCopyN(cx, prop.GetUnicode(), prop.Length()) ); + *vp = STRING_TO_JSVAL( JS_NewUCStringCopyN(cx, NS_REINTERPRET_CAST(const jschar*, prop.GetUnicode()), prop.Length()) ); } else { @@ -145,7 +145,7 @@ GetInstallProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) nsAutoString prop; a->GetInstallArguments(prop); - *vp = STRING_TO_JSVAL( JS_NewUCStringCopyN(cx, prop.GetUnicode(), prop.Length()) ); + *vp = STRING_TO_JSVAL( JS_NewUCStringCopyN(cx, NS_REINTERPRET_CAST(const jschar*, prop.GetUnicode()), prop.Length()) ); break; } @@ -155,7 +155,7 @@ GetInstallProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp) nsString prop; a->GetInstallURL(prop); - *vp = STRING_TO_JSVAL( JS_NewUCStringCopyN(cx, prop.GetUnicode(), prop.Length()) ); + *vp = STRING_TO_JSVAL( JS_NewUCStringCopyN(cx, NS_REINTERPRET_CAST(const jschar*, prop.GetUnicode()), prop.Length()) ); break; } @@ -237,7 +237,7 @@ void ConvertJSValToStr(nsString& aString, if((jsstring = JS_ValueToString(aContext, aValue)) != nsnull) { - aString.Assign(JS_GetStringChars(jsstring)); + aString.Assign(NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars(jsstring))); if (aString.EqualsIgnoreCase("null")) { aString.Truncate(); @@ -253,7 +253,7 @@ void ConvertStrToJSVal(const nsString& aProp, JSContext* aContext, jsval* aReturn) { - JSString *jsstring = JS_NewUCStringCopyN(aContext, aProp.GetUnicode(), aProp.Length()); + JSString *jsstring = JS_NewUCStringCopyN(aContext, NS_REINTERPRET_CAST(const jschar*, aProp.GetUnicode()), aProp.Length()); // set the return value *aReturn = STRING_TO_JSVAL(jsstring); } diff --git a/mozilla/xpinstall/src/nsJSInstallTriggerGlobal.cpp b/mozilla/xpinstall/src/nsJSInstallTriggerGlobal.cpp index 28744d7bbd7..05ce7a30174 100644 --- a/mozilla/xpinstall/src/nsJSInstallTriggerGlobal.cpp +++ b/mozilla/xpinstall/src/nsJSInstallTriggerGlobal.cpp @@ -188,10 +188,10 @@ InstallTriggerGlobalInstall(JSContext *cx, JSObject *obj, uintN argc, jsval *arg for (int i = 0; i < ida->length; i++ ) { JS_IdToValue( cx, ida->vector[i], &v ); - name = JS_GetStringChars( JS_ValueToString( cx, v ) ); + name = NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars( JS_ValueToString( cx, v ) )); - JS_GetUCProperty( cx, JSVAL_TO_OBJECT(argv[0]), name, nsCRT::strlen(name), &v ); - URL = JS_GetStringChars( JS_ValueToString( cx, v ) ); + JS_GetUCProperty( cx, JSVAL_TO_OBJECT(argv[0]), NS_REINTERPRET_CAST(const jschar*, name), nsCRT::strlen(name), &v ); + URL = NS_REINTERPRET_CAST(const PRUnichar*, JS_GetStringChars( JS_ValueToString( cx, v ) )); if ( name && URL ) { diff --git a/mozilla/xpinstall/src/nsSoftwareUpdateRun.cpp b/mozilla/xpinstall/src/nsSoftwareUpdateRun.cpp index 84840233142..399f027a396 100644 --- a/mozilla/xpinstall/src/nsSoftwareUpdateRun.cpp +++ b/mozilla/xpinstall/src/nsSoftwareUpdateRun.cpp @@ -104,7 +104,7 @@ XPInstallErrorReporter(JSContext *cx, const char *message, JSErrorReport *report PRUint32 column = report->uctokenptr - report->uclinebuf; - rv = errorObject->Init(report->ucmessage, newFileUni, report->uclinebuf, + rv = errorObject->Init(NS_REINTERPRET_CAST(const PRUnichar*, report->ucmessage), newFileUni, NS_REINTERPRET_CAST(const PRUnichar*, report->uclinebuf), report->lineno, column, report->flags, "XPInstall JavaScript"); nsMemory::Free((void *)newFileUni); @@ -142,7 +142,7 @@ XPInstallErrorReporter(JSContext *cx, const char *message, JSErrorReport *report logMessage.AppendInt(report->lineno, 10); logMessage.AppendWithConversion("\t"); if (report->ucmessage) - logMessage.Append( report->ucmessage ); + logMessage.Append( NS_REINTERPRET_CAST(const PRUnichar*, report->ucmessage) ); else logMessage.AppendWithConversion( message );