Backout 17deb5f61b4d (bug 150073) due to build bustage. a=shouldausedtryfirst

This commit is contained in:
Ryan VanderMeulen 2012-04-03 20:22:42 -04:00
parent 0712589aad
commit 8a1ce69485
25 changed files with 52 additions and 52 deletions

View File

@ -120,7 +120,7 @@ SVGTransformListParser::GetTransformToken(nsIAtom** aKeyAtom,
*delimiterStart = '\0';
PRUint32 len;
if ((len = strlen(mTokenPos)) > 0) {
if ((len = nsCRT::strlen(mTokenPos)) > 0) {
*aKeyAtom = NS_NewAtom(Substring(mTokenPos, mTokenPos + len));
if (aAdvancePos) {

View File

@ -1462,7 +1462,7 @@ nsXMLContentSink::ReportError(const PRUnichar* aErrorText,
false);
NS_ENSURE_SUCCESS(rv, rv);
rv = HandleCharacterData(aErrorText, strlen(aErrorText), false);
rv = HandleCharacterData(aErrorText, nsCRT::strlen(aErrorText), false);
NS_ENSURE_SUCCESS(rv, rv);
nsAutoString sourcetext(errorNs);
@ -1473,7 +1473,7 @@ nsXMLContentSink::ReportError(const PRUnichar* aErrorText,
false);
NS_ENSURE_SUCCESS(rv, rv);
rv = HandleCharacterData(aSourceText, strlen(aSourceText), false);
rv = HandleCharacterData(aSourceText, nsCRT::strlen(aSourceText), false);
NS_ENSURE_SUCCESS(rv, rv);
rv = HandleEndElement(sourcetext.get(), false);

View File

@ -764,7 +764,7 @@ XULContentSinkImpl::ReportError(const PRUnichar* aErrorText,
rv = HandleStartElement(parsererror.get(), noAtts, 0, -1, 0);
NS_ENSURE_SUCCESS(rv,rv);
rv = HandleCharacterData(aErrorText, strlen(aErrorText));
rv = HandleCharacterData(aErrorText, nsCRT::strlen(aErrorText));
NS_ENSURE_SUCCESS(rv,rv);
nsAutoString sourcetext(errorNs);
@ -774,7 +774,7 @@ XULContentSinkImpl::ReportError(const PRUnichar* aErrorText,
rv = HandleStartElement(sourcetext.get(), noAtts, 0, -1, 0);
NS_ENSURE_SUCCESS(rv,rv);
rv = HandleCharacterData(aSourceText, strlen(aSourceText));
rv = HandleCharacterData(aSourceText, nsCRT::strlen(aSourceText));
NS_ENSURE_SUCCESS(rv,rv);
rv = HandleEndElement(sourcetext.get());

View File

@ -5027,7 +5027,7 @@ nsDOMClassInfo::PostCreatePrototype(JSContext * cx, JSObject * proto)
// Don't overwrite a property set by content.
JSBool found;
if (!::JS_AlreadyHasOwnUCProperty(cx, global, reinterpret_cast<const jschar*>(mData->mNameUTF16),
strlen(mData->mNameUTF16), &found)) {
nsCRT::strlen(mData->mNameUTF16), &found)) {
return NS_ERROR_FAILURE;
}
@ -5911,7 +5911,7 @@ public:
JSBool ok = JS_WrapValue(cx, &thisAsVal) &&
::JS_DefineUCProperty(cx, target,
reinterpret_cast<const jschar *>(mClassName),
strlen(mClassName), thisAsVal, nsnull,
nsCRT::strlen(mClassName), thisAsVal, nsnull,
nsnull, 0);
return ok ? NS_OK : NS_ERROR_UNEXPECTED;

View File

@ -500,7 +500,7 @@ nsresult mozHunspell::ConvertCharset(const PRUnichar* aStr, char ** aDst)
NS_ENSURE_TRUE(mEncoder, NS_ERROR_NULL_POINTER);
PRInt32 outLength;
PRInt32 inLength = strlen(aStr);
PRInt32 inLength = nsCRT::strlen(aStr);
nsresult rv = mEncoder->GetMaxLength(aStr, inLength, &outLength);
NS_ENSURE_SUCCESS(rv, rv);
@ -557,7 +557,7 @@ NS_IMETHODIMP mozHunspell::Suggest(const PRUnichar *aWord, PRUnichar ***aSuggest
PRUint32 index = 0;
for (index = 0; index < *aSuggestionCount && NS_SUCCEEDED(rv); ++index) {
// Convert the suggestion to utf16
PRInt32 inLength = strlen(wlst[index]);
PRInt32 inLength = nsCRT::strlen(wlst[index]);
PRInt32 outLength;
rv = mDecoder->GetMaxLength(wlst[index], inLength, &outLength);
if (NS_SUCCEEDED(rv))

View File

@ -277,7 +277,7 @@ NS_IMETHODIMP mozEnglishWordUtils::FromRootForm(const PRUnichar *aWord, const PR
mozEnglishWordUtils::myspCapitalization ct = captype(word);
for(PRUint32 i = 0; i < icount; ++i) {
length = strlen(iwords[i]);
length = nsCRT::strlen(iwords[i]);
tmpPtr[i] = (PRUnichar *) nsMemory::Alloc(sizeof(PRUnichar) * (length + 1));
if (NS_UNLIKELY(!tmpPtr[i])) {
NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(i, tmpPtr);

View File

@ -78,7 +78,7 @@ NS_IMETHODIMP nsTextToSubURI::ConvertAndEscape(
{
char buf[256];
char *pBuf = buf;
PRInt32 ulen = strlen(text);
PRInt32 ulen = nsCRT::strlen(text);
PRInt32 outlen = 0;
if(NS_SUCCEEDED(rv = encoder->GetMaxLength(text, ulen, &outlen)))
{

View File

@ -231,7 +231,7 @@ nsEntityConverter::ConvertToEntities(const PRUnichar *inString, PRUint32 entityV
nsString outString;
// per character look for the entity
PRUint32 len = strlen(inString);
PRUint32 len = nsCRT::strlen(inString);
for (PRUint32 i = 0; i < len; i++) {
nsAutoString key(NS_LITERAL_STRING("entity."));
if (NS_IS_HIGH_SURROGATE(inString[i]) &&

View File

@ -205,13 +205,13 @@ nsSaveAsCharset::DoCharsetConversion(const PRUnichar *inString, char **outString
*outString = NULL;
nsresult rv;
PRInt32 inStringLength = strlen(inString); // original input string length
PRInt32 bufferLength; // allocated buffer length
PRInt32 inStringLength = nsCRT::strlen(inString); // original input string length
PRInt32 bufferLength; // allocated buffer length
PRInt32 srcLength = inStringLength;
PRInt32 dstLength;
char *dstPtr = NULL;
PRInt32 pos1, pos2;
nsresult saveResult = NS_OK; // to remember NS_ERROR_UENC_NOMAPPING
nsresult saveResult = NS_OK; // to remember NS_ERROR_UENC_NOMAPPING
// estimate and allocate the target buffer (reserve extra memory for fallback)
rv = mEncoder->GetMaxLength(inString, inStringLength, &dstLength);

View File

@ -279,7 +279,7 @@ nsresult nsBidi::SetPara(const PRUnichar *aText, PRInt32 aLength,
}
if(aLength==-1) {
aLength = strlen(aText);
aLength=nsCRT::strlen(aText);
}
/* initialize member data */

View File

@ -2412,9 +2412,9 @@ void
nsPrintEngine::ElipseLongString(PRUnichar *& aStr, const PRUint32 aLen, bool aDoFront)
{
// Make sure the URLS don't get too long for the progress dialog
if (aStr && strlen(aStr) > aLen) {
if (aStr && nsCRT::strlen(aStr) > aLen) {
if (aDoFront) {
PRUnichar * ptr = &aStr[strlen(aStr) - aLen + 3];
PRUnichar * ptr = &aStr[nsCRT::strlen(aStr)-aLen+3];
nsAutoString newStr;
newStr.AppendLiteral("...");
newStr += ptr;

View File

@ -83,6 +83,6 @@ interface nsIAboutModule : nsISupports
#define NS_ABOUT_MODULE_CONTRACTID "@mozilla.org/network/protocol/about;1"
#define NS_ABOUT_MODULE_CONTRACTID_PREFIX NS_ABOUT_MODULE_CONTRACTID "?what="
#define NS_ABOUT_MODULE_CONTRACTID_LENGTH 49 // strlen(NS_ABOUT_MODULE_CONTRACTID_PREFIX)
#define NS_ABOUT_MODULE_CONTRACTID_LENGTH 49 // nsCRT::strlen(NS_ABOUT_MODULE_CONTRACTID_PREFIX)
%}

View File

@ -276,9 +276,9 @@ nsHttpAuthIdentity::Set(const PRUnichar *domain,
{
PRUnichar *newUser, *newPass, *newDomain;
int domainLen = domain ? strlen(domain) : 0;
int userLen = user ? strlen(user) : 0;
int passLen = pass ? strlen(pass) : 0;
int domainLen = domain ? nsCRT::strlen(domain) : 0;
int userLen = user ? nsCRT::strlen(user) : 0;
int passLen = pass ? nsCRT::strlen(pass) : 0;
int len = userLen + 1 + passLen + 1 + domainLen + 1;
newUser = (PRUnichar *) malloc(len * sizeof(PRUnichar));
@ -355,7 +355,7 @@ nsHttpAuthEntry::AddPath(const char *aPath)
nsHttpAuthPath *tempPtr = mRoot;
while (tempPtr) {
const char *curpath = tempPtr->mPath;
if (strncmp(aPath, curpath, strlen(curpath)) == 0)
if (strncmp(aPath, curpath, nsCRT::strlen(curpath)) == 0)
return NS_OK; // subpath already exists in the list
tempPtr = tempPtr->mNext;
@ -364,7 +364,7 @@ nsHttpAuthEntry::AddPath(const char *aPath)
//Append the aPath
nsHttpAuthPath *newAuthPath;
int newpathLen = strlen(aPath);
int newpathLen = nsCRT::strlen(aPath);
newAuthPath = (nsHttpAuthPath *) malloc(sizeof(nsHttpAuthPath) + newpathLen);
if (!newAuthPath)
return NS_ERROR_OUT_OF_MEMORY;
@ -392,9 +392,9 @@ nsHttpAuthEntry::Set(const char *path,
{
char *newRealm, *newCreds, *newChall;
int realmLen = realm ? strlen(realm) : 0;
int credsLen = creds ? strlen(creds) : 0;
int challLen = chall ? strlen(chall) : 0;
int realmLen = realm ? nsCRT::strlen(realm) : 0;
int credsLen = creds ? nsCRT::strlen(creds) : 0;
int challLen = chall ? nsCRT::strlen(chall) : 0;
int len = realmLen + 1 + credsLen + 1 + challLen + 1;
newRealm = (char *) malloc(len);
@ -489,7 +489,7 @@ nsHttpAuthNode::LookupEntryByPath(const char *path)
if (path[0] == '\0')
return entry;
}
else if (strncmp(path, entryPath, strlen(entryPath)) == 0)
else if (strncmp(path, entryPath, nsCRT::strlen(entryPath)) == 0)
return entry;
authPath = authPath->mNext;

View File

@ -743,7 +743,7 @@ mozTXTToHTMLConv::SmilyHit(const PRUnichar * aInString, PRInt32 aLength, bool co
if ( !aInString || !tagTXT || !imageName )
return false;
PRInt32 tagLen = strlen(tagTXT);
PRInt32 tagLen = nsCRT::strlen(tagTXT);
PRUint32 delim = (col0 ? 0 : 1) + tagLen;
@ -1055,7 +1055,7 @@ mozTXTToHTMLConv::CiteLevelTXT(const PRUnichar *line,
PRUint32& logLineStart)
{
PRInt32 result = 0;
PRInt32 lineLength = strlen(line);
PRInt32 lineLength = nsCRT::strlen(line);
bool moreCites = true;
while (moreCites)
@ -1094,7 +1094,7 @@ mozTXTToHTMLConv::CiteLevelTXT(const PRUnichar *line,
// Placed here for performance increase
const PRUnichar * indexString = &line[logLineStart];
// here, |logLineStart < lineLength| is always true
PRUint32 minlength = MinInt(6, strlen(indexString));
PRUint32 minlength = MinInt(6,nsCRT::strlen(indexString));
if (Substring(indexString,
indexString+minlength).Equals(Substring(NS_LITERAL_STRING(">From "), 0, minlength),
nsCaseInsensitiveStringComparator()))
@ -1369,7 +1369,7 @@ mozTXTToHTMLConv::ScanTXT(const PRUnichar *text, PRUint32 whattodo,
// FIX ME!!!
nsString outString;
PRInt32 inLength = strlen(text);
PRInt32 inLength = nsCRT::strlen(text);
// by setting a large capacity up front, we save time
// when appending characters to the output string because we don't
// need to reallocate and re-copy the characters already in the out String.

View File

@ -424,7 +424,7 @@ nsHTMLTags::AddRefTable(void)
// let's verify that NS_HTMLTAG_NAME_MAX_LENGTH is correct
PRUint32 maxTagNameLength = 0;
for (i = 0; i < NS_HTML_TAG_MAX; ++i) {
PRUint32 len = strlen(sTagUnicodeTable[i]);
PRUint32 len = nsCRT::strlen(sTagUnicodeTable[i]);
maxTagNameLength = NS_MAX(len, maxTagNameLength);
}
NS_ASSERTION(maxTagNameLength == NS_HTMLTAG_NAME_MAX_LENGTH,

View File

@ -202,7 +202,7 @@ nsresult nsOSHelperAppService::GetFileTokenForPath(const PRUnichar * aPlatformAp
CFURLRef pathAsCFURL;
CFStringRef pathAsCFString = ::CFStringCreateWithCharacters(NULL,
aPlatformAppPath,
strlen(aPlatformAppPath));
nsCRT::strlen(aPlatformAppPath));
if (!pathAsCFString)
return NS_ERROR_OUT_OF_MEMORY;

View File

@ -100,7 +100,7 @@ NS_IMETHODIMP nsDeviceContextSpecX::BeginDocument(PRUnichar* aTitle,
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
if (aTitle) {
CFStringRef cfString = ::CFStringCreateWithCharacters(NULL, aTitle, strlen(aTitle));
CFStringRef cfString = ::CFStringCreateWithCharacters(NULL, aTitle, nsCRT::strlen(aTitle));
if (cfString) {
::PMPrintSettingsSetJobName(mPrintSettings, cfString);
::CFRelease(cfString);

View File

@ -86,7 +86,7 @@ nsPrintDialogServiceX::Show(nsIDOMWindow *aParent, nsIPrintSettings *aSettings,
PRUint32 titleCount;
nsresult rv = aWebBrowserPrint->EnumerateDocumentNames(&titleCount, &docTitles);
if (NS_SUCCEEDED(rv) && titleCount > 0) {
CFStringRef cfTitleString = CFStringCreateWithCharacters(NULL, docTitles[0], strlen(docTitles[0]));
CFStringRef cfTitleString = CFStringCreateWithCharacters(NULL, docTitles[0], nsCRT::strlen(docTitles[0]));
if (cfTitleString) {
::PMPrintSettingsSetJobName(settingsX->GetPMPrintSettings(), cfTitleString);
CFRelease(cfTitleString);

View File

@ -465,7 +465,7 @@ nsresult nsClipboard::GetNativeDataOffClipboard(IDataObject * aDataObject, UINT
// (on 98, these are not the same) so we can't use that.
PRUint32 allocLen = 0;
if ( NS_SUCCEEDED(GetGlobalData(stm.hGlobal, aData, &allocLen)) ) {
*aLen = strlen(reinterpret_cast<PRUnichar*>(*aData)) * 2;
*aLen = nsCRT::strlen(reinterpret_cast<PRUnichar*>(*aData)) * 2;
result = NS_OK;
}
} break;
@ -547,7 +547,7 @@ nsresult nsClipboard::GetNativeDataOffClipboard(IDataObject * aDataObject, UINT
"CFSTR_PREFERREDDROPEFFECT should return a DWORD");
*aLen = allocLen;
} else {
*aLen = strlen(reinterpret_cast<PRUnichar*>(*aData)) *
*aLen = nsCRT::strlen(reinterpret_cast<PRUnichar*>(*aData)) *
sizeof(PRUnichar);
}
result = NS_OK;
@ -821,7 +821,7 @@ nsClipboard :: FindURLFromLocalFile ( IDataObject* inDataObject, UINT inIndex, v
if (title.IsEmpty())
title = urlString;
*outData = ToNewUnicode(urlString + NS_LITERAL_STRING("\n") + title);
*outDataLen = strlen(static_cast<PRUnichar*>(*outData)) * sizeof(PRUnichar);
*outDataLen = nsCRT::strlen(static_cast<PRUnichar*>(*outData)) * sizeof(PRUnichar);
dataFound = true;
}
@ -834,7 +834,7 @@ nsClipboard :: FindURLFromLocalFile ( IDataObject* inDataObject, UINT inIndex, v
// convert it to unicode and pass it out
nsMemory::Free(*outData);
*outData = UTF8ToNewUnicode(urlSpec);
*outDataLen = strlen(static_cast<PRUnichar*>(*outData)) * sizeof(PRUnichar);
*outDataLen = nsCRT::strlen(static_cast<PRUnichar*>(*outData)) * sizeof(PRUnichar);
dataFound = true;
} // else regular file
}
@ -864,7 +864,7 @@ nsClipboard :: FindURLFromNativeURL ( IDataObject* inDataObject, UINT inIndex, v
// URL\ntitle. Since we don't actually have a title here,
// just repeat the URL to fake it.
*outData = ToNewUnicode(urlString + NS_LITERAL_STRING("\n") + urlString);
*outDataLen = strlen(static_cast<PRUnichar*>(*outData)) * sizeof(PRUnichar);
*outDataLen = nsCRT::strlen(static_cast<PRUnichar*>(*outData)) * sizeof(PRUnichar);
nsMemory::Free(tempOutData);
dataFound = true;
}
@ -886,7 +886,7 @@ nsClipboard :: FindURLFromNativeURL ( IDataObject* inDataObject, UINT inIndex, v
// URL\ntitle. Since we don't actually have a title here,
// just repeat the URL to fake it.
*outData = ToNewUnicode(urlString + NS_LITERAL_STRING("\n") + urlString);
*outDataLen = strlen(static_cast<PRUnichar*>(*outData)) * sizeof(PRUnichar);
*outDataLen = nsCRT::strlen(static_cast<PRUnichar*>(*outData)) * sizeof(PRUnichar);
nsMemory::Free(tempOutData);
dataFound = true;
}

View File

@ -828,8 +828,8 @@ nsFilePicker::ShowXPFilePicker(const nsString& aInitialDir)
if (current[dirName.Length() - 1] != '\\')
dirName.Append((PRUnichar)'\\');
while (current && *current && *(current + strlen(current) + 1)) {
current = current + strlen(current) + 1;
while (current && *current && *(current + nsCRT::strlen(current) + 1)) {
current = current + nsCRT::strlen(current) + 1;
nsCOMPtr<nsILocalFile> file = do_CreateInstance("@mozilla.org/file/local;1");
NS_ENSURE_TRUE(file, false);

View File

@ -647,7 +647,7 @@ nsStringKey::nsStringKey(const PRUnichar* str, PRInt32 strLen, Ownership own)
{
NS_ASSERTION(mStr, "null string key");
if (mStrLen == PRUint32(-1))
mStrLen = strlen(str);
mStrLen = nsCRT::strlen(str);
#ifdef DEBUG
mKeyType = StringKey;
#endif

View File

@ -443,7 +443,7 @@ static nsresult CloneArray(PRUint16 inType, const nsIID* inIID,
{
if(nsnull == (*(outp++) = (PRUnichar*)
nsMemory::Clone(str,
(strlen(str) + 1) * sizeof(PRUnichar))))
(nsCRT::strlen(str)+1)*sizeof(PRUnichar))))
goto bad;
}
else
@ -1516,7 +1516,7 @@ nsVariant::SetFromWString(nsDiscriminatedUnion* data, const PRUnichar *aValue)
DATA_SETTER_PROLOGUE(data);
if(!aValue)
return NS_ERROR_NULL_POINTER;
return SetFromWStringWithSize(data, strlen(aValue), aValue);
return SetFromWStringWithSize(data, nsCRT::strlen(aValue), aValue);
}
/* static */ nsresult
nsVariant::SetFromISupports(nsDiscriminatedUnion* data, nsISupports *aValue)

View File

@ -203,7 +203,7 @@ nsBinaryOutputStream::WriteWStringZ(const PRUnichar* aString)
PRUint32 length, byteCount;
nsresult rv;
length = strlen(aString);
length = nsCRT::strlen(aString);
rv = Write32(length);
if (NS_FAILED(rv)) return rv;

View File

@ -288,9 +288,9 @@ nsEscapeHTML(const char * string)
PRUnichar *
nsEscapeHTML2(const PRUnichar *aSourceBuffer, PRInt32 aSourceBufferLen)
{
// Calculate the length, if the caller didn't.
// if the caller didn't calculate the length
if (aSourceBufferLen < 0) {
aSourceBufferLen = strlen(aSourceBuffer);
aSourceBufferLen = nsCRT::strlen(aSourceBuffer); // ...then I will
}
/* XXX Hardcoded max entity len. */

View File

@ -401,7 +401,7 @@ PRUnichar* nsLinebreakConverter::ConvertUnicharLineBreaks(const PRUnichar* aSrc,
aSrcBreaks != eLinebreakSpace, "Invalid parameter");
if (!aSrc) return nsnull;
PRInt32 bufLen = (aSrcLen == kIgnoreLen) ? strlen(aSrc) + 1 : aSrcLen;
PRInt32 bufLen = (aSrcLen == kIgnoreLen) ? nsCRT::strlen(aSrc) + 1 : aSrcLen;
PRUnichar* resultString;
if (aSrcBreaks == eLinebreakAny)
@ -427,7 +427,7 @@ nsresult nsLinebreakConverter::ConvertUnicharLineBreaksInSitu(PRUnichar **ioBuff
NS_ASSERTION(aDestBreaks != eLinebreakAny &&
aSrcBreaks != eLinebreakSpace, "Invalid parameter");
PRInt32 sourceLen = (aSrcLen == kIgnoreLen) ? strlen(*ioBuffer) + 1 : aSrcLen;
PRInt32 sourceLen = (aSrcLen == kIgnoreLen) ? nsCRT::strlen(*ioBuffer) + 1 : aSrcLen;
// can we convert in-place?
const char* srcBreaks = GetLinebreakString(aSrcBreaks);