making string conversions explicit

This commit is contained in:
scc%netscape.com 2000-04-23 10:58:27 +00:00
parent 96dd3d7e3f
commit 5af36c0b61
4 changed files with 10 additions and 10 deletions

View File

@ -747,7 +747,7 @@ nsresult nsDBFolderInfo::SetUint32PropertyWithToken(mdb_token aProperty, PRUint3
nsresult nsDBFolderInfo::SetInt32PropertyWithToken(mdb_token aProperty, PRInt32 propertyValue)
{
nsString propertyStr;
propertyStr.Append(propertyValue, 16);
propertyStr.AppendInt(propertyValue, 16);
return SetPropertyWithToken(aProperty, &propertyStr);
}

View File

@ -380,7 +380,7 @@ void nsMailDatabase::UpdateFolderFlag(nsIMsgDBHdr *mailHdr, PRBool bSet,
nsresult nsMailDatabase::GetFolderName(nsString &folderName)
{
folderName = *m_folderSpec;
folderName.AssignWithConversion(NS_STATIC_CAST(const char*, *m_folderSpec));
return NS_OK;
}

View File

@ -81,7 +81,7 @@ nsresult nsMsgDatabase::GetHdrFromCache(nsMsgKey key, nsIMsgDBHdr* *result)
{
// it would be nice if we had an nsISupports hash table that hashed 32 bit int's
nsCAutoString strKey;
strKey.Append(key, 10);
strKey.AppendInt(key, 10);
nsStringKey hashKey(strKey.GetBuffer());
// nsSupportsHashtable does an addref
*result = (nsIMsgDBHdr *) m_cachedHeaders->Get(&hashKey);
@ -104,7 +104,7 @@ nsresult nsMsgDatabase::AddHdrToCache(nsIMsgDBHdr *hdr, nsMsgKey key) // do we w
ClearHdrCache();
// it would be nice if we had an nsISupports hash table that hashed 32 bit int's
nsCAutoString strKey;
strKey.Append(key, 10);
strKey.AppendInt(key, 10);
nsStringKey hashKey(strKey.GetBuffer());
m_cachedHeaders->Put(&hashKey, hdr);
return NS_OK;
@ -130,7 +130,7 @@ nsresult nsMsgDatabase::RemoveHdrFromCache(nsIMsgDBHdr *hdr, nsMsgKey key)
hdr->GetMessageKey(&key);
nsCAutoString strKey;
strKey.Append(key, 10);
strKey.AppendInt(key, 10);
nsStringKey hashKey(strKey.GetBuffer());
nsIMsgDBHdr *removedHdr = (nsIMsgDBHdr *) m_cachedHeaders->Remove(&hashKey); // does this release, or do I have to?
}
@ -151,7 +151,7 @@ nsresult nsMsgDatabase::GetHdrFromUseCache(nsMsgKey key, nsIMsgDBHdr* *result)
{
// it would be nice if we had a hash table that hashed 32 bit int's
nsCAutoString strKey;
strKey.Append(key, 10);
strKey.AppendInt(key, 10);
nsStringKey hashKey(strKey.GetBuffer());
// nsHashtable doesn't do an addref
*result = (nsIMsgDBHdr *) m_headersInUse->Get(&hashKey);
@ -173,7 +173,7 @@ nsresult nsMsgDatabase::AddHdrToUseCache(nsIMsgDBHdr *hdr, nsMsgKey key)
nsCOMPtr<nsISupports> supports(do_QueryInterface(hdr));
// it would be nice if we had an nsISupports hash table that hashed 32 bit int's
nsCAutoString strKey;
strKey.Append(key, 10);
strKey.AppendInt(key, 10);
nsStringKey hashKey(strKey.GetBuffer());
m_headersInUse->Put(&hashKey, hdr);
NS_ADDREF(hdr);
@ -202,7 +202,7 @@ nsresult nsMsgDatabase::RemoveHdrFromUseCache(nsIMsgDBHdr *hdr, nsMsgKey key)
hdr->GetMessageKey(&key);
nsCAutoString strKey;
strKey.Append(key, 10);
strKey.AppendInt(key, 10);
nsStringKey hashKey(strKey.GetBuffer());
nsIMsgDBHdr *removedHdr = (nsIMsgDBHdr *) m_headersInUse->Remove(&hashKey);
}
@ -2569,7 +2569,7 @@ nsresult nsMsgDatabase::RowCellColumnToCharPtr(nsIMdbRow *row, mdb_token columnT
/* static */void nsMsgDatabase::YarnTonsString(struct mdbYarn *yarn, nsString *str)
{
str->Assign((const char *) yarn->mYarn_Buf, yarn->mYarn_Fill);
str->AssignWithConversion((const char *) yarn->mYarn_Buf, yarn->mYarn_Fill);
}
/* static */void nsMsgDatabase::YarnTonsCString(struct mdbYarn *yarn, nsCString *str)

View File

@ -638,7 +638,7 @@ NS_IMETHODIMP nsMsgHdr::GetAuthorCollationKey(PRUnichar* *resultAuthor)
}
if (NS_SUCCEEDED(ret))
{
nsAutoString autoString(name);
nsAutoString autoString; autoString.AssignWithConversion(name);
PRUnichar *uniName = autoString.ToNewUnicode();
ret = m_mdb->CreateCollationKey(uniName, resultAuthor);
Recycle(uniName);