Bug 777770 - Replace nsVoidArray with nsTArray, part 2. r=rkent a=me CLOSED TREE
This commit is contained in:
Родитель
93572ccb9c
Коммит
c17ab6c596
|
@ -98,7 +98,7 @@ nsresult nsAbView::RemoveCardAt(int32_t row)
|
|||
{
|
||||
nsresult rv;
|
||||
|
||||
AbCard *abcard = (AbCard*) (mCards.ElementAt(row));
|
||||
AbCard *abcard = mCards.ElementAt(row);
|
||||
NS_IF_RELEASE(abcard->card);
|
||||
mCards.RemoveElementAt(row);
|
||||
PR_FREEIF(abcard->primaryCollationKey);
|
||||
|
@ -354,7 +354,7 @@ NS_IMETHODIMP nsAbView::GetCellProperties(int32_t row, nsITreeColumn* col, nsASt
|
|||
{
|
||||
NS_ENSURE_TRUE(row >= 0, NS_ERROR_UNEXPECTED);
|
||||
|
||||
if (mCards.Length() <= row)
|
||||
if (mCards.Length() <= (size_t)row)
|
||||
return NS_OK;
|
||||
|
||||
const char16_t* colID;
|
||||
|
@ -525,7 +525,7 @@ nsresult nsAbView::RefreshTree()
|
|||
|
||||
NS_IMETHODIMP nsAbView::GetCellText(int32_t row, nsITreeColumn* col, nsAString& _retval)
|
||||
{
|
||||
NS_ENSURE_TRUE(row >= 0 && row < mCards.Length(), NS_ERROR_UNEXPECTED);
|
||||
NS_ENSURE_TRUE(row >= 0 && (size_t)row < mCards.Length(), NS_ERROR_UNEXPECTED);
|
||||
|
||||
nsIAbCard *card = mCards.ElementAt(row)->card;
|
||||
const char16_t* colID;
|
||||
|
@ -612,12 +612,11 @@ NS_IMETHODIMP nsAbView::PerformActionOnCell(const char16_t *action, int32_t row,
|
|||
NS_IMETHODIMP nsAbView::GetCardFromRow(int32_t row, nsIAbCard **aCard)
|
||||
{
|
||||
*aCard = nullptr;
|
||||
if (mCards.Length() <= row) {
|
||||
NS_ENSURE_TRUE(row >= 0, NS_ERROR_UNEXPECTED);
|
||||
if (mCards.Length() <= (size_t)row) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_ENSURE_TRUE(row >= 0, NS_ERROR_UNEXPECTED);
|
||||
|
||||
AbCard *a = mCards.ElementAt(row);
|
||||
if (!a)
|
||||
return NS_OK;
|
||||
|
@ -637,13 +636,8 @@ typedef struct SortClosure
|
|||
} SortClosure;
|
||||
|
||||
static int
|
||||
inplaceSortCallback(const void *data1, const void *data2, void *privateData)
|
||||
inplaceSortCallback(const AbCard *card1, const AbCard *card2, SortClosure *closure)
|
||||
{
|
||||
AbCard *card1 = (AbCard *)data1;
|
||||
AbCard *card2 = (AbCard *)data2;
|
||||
|
||||
SortClosure *closure = (SortClosure *) privateData;
|
||||
|
||||
int32_t sortValue;
|
||||
|
||||
// If we are sorting the "PrimaryEmail", swap the collation keys, as the secondary is always the
|
||||
|
@ -679,19 +673,20 @@ static void SetSortClosure(const char16_t *sortColumn, const char16_t *sortDirec
|
|||
return;
|
||||
}
|
||||
|
||||
class CardComparator {
|
||||
private:
|
||||
SortClosure *m_closure;
|
||||
class CardComparator
|
||||
{
|
||||
public:
|
||||
void SetClosure(SortClosure *closure) { m_closure = closure; };
|
||||
|
||||
public:
|
||||
void SetClosure(SortClosure *closure) { m_closure = closure; };
|
||||
/** @return True if the elements are equals; false otherise. */
|
||||
bool Equals(const AbCard* a, const AbCard* b) const {
|
||||
return inplaceSortCallback(a, b, m_closure) == 0;
|
||||
}
|
||||
bool LessThan(const AbCard* a, const AbCard* b) const{
|
||||
return inplaceSortCallback(a, b, m_closure) < 0;
|
||||
}
|
||||
bool Equals(const AbCard *a, const AbCard *b) const {
|
||||
return inplaceSortCallback(a, b, m_closure) == 0;
|
||||
}
|
||||
bool LessThan(const AbCard *a, const AbCard *b) const{
|
||||
return inplaceSortCallback(a, b, m_closure) < 0;
|
||||
}
|
||||
|
||||
private:
|
||||
SortClosure *m_closure;
|
||||
};
|
||||
|
||||
NS_IMETHODIMP nsAbView::SortBy(const char16_t *colID, const char16_t *sortDir, bool aResort = false)
|
||||
|
@ -952,16 +947,13 @@ int32_t nsAbView::FindIndexForInsert(AbCard *abcard)
|
|||
int32_t count = mCards.Length();
|
||||
int32_t i;
|
||||
|
||||
void *item = (void *)abcard;
|
||||
|
||||
SortClosure closure;
|
||||
SetSortClosure(mSortColumn.get(), mSortDirection.get(), this, &closure);
|
||||
|
||||
// XXX todo
|
||||
// Make this a binary search
|
||||
for (i=0; i < count; i++) {
|
||||
void *current = (void *)mCards.ElementAt(i);
|
||||
int32_t value = inplaceSortCallback(item, current, (void *)(&closure));
|
||||
int32_t value = inplaceSortCallback(abcard, mCards.ElementAt(i), &closure);
|
||||
// XXX Fix me, this is not right for both ascending and descending
|
||||
if (value <= 0)
|
||||
break;
|
||||
|
@ -1046,7 +1038,7 @@ int32_t nsAbView::FindIndexForCard(nsIAbCard *card)
|
|||
// you might be here because one of the card properties has changed, and that property
|
||||
// could be the collation key.
|
||||
for (i=0; i < count; i++) {
|
||||
AbCard *abcard = (AbCard*) (mCards.ElementAt(i));
|
||||
AbCard *abcard = mCards.ElementAt(i);
|
||||
bool equals;
|
||||
nsresult rv = card->Equals(abcard->card, &equals);
|
||||
if (NS_SUCCEEDED(rv) && equals) {
|
||||
|
@ -1068,7 +1060,7 @@ NS_IMETHODIMP nsAbView::OnItemPropertyChanged(nsISupports *item, const char *pro
|
|||
if (index == -1)
|
||||
return NS_OK;
|
||||
|
||||
AbCard *oldCard = (AbCard*) (mCards.ElementAt(index));
|
||||
AbCard *oldCard = mCards.ElementAt(index);
|
||||
|
||||
// Malloc these from an arena
|
||||
AbCard *newCard = (AbCard *) PR_Calloc(1, sizeof(struct AbCard));
|
||||
|
|
|
@ -199,7 +199,7 @@ DIR_Server* DIR_GetServerFromList(const char* prefName)
|
|||
int32_t i;
|
||||
for (i = 0; i < count; ++i)
|
||||
{
|
||||
DIR_Server *server = (DIR_Server *)dir_ServerList->ElementAt(i);
|
||||
DIR_Server *server = dir_ServerList->ElementAt(i);
|
||||
|
||||
if (server && strcmp(server->prefName, prefName) == 0)
|
||||
{
|
||||
|
@ -249,7 +249,7 @@ nsresult DIR_ContainsServer(DIR_Server* pServer, bool *hasDir)
|
|||
int32_t i;
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
DIR_Server* server = (DIR_Server *)(dir_ServerList->ElementAt(i));
|
||||
DIR_Server* server = dir_ServerList->ElementAt(i);
|
||||
if (server == pServer)
|
||||
{
|
||||
*hasDir = true;
|
||||
|
@ -354,7 +354,7 @@ static bool DIR_SetServerPosition(nsTArray<DIR_Server*> *wholeList, DIR_Server *
|
|||
count = wholeList->Length();
|
||||
for (i= 0; i < count; i++)
|
||||
{
|
||||
if ((s = (DIR_Server *)wholeList->ElementAt(i)) != nullptr)
|
||||
if ((s = wholeList->ElementAt(i)) != nullptr)
|
||||
if (s == server)
|
||||
return false;
|
||||
}
|
||||
|
@ -364,7 +364,7 @@ static bool DIR_SetServerPosition(nsTArray<DIR_Server*> *wholeList, DIR_Server *
|
|||
*/
|
||||
if (count > 0)
|
||||
{
|
||||
s = (DIR_Server *)wholeList->ElementAt(count - 1);
|
||||
s = wholeList->ElementAt(count - 1);
|
||||
server->position = s->position + 1;
|
||||
}
|
||||
else
|
||||
|
@ -418,7 +418,7 @@ static bool DIR_SetServerPosition(nsTArray<DIR_Server*> *wholeList, DIR_Server *
|
|||
count = wholeList->Length();
|
||||
for (i= 0; i < count; i++)
|
||||
{
|
||||
if ((s = (DIR_Server *)wholeList->ElementAt(i)) != nullptr)
|
||||
if ((s = wholeList->ElementAt(i)) != nullptr)
|
||||
if (s == server)
|
||||
break;
|
||||
}
|
||||
|
@ -468,7 +468,7 @@ static DIR_Server *dir_MatchServerPrefToServer(nsTArray<DIR_Server*> *wholeList,
|
|||
int32_t i;
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
if ((server = (DIR_Server *)wholeList->ElementAt(i)) != nullptr)
|
||||
if ((server = wholeList->ElementAt(i)) != nullptr)
|
||||
{
|
||||
if (server->prefName && PL_strstr(pref, server->prefName) == pref)
|
||||
{
|
||||
|
@ -681,7 +681,7 @@ static void DIR_DeleteServerList(nsTArray<DIR_Server*> *wholeList)
|
|||
int32_t i;
|
||||
for (i = count - 1; i >=0; i--)
|
||||
{
|
||||
server = (DIR_Server *)wholeList->ElementAt(i);
|
||||
server = wholeList->ElementAt(i);
|
||||
if (server != nullptr)
|
||||
DIR_DeleteServer(server);
|
||||
}
|
||||
|
@ -1191,9 +1191,9 @@ void DIR_SortServersByPosition(nsTArray<DIR_Server*> *serverList)
|
|||
{
|
||||
for (j = i + 1; j < count; j++)
|
||||
{
|
||||
if (((DIR_Server *) serverList->ElementAt(j))->position < ((DIR_Server *) serverList->ElementAt(i))->position)
|
||||
if (serverList->ElementAt(j)->position < serverList->ElementAt(i)->position)
|
||||
{
|
||||
server = (DIR_Server *) serverList->ElementAt(i);
|
||||
server = serverList->ElementAt(i);
|
||||
serverList->ReplaceElementAt(i, serverList->ElementAt(j));
|
||||
serverList->ReplaceElementAt(j, server);
|
||||
}
|
||||
|
@ -1443,7 +1443,7 @@ static void DIR_SaveServerPreferences(nsTArray<DIR_Server*> *wholeList)
|
|||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
server = (DIR_Server *) wholeList->ElementAt(i);
|
||||
server = wholeList->ElementAt(i);
|
||||
if (server)
|
||||
DIR_SavePrefsForOneServer(server);
|
||||
}
|
||||
|
|
|
@ -6,13 +6,13 @@
|
|||
#ifndef _NSDIRPREFS_H_
|
||||
#define _NSDIRPREFS_H_
|
||||
|
||||
#include "nsTArray.h"
|
||||
|
||||
//
|
||||
// XXX nsDirPrefs is being greatly reduced if not removed altogether. Directory
|
||||
// Prefs etc. should be handled via their appropriate nsAb*Directory classes.
|
||||
//
|
||||
|
||||
template <class> class nsTArray;
|
||||
|
||||
#define kPreviousListVersion 2
|
||||
#define kCurrentListVersion 3
|
||||
#define PREF_LDAP_GLOBAL_TREE_NAME "ldap_2"
|
||||
|
|
|
@ -5584,7 +5584,7 @@ NS_IMETHODIMP nsMsgDBView::InsertTreeRows(nsMsgViewIndex aIndex,
|
|||
{
|
||||
// In a search/xfvf view only, a folder is required.
|
||||
NS_ENSURE_ARG_POINTER(aFolder);
|
||||
for (int32_t i = 0; i < aNumRows; i++)
|
||||
for (size_t i = 0; i < aNumRows; i++)
|
||||
// Insert into m_folders.
|
||||
if (!folders->InsertObjectAt(aFolder, aIndex + i))
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include "nsIMsgDatabase.h"
|
||||
#include "nsIMsgHdr.h"
|
||||
#include "MailNewsTypes.h"
|
||||
#include "nsTArray.h"
|
||||
#include "nsIDBChangeListener.h"
|
||||
#include "nsITreeView.h"
|
||||
#include "nsITreeBoxObject.h"
|
||||
|
|
|
@ -1013,7 +1013,7 @@ int32_t nsIMAPBodypartMultipart::Generate(nsIMAPBodyShell *aShell, bool stream,
|
|||
|
||||
if (ShouldFetchInline(aShell))
|
||||
{
|
||||
for (int i = 0; i < m_partList->Length(); i++)
|
||||
for (size_t i = 0; i < m_partList->Length(); i++)
|
||||
{
|
||||
if (!aShell->GetPseudoInterrupted())
|
||||
len += GenerateBoundary(aShell, stream, prefetch, false);
|
||||
|
@ -1086,7 +1086,7 @@ bool nsIMAPBodypartMultipart::PreflightCheckAllInline(nsIMAPBodyShell *aShell)
|
|||
{
|
||||
bool rv = ShouldFetchInline(aShell);
|
||||
|
||||
int i = 0;
|
||||
size_t i = 0;
|
||||
while (rv && (i < m_partList->Length()))
|
||||
{
|
||||
rv = m_partList->ElementAt(i)->PreflightCheckAllInline(aShell);
|
||||
|
|
|
@ -116,7 +116,7 @@ int nsIMAPNamespaceList::GetNumberOfNamespaces(EIMAPNamespaceType type)
|
|||
int nodeIndex = 0, count = 0;
|
||||
for (nodeIndex = m_NamespaceList.Length() - 1; nodeIndex >= 0; nodeIndex--)
|
||||
{
|
||||
nsIMAPNamespace *nspace = (nsIMAPNamespace *) m_NamespaceList.ElementAt(nodeIndex);
|
||||
nsIMAPNamespace *nspace = m_NamespaceList.ElementAt(nodeIndex);
|
||||
if (nspace->GetType() == type)
|
||||
{
|
||||
count++;
|
||||
|
@ -136,7 +136,7 @@ int nsIMAPNamespaceList::AddNewNamespace(nsIMAPNamespace *ns)
|
|||
// iterate backwards because we delete elements
|
||||
for (nodeIndex = m_NamespaceList.Length() - 1; nodeIndex >= 0; nodeIndex--)
|
||||
{
|
||||
nsIMAPNamespace *nspace = (nsIMAPNamespace *) m_NamespaceList.ElementAt(nodeIndex);
|
||||
nsIMAPNamespace *nspace = m_NamespaceList.ElementAt(nodeIndex);
|
||||
// if we find existing namespace(s) that matches the
|
||||
// new one, we'll just remove the old ones and let the
|
||||
// new one get added when we've finished checking for
|
||||
|
@ -169,7 +169,7 @@ nsIMAPNamespace *nsIMAPNamespaceList::GetDefaultNamespaceOfType(EIMAPNamespaceTy
|
|||
int nodeIndex, count = m_NamespaceList.Length();
|
||||
for (nodeIndex= 0; nodeIndex < count && !rv; nodeIndex++)
|
||||
{
|
||||
nsIMAPNamespace *ns = (nsIMAPNamespace *) m_NamespaceList.ElementAt(nodeIndex);
|
||||
nsIMAPNamespace *ns = m_NamespaceList.ElementAt(nodeIndex);
|
||||
if (ns->GetType() == type)
|
||||
{
|
||||
if (!firstOfType)
|
||||
|
@ -200,7 +200,7 @@ void nsIMAPNamespaceList::ClearNamespaces(bool deleteFromPrefsNamespaces, bool d
|
|||
// iterate backwards because we delete elements
|
||||
for (nodeIndex = m_NamespaceList.Length() - 1; nodeIndex >= 0; nodeIndex--)
|
||||
{
|
||||
nsIMAPNamespace *ns = (nsIMAPNamespace *) m_NamespaceList.ElementAt(nodeIndex);
|
||||
nsIMAPNamespace *ns = m_NamespaceList.ElementAt(nodeIndex);
|
||||
if (ns->GetIsNamespaceFromPrefs())
|
||||
{
|
||||
if (deleteFromPrefsNamespaces)
|
||||
|
@ -225,15 +225,15 @@ nsIMAPNamespace *nsIMAPNamespaceList::GetNamespaceNumber(int nodeIndex)
|
|||
if (nodeIndex < 0) nodeIndex = 0;
|
||||
|
||||
// XXX really could be just ElementAt; that's why we have the assertion
|
||||
return (nsIMAPNamespace *) m_NamespaceList.SafeElementAt(nodeIndex);
|
||||
return m_NamespaceList.SafeElementAt(nodeIndex);
|
||||
}
|
||||
|
||||
nsIMAPNamespace *nsIMAPNamespaceList::GetNamespaceNumber(int nodeIndex, EIMAPNamespaceType type)
|
||||
{
|
||||
int nodeCount, count = 0;
|
||||
for (nodeCount=m_NamespaceList.Length() - 1; nodeCount >= 0; nodeCount--)
|
||||
for (nodeCount = m_NamespaceList.Length() - 1; nodeCount >= 0; nodeCount--)
|
||||
{
|
||||
nsIMAPNamespace *nspace = (nsIMAPNamespace *) m_NamespaceList.ElementAt(nodeCount);
|
||||
nsIMAPNamespace *nspace = m_NamespaceList.ElementAt(nodeCount);
|
||||
if (nspace->GetType() == type)
|
||||
{
|
||||
count++;
|
||||
|
@ -265,7 +265,7 @@ nsIMAPNamespace *nsIMAPNamespaceList::GetNamespaceForMailbox(const char *boxname
|
|||
|
||||
for (nodeIndex = m_NamespaceList.Length() - 1; nodeIndex >= 0; nodeIndex--)
|
||||
{
|
||||
nsIMAPNamespace *nspace = (nsIMAPNamespace *) m_NamespaceList.ElementAt(nodeIndex);
|
||||
nsIMAPNamespace *nspace = m_NamespaceList.ElementAt(nodeIndex);
|
||||
currentMatchedLength = nspace->MailboxMatchesNamespace(boxname);
|
||||
if (currentMatchedLength > lengthMatched)
|
||||
{
|
||||
|
|
|
@ -543,7 +543,7 @@ nsImapIncomingServer::LoadNextQueuedUrl(nsIImapProtocol *aProtocol, bool *aResul
|
|||
// if we didn't doom the url, lets run it.
|
||||
if (!removeUrlFromQueue)
|
||||
{
|
||||
nsISupports *aConsumer = (nsISupports*)m_urlConsumers.ElementAt(0);
|
||||
nsISupports *aConsumer = m_urlConsumers.ElementAt(0);
|
||||
NS_IF_ADDREF(aConsumer);
|
||||
|
||||
nsImapProtocol::LogImapUrl("creating protocol instance to play queued url", aImapUrl);
|
||||
|
|
|
@ -6774,15 +6774,15 @@ bool nsImapProtocol::RenameHierarchyByHand(const char *oldParentMailboxName,
|
|||
RenameMailboxRespectingSubscriptions(oldParentMailboxName,
|
||||
newParentMailboxName, true);
|
||||
|
||||
int32_t numberToDelete = m_deletableChildren->Length();
|
||||
int32_t childIndex;
|
||||
size_t numberToDelete = m_deletableChildren->Length();
|
||||
size_t childIndex;
|
||||
|
||||
for (childIndex = 0;
|
||||
(childIndex < numberToDelete) && renameSucceeded; childIndex++)
|
||||
{
|
||||
// the imap parser has already converted to a non UTF7 string in the canonical
|
||||
// format so convert it back
|
||||
char *currentName = (char *) m_deletableChildren->ElementAt(childIndex);
|
||||
char *currentName = m_deletableChildren->ElementAt(childIndex);
|
||||
if (currentName)
|
||||
{
|
||||
char *serverName = nullptr;
|
||||
|
@ -6838,8 +6838,8 @@ bool nsImapProtocol::DeleteSubFolders(const char* selectedMailbox, bool &aDelete
|
|||
// longest name mailbox. Deleting the longest first will hopefully
|
||||
// prevent the server from having problems about deleting parents
|
||||
// ** jt - why? I don't understand this.
|
||||
int32_t numberToDelete = m_deletableChildren->Length();
|
||||
int32_t outerIndex, innerIndex;
|
||||
size_t numberToDelete = m_deletableChildren->Length();
|
||||
size_t outerIndex, innerIndex;
|
||||
|
||||
// intelligently decide if myself(either plain format or following the dir-separator)
|
||||
// is in the sub-folder list
|
||||
|
@ -6853,7 +6853,7 @@ bool nsImapProtocol::DeleteSubFolders(const char* selectedMailbox, bool &aDelete
|
|||
strcpy(selectedMailboxDir, selectedMailbox);
|
||||
selectedMailboxDir[length] = onlineDirSeparator;
|
||||
selectedMailboxDir[length+1] = '\0';
|
||||
int32_t i;
|
||||
size_t i;
|
||||
for( i=0; i<numberToDelete && !folderInSubfolderList; i++ )
|
||||
{
|
||||
char *currentName = m_deletableChildren->ElementAt(i);
|
||||
|
@ -6869,7 +6869,7 @@ bool nsImapProtocol::DeleteSubFolders(const char* selectedMailbox, bool &aDelete
|
|||
outerIndex++)
|
||||
{
|
||||
char* longestName = nullptr;
|
||||
int32_t longestIndex = 0; // fix bogus warning by initializing
|
||||
size_t longestIndex = 0; // fix bogus warning by initializing
|
||||
for (innerIndex = 0;
|
||||
innerIndex < m_deletableChildren->Length();
|
||||
innerIndex++)
|
||||
|
|
|
@ -61,8 +61,8 @@ public:
|
|||
|
||||
void EmptyList(void) {
|
||||
CAliasData *pData;
|
||||
for (int32_t i = 0; i < m_list.Length(); i++) {
|
||||
pData = (CAliasData *)m_list.ElementAt(i);
|
||||
for (size_t i = 0; i < m_list.Length(); i++) {
|
||||
pData = m_list.ElementAt(i);
|
||||
delete pData;
|
||||
}
|
||||
m_list.Clear();
|
||||
|
@ -157,7 +157,7 @@ int32_t nsEudoraAddress::CountWhiteSpace(const char *pLine, int32_t len)
|
|||
void nsEudoraAddress::EmptyAliases(void)
|
||||
{
|
||||
CAliasEntry *pData;
|
||||
for (int32_t i = 0; i < m_alias.Length(); i++) {
|
||||
for (size_t i = 0; i < m_alias.Length(); i++) {
|
||||
pData = m_alias.ElementAt(i);
|
||||
delete pData;
|
||||
}
|
||||
|
@ -546,7 +546,7 @@ void DumpAliasArray(nsTArray<CAliasEntry*>& a)
|
|||
if (pEntry->m_list.Length() > 1) {
|
||||
IMPORT_LOG1("\tList count #%ld\n", pEntry->m_list.Length());
|
||||
for (int32_t j = 0; j < pEntry->m_list.Length(); j++) {
|
||||
pData = (CAliasData *) pEntry->m_list.ElementAt(j);
|
||||
pData = pEntry->m_list.ElementAt(j);
|
||||
IMPORT_LOG0("\t\t--------\n");
|
||||
IMPORT_LOG1("\t\temail: %s\n", pData->m_email.get());
|
||||
IMPORT_LOG1("\t\trealName: %s\n", pData->m_realName.get());
|
||||
|
@ -554,7 +554,7 @@ void DumpAliasArray(nsTArray<CAliasEntry*>& a)
|
|||
}
|
||||
}
|
||||
else if (pEntry->m_list.Length()) {
|
||||
pData = (CAliasData *) pEntry->m_list.ElementAt(0);
|
||||
pData = pEntry->m_list.ElementAt(0);
|
||||
IMPORT_LOG1("\t\temail: %s\n", pData->m_email.get());
|
||||
IMPORT_LOG1("\t\trealName: %s\n", pData->m_realName.get());
|
||||
IMPORT_LOG1("\t\tnickName: %s\n", pData->m_nickName.get());
|
||||
|
@ -589,7 +589,7 @@ void nsEudoraAddress::ResolveEntries(nsCString& name, nsTArray<CAliasData*>& lis
|
|||
CAliasData * pData;
|
||||
CAliasEntry * pEntry;
|
||||
for (i = 0; i < max; i++) {
|
||||
pData = (CAliasData *)list.ElementAt(i);
|
||||
pData = list.ElementAt(i);
|
||||
// resolve the email to an existing alias!
|
||||
if (!name.Equals(pData->m_email, nsCaseInsensitiveCStringComparator()) &&
|
||||
((pEntry = ResolveAlias(pData->m_fullEntry)) != nullptr)) {
|
||||
|
@ -863,7 +863,7 @@ void nsEudoraAddress::AddSingleCard(CAliasEntry *pEntry, nsTArray<CAliasData*> &
|
|||
}
|
||||
}
|
||||
|
||||
CAliasData *pData = emailList.Length() ? (CAliasData *)emailList.ElementAt(0) : nullptr;
|
||||
CAliasData *pData = emailList.Length() ? emailList.ElementAt(0) : nullptr;
|
||||
|
||||
if (pData && !pData->m_realName.IsEmpty())
|
||||
displayName = pData->m_realName;
|
||||
|
@ -1014,7 +1014,7 @@ void nsEudoraAddress::RememberGroupMembers(nsTArray<CAliasData*> &membersArray,
|
|||
|
||||
for (int32_t i = 0; i < cnt; i++)
|
||||
{
|
||||
pData = (CAliasData *)emailList.ElementAt(i);
|
||||
pData = emailList.ElementAt(i);
|
||||
if (!pData)
|
||||
continue;
|
||||
|
||||
|
@ -1041,7 +1041,7 @@ nsresult nsEudoraAddress::AddGroupMembersAsCards(nsTArray<CAliasData*> &membersA
|
|||
|
||||
for (int32_t i = 0; i < max; i++)
|
||||
{
|
||||
pData = (CAliasData *)membersArray.ElementAt(i);
|
||||
pData = membersArray.ElementAt(i);
|
||||
|
||||
if (!pData || (pData->m_email.IsEmpty()))
|
||||
continue;
|
||||
|
@ -1095,7 +1095,7 @@ nsresult nsEudoraAddress::AddSingleList(CAliasEntry *pEntry, nsTArray<CAliasData
|
|||
int32_t max = emailList.Length();
|
||||
for (int32_t i = 0; i < max; i++)
|
||||
{
|
||||
CAliasData *pData = (CAliasData *)emailList.ElementAt(i);
|
||||
CAliasData *pData = emailList.ElementAt(i);
|
||||
nsAutoCString ldifValue("mail");
|
||||
ldifValue.Append(pData->m_email);
|
||||
rv = pDb->AddLdifListMember(newRow, ldifValue.get());
|
||||
|
|
|
@ -521,7 +521,7 @@ nsresult nsEudoraCompose::GetLocalAttachments(nsIArray **aArray)
|
|||
// nsMsgNewURL(&url, "file://C:/boxster.jpg");
|
||||
// a[i].orig_url = url;
|
||||
|
||||
pAttach = (ImportAttachment *) m_pAttachments->ElementAt(i);
|
||||
pAttach = m_pAttachments->ElementAt(i);
|
||||
nsCOMPtr<nsIFile> tmpFile = do_QueryInterface(pAttach->pAttachment);
|
||||
a->SetTmpFile(tmpFile);
|
||||
urlStr.Adopt(0);
|
||||
|
|
|
@ -1219,7 +1219,7 @@ void nsEudoraMailbox::EmptyAttachments(void)
|
|||
int32_t max = m_attachments.Length();
|
||||
ImportAttachment * pAttach;
|
||||
for (int32_t i = 0; i < max; i++) {
|
||||
pAttach = (ImportAttachment *) m_attachments.ElementAt(i);
|
||||
pAttach = m_attachments.ElementAt(i);
|
||||
if (pAttach) {
|
||||
NS_Free(pAttach->description);
|
||||
NS_Free(pAttach->mimeType);
|
||||
|
|
|
@ -1106,7 +1106,7 @@ void CMapiApi::ClearMessageStores(void)
|
|||
{
|
||||
if (m_pStores) {
|
||||
CMsgStore * pStore;
|
||||
for (int i = 0; i < m_pStores->Length(); i++) {
|
||||
for (size_t i = 0; i < m_pStores->Length(); i++) {
|
||||
pStore = m_pStores->ElementAt(i);
|
||||
delete pStore;
|
||||
}
|
||||
|
@ -1131,7 +1131,7 @@ CMsgStore * CMapiApi::FindMessageStore(ULONG cbEid, LPENTRYID lpEid)
|
|||
ULONG result;
|
||||
HRESULT hr;
|
||||
CMsgStore * pStore;
|
||||
for (int i = 0; i < m_pStores->Length(); i++) {
|
||||
for (size_t i = 0; i < m_pStores->Length(); i++) {
|
||||
pStore = m_pStores->ElementAt(i);
|
||||
hr = m_lpSession->CompareEntryIDs(cbEid, lpEid, pStore->GetCBEntryID(), pStore->GetLPEntryID(),
|
||||
0, &result);
|
||||
|
@ -1635,7 +1635,7 @@ void CMapiFolderList::GenerateFilePath(CMapiFolder *pFolder)
|
|||
void CMapiFolderList::ClearAll(void)
|
||||
{
|
||||
CMapiFolder *pFolder;
|
||||
for (int i = 0; i < m_array.Length(); i++) {
|
||||
for (size_t i = 0; i < m_array.Length(); i++) {
|
||||
pFolder = GetAt(i);
|
||||
delete pFolder;
|
||||
}
|
||||
|
@ -1650,7 +1650,7 @@ void CMapiFolderList::DumpList(void)
|
|||
char prefix[256];
|
||||
|
||||
MAPI_TRACE0("Folder List ---------------------------------\n");
|
||||
for (int i = 0; i < m_array.Length(); i++) {
|
||||
for (size_t i = 0; i < m_array.Length(); i++) {
|
||||
pFolder = GetAt(i);
|
||||
depth = pFolder->GetDepth();
|
||||
pFolder->GetDisplayName(str);
|
||||
|
|
|
@ -198,7 +198,7 @@ public:
|
|||
~CMapiFolderList();
|
||||
|
||||
void AddItem(CMapiFolder *pFolder);
|
||||
CMapiFolder * GetItem(int index) { if ((index >= 0) && (index < m_array.Length())) return GetAt(index); else return NULL;}
|
||||
CMapiFolder * GetItem(int index) { if ((index >= 0) && (index < (int)m_array.Length())) return GetAt(index); else return NULL;}
|
||||
void ClearAll(void);
|
||||
|
||||
// Debugging and reporting
|
||||
|
|
|
@ -76,7 +76,7 @@ nsImportFieldMap::~nsImportFieldMap()
|
|||
|
||||
nsString * pStr;
|
||||
for (int32_t i = 0; i < m_mozFieldCount; i++) {
|
||||
pStr = (nsString *) m_descriptions.ElementAt(i);
|
||||
pStr = m_descriptions.ElementAt(i);
|
||||
delete pStr;
|
||||
}
|
||||
m_descriptions.Clear();
|
||||
|
@ -110,10 +110,10 @@ NS_IMETHODIMP nsImportFieldMap::GetFieldDescription(int32_t index, char16_t **_r
|
|||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
*_retval = nullptr;
|
||||
if ((index < 0) || (index >= m_descriptions.Length()))
|
||||
if ((index < 0) || ((size_t)index >= m_descriptions.Length()))
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
*_retval = ToNewUnicode(*((nsString *)m_descriptions.ElementAt(index)));
|
||||
*_retval = ToNewUnicode(*(m_descriptions.ElementAt(index)));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,20 +5,20 @@
|
|||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
[ptr] native nsPop3UidlEntryArrayRef(nsTArray<Pop3UidlEntry*>);
|
||||
[ptr] native Pop3UidlEntryArrayRef(nsTArray<Pop3UidlEntry*>);
|
||||
|
||||
%{C++
|
||||
#include "nsTArray.h"
|
||||
struct Pop3UidlEntry;
|
||||
%}
|
||||
|
||||
[scriptable, uuid(f3e1c1e8-3005-4554-9d46-595b1713a3a6)]
|
||||
[scriptable, uuid(3aff0550-87de-4337-9bc1-c84eb5462afe)]
|
||||
interface nsIPop3Protocol : nsISupports {
|
||||
/* aUidl is an array of pointers to Pop3UidlEntry's. That structure is
|
||||
* currently defined in nsPop3Protocol.h, perhaps it should be here
|
||||
* instead...
|
||||
*/
|
||||
[noscript] void markMessages(in nsPop3UidlEntryArrayRef aUidl);
|
||||
[noscript] void markMessages(in Pop3UidlEntryArrayRef aUidl);
|
||||
boolean checkMessage(in string aUidl);
|
||||
};
|
||||
|
||||
|
|
|
@ -866,7 +866,7 @@ void nsParseMailMessageState::GetAggregateHeader (nsTArray<struct message_header
|
|||
|
||||
struct message_header *header = nullptr;
|
||||
int length = 0;
|
||||
int i;
|
||||
size_t i;
|
||||
|
||||
// Count up the bytes required to allocate the aggregated header
|
||||
for (i = 0; i < list.Length(); i++)
|
||||
|
@ -882,7 +882,7 @@ void nsParseMailMessageState::GetAggregateHeader (nsTArray<struct message_header
|
|||
{
|
||||
// Catenate all the To lines together, separated by commas
|
||||
value[0] = '\0';
|
||||
int size = list.Length();
|
||||
size_t size = list.Length();
|
||||
for (i = 0; i < size; i++)
|
||||
{
|
||||
header = list.ElementAt(i);
|
||||
|
@ -906,7 +906,7 @@ void nsParseMailMessageState::ClearAggregateHeader (nsTArray<struct message_head
|
|||
// Reset the aggregate headers. Free only the message_header struct since
|
||||
// we don't own the value pointer
|
||||
|
||||
for (int i = 0; i < list.Length(); i++)
|
||||
for (size_t i = 0; i < list.Length(); i++)
|
||||
PR_Free (list.ElementAt(i));
|
||||
list.Clear();
|
||||
}
|
||||
|
|
|
@ -91,8 +91,6 @@ nsMimeBaseEmitter::nsMimeBaseEmitter()
|
|||
|
||||
nsMimeBaseEmitter::~nsMimeBaseEmitter(void)
|
||||
{
|
||||
int32_t i;
|
||||
|
||||
// Delete the buffer manager...
|
||||
if (mBufferMgr)
|
||||
{
|
||||
|
@ -103,9 +101,9 @@ nsMimeBaseEmitter::~nsMimeBaseEmitter(void)
|
|||
// Clean up the attachment array structures...
|
||||
if (mAttachArray)
|
||||
{
|
||||
for (i=0; i<mAttachArray->Length(); i++)
|
||||
for (size_t i = 0; i < mAttachArray->Length(); i++)
|
||||
{
|
||||
attachmentInfoType *attachInfo = (attachmentInfoType *)mAttachArray->ElementAt(i);
|
||||
attachmentInfoType *attachInfo = mAttachArray->ElementAt(i);
|
||||
if (!attachInfo)
|
||||
continue;
|
||||
|
||||
|
@ -138,7 +136,7 @@ nsMimeBaseEmitter::CleanupHeaderArray(nsTArray<headerInfoType*> *aArray)
|
|||
if (!aArray)
|
||||
return;
|
||||
|
||||
for (int32_t i=0; i<aArray->Length(); i++)
|
||||
for (size_t i = 0; i < aArray->Length(); i++)
|
||||
{
|
||||
headerInfoType *headerInfo = aArray->ElementAt(i);
|
||||
if (!headerInfo)
|
||||
|
@ -500,14 +498,13 @@ nsMimeBaseEmitter::WriteHelper(const nsACString &buf, uint32_t *countWritten)
|
|||
const char *
|
||||
nsMimeBaseEmitter::GetHeaderValue(const char *aHeaderName)
|
||||
{
|
||||
int32_t i;
|
||||
char *retVal = nullptr;
|
||||
nsTArray<headerInfoType*> *array = mDocHeader? mHeaderArray : mEmbeddedHeaderArray;
|
||||
|
||||
if (!array)
|
||||
return nullptr;
|
||||
|
||||
for (i = 0; i < array->Length(); i++)
|
||||
for (size_t i = 0; i < array->Length(); i++)
|
||||
{
|
||||
headerInfoType *headerInfo = array->ElementAt(i);
|
||||
if ( (!headerInfo) || (!headerInfo->name) || (!(*headerInfo->name)) )
|
||||
|
@ -985,12 +982,11 @@ nsMimeBaseEmitter::DumpToCC()
|
|||
nsresult
|
||||
nsMimeBaseEmitter::DumpRestOfHeaders()
|
||||
{
|
||||
int32_t i;
|
||||
nsTArray<headerInfoType*> *array = mDocHeader? mHeaderArray : mEmbeddedHeaderArray;
|
||||
|
||||
mHTMLHeaders.Append("<table border=0 cellspacing=0 cellpadding=0 width=\"100%\" class=\"header-part3\">");
|
||||
|
||||
for (i = 0; i < array->Length(); i++)
|
||||
for (size_t i = 0; i < array->Length(); i++)
|
||||
{
|
||||
headerInfoType *headerInfo = array->ElementAt(i);
|
||||
if ( (!headerInfo) || (!headerInfo->name) || (!(*headerInfo->name)) ||
|
||||
|
|
|
@ -184,7 +184,7 @@ nsresult nsMimeHtmlDisplayEmitter::BroadcastHeaders(nsIMsgHeaderSink * aHeaderSi
|
|||
}
|
||||
}
|
||||
|
||||
for (int32_t i=0; i<mHeaderArray->Length(); i++)
|
||||
for (size_t i = 0; i < mHeaderArray->Length(); i++)
|
||||
{
|
||||
headerInfoType * headerInfo = mHeaderArray->ElementAt(i);
|
||||
if ( (!headerInfo) || (!headerInfo->name) || (!(*headerInfo->name)) || (!headerInfo->value) || (!(*headerInfo->value)))
|
||||
|
@ -251,7 +251,7 @@ NS_IMETHODIMP nsMimeHtmlDisplayEmitter::WriteHTMLHeaders(const nsACString &name)
|
|||
mFirstHeaders = false;
|
||||
|
||||
bool bFromNewsgroups = false;
|
||||
for (int32_t j=0; j < mHeaderArray->Length(); j++)
|
||||
for (size_t j = 0; j < mHeaderArray->Length(); j++)
|
||||
{
|
||||
headerInfoType *headerInfo = mHeaderArray->ElementAt(j);
|
||||
if (!(headerInfo && headerInfo->name && *headerInfo->name))
|
||||
|
|
Загрузка…
Ссылка в новой задаче