Bug 962821 - error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]; r=jcranmer
This commit is contained in:
Родитель
21eb8fb6ff
Коммит
bd96638e40
|
@ -1897,7 +1897,7 @@ static pvl_list expand_by_day(icalrecur_iterator* impl, int year)
|
|||
}
|
||||
|
||||
/* Then just multiple the position times 7 to get the pos'th day in the year */
|
||||
pvl_push(days_list,(void*)(first+ (pos-1) * 7));
|
||||
pvl_push(days_list,(void*)(ptrdiff_t)(first + (pos-1) * 7));
|
||||
|
||||
} else { /* pos < 0 */
|
||||
int last;
|
||||
|
@ -1910,7 +1910,7 @@ static pvl_list expand_by_day(icalrecur_iterator* impl, int year)
|
|||
last = end_year_day - end_dow + dow - 7;
|
||||
}
|
||||
|
||||
pvl_push(days_list,(void*)(last - (pos-1) * 7));
|
||||
pvl_push(days_list,(void*)(ptrdiff_t)(last - (pos-1) * 7));
|
||||
}
|
||||
}
|
||||
return days_list;
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include "nsILineInputStream.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsISeekableStream.h"
|
||||
#include "nsVoidArray.h"
|
||||
#include "mdb.h"
|
||||
#include "plstr.h"
|
||||
#include "prmem.h"
|
||||
|
@ -71,8 +70,8 @@ NS_IMETHODIMP nsAbLDIFService::ImportLDIFFile(nsIAddrDatabase *aDb, nsIFile *aSr
|
|||
char* pBuf = &buf[0];
|
||||
int32_t startPos = 0;
|
||||
uint32_t len = 0;
|
||||
nsVoidArray listPosArray; // where each list/group starts in ldif file
|
||||
nsVoidArray listSizeArray; // size of the list/group info
|
||||
nsTArray<int32_t> listPosArray; // where each list/group starts in ldif file
|
||||
nsTArray<int32_t> listSizeArray; // size of the list/group info
|
||||
int32_t savedStartPos = 0;
|
||||
int32_t filePos = 0;
|
||||
uint64_t bytesLeft = 0;
|
||||
|
@ -97,8 +96,8 @@ NS_IMETHODIMP nsAbLDIFService::ImportLDIFFile(nsIAddrDatabase *aDb, nsIFile *aSr
|
|||
else
|
||||
{
|
||||
//keep file position for mailing list
|
||||
listPosArray.AppendElement((void*)savedStartPos);
|
||||
listSizeArray.AppendElement((void*)(filePos + startPos-savedStartPos));
|
||||
listPosArray.AppendElement(savedStartPos);
|
||||
listSizeArray.AppendElement(filePos + startPos-savedStartPos);
|
||||
ClearLdifRecordBuffer();
|
||||
}
|
||||
savedStartPos = filePos + startPos;
|
||||
|
@ -110,12 +109,12 @@ NS_IMETHODIMP nsAbLDIFService::ImportLDIFFile(nsIAddrDatabase *aDb, nsIFile *aSr
|
|||
}
|
||||
//last row
|
||||
if (!mLdifLine.IsEmpty() && mLdifLine.Find("groupOfNames") == -1)
|
||||
AddLdifRowToDatabase(aDb, false);
|
||||
AddLdifRowToDatabase(aDb, false);
|
||||
|
||||
// mail Lists
|
||||
int32_t i, pos;
|
||||
uint32_t size;
|
||||
int32_t listTotal = listPosArray.Count();
|
||||
int32_t listTotal = listPosArray.Length();
|
||||
char *listBuf;
|
||||
ClearLdifRecordBuffer(); // make sure the buffer is clean
|
||||
|
||||
|
@ -124,8 +123,8 @@ NS_IMETHODIMP nsAbLDIFService::ImportLDIFFile(nsIAddrDatabase *aDb, nsIFile *aSr
|
|||
|
||||
for (i = 0; i < listTotal; i++)
|
||||
{
|
||||
pos = NS_PTR_TO_INT32(listPosArray.ElementAt(i));
|
||||
size = NS_PTR_TO_INT32(listSizeArray.ElementAt(i));
|
||||
pos = listPosArray[i];
|
||||
size = listSizeArray[i];
|
||||
if (NS_SUCCEEDED(seekableStream->Seek(nsISeekableStream::NS_SEEK_SET, pos)))
|
||||
{
|
||||
// Allocate enough space for the lists/groups as the size varies.
|
||||
|
|
|
@ -467,7 +467,7 @@ nsresult nsMsgDatabase::AddHdrToCache(nsIMsgDBHdr *hdr, nsMsgKey key) // do we w
|
|||
hdr->GetMessageKey(&key);
|
||||
if (m_cachedHeaders->entryCount > m_cacheSize)
|
||||
ClearHdrCache(true);
|
||||
PLDHashEntryHdr *entry = PL_DHashTableOperate(m_cachedHeaders, (void *) key, PL_DHASH_ADD);
|
||||
PLDHashEntryHdr *entry = PL_DHashTableOperate(m_cachedHeaders, (void *)(uintptr_t) key, PL_DHASH_ADD);
|
||||
if (!entry)
|
||||
return NS_ERROR_OUT_OF_MEMORY; // XXX out of memory
|
||||
|
||||
|
@ -634,10 +634,10 @@ nsresult nsMsgDatabase::RemoveHdrFromCache(nsIMsgDBHdr *hdr, nsMsgKey key)
|
|||
if (key == nsMsgKey_None)
|
||||
hdr->GetMessageKey(&key);
|
||||
|
||||
PLDHashEntryHdr *entry = PL_DHashTableOperate(m_cachedHeaders, (const void *) key, PL_DHASH_LOOKUP);
|
||||
PLDHashEntryHdr *entry = PL_DHashTableOperate(m_cachedHeaders, (const void *)(uintptr_t) key, PL_DHASH_LOOKUP);
|
||||
if (PL_DHASH_ENTRY_IS_BUSY(entry))
|
||||
{
|
||||
PL_DHashTableOperate(m_cachedHeaders, (void *) key, PL_DHASH_REMOVE);
|
||||
PL_DHashTableOperate(m_cachedHeaders, (void *)(uintptr_t) key, PL_DHASH_REMOVE);
|
||||
NS_RELEASE(hdr); // get rid of extra ref the cache was holding.
|
||||
}
|
||||
|
||||
|
@ -658,7 +658,7 @@ nsresult nsMsgDatabase::GetHdrFromUseCache(nsMsgKey key, nsIMsgDBHdr* *result)
|
|||
if (m_headersInUse)
|
||||
{
|
||||
PLDHashEntryHdr *entry;
|
||||
entry = PL_DHashTableOperate(m_headersInUse, (const void *) key, PL_DHASH_LOOKUP);
|
||||
entry = PL_DHashTableOperate(m_headersInUse, (const void *)(uintptr_t) key, PL_DHASH_LOOKUP);
|
||||
if (PL_DHASH_ENTRY_IS_BUSY(entry))
|
||||
{
|
||||
MsgHdrHashElement* element = reinterpret_cast<MsgHdrHashElement*>(entry);
|
||||
|
@ -697,7 +697,7 @@ bool
|
|||
nsMsgDatabase::MatchEntry(PLDHashTable* aTable, const PLDHashEntryHdr* aEntry, const void* aKey)
|
||||
{
|
||||
const MsgHdrHashElement* hdr = reinterpret_cast<const MsgHdrHashElement*>(aEntry);
|
||||
return aKey == (const void *) hdr->mKey; // ### or get the key from the hdr...
|
||||
return aKey == (const void *)(uintptr_t) hdr->mKey; // ### or get the key from the hdr...
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -731,7 +731,7 @@ nsresult nsMsgDatabase::AddHdrToUseCache(nsIMsgDBHdr *hdr, nsMsgKey key)
|
|||
{
|
||||
if (key == nsMsgKey_None)
|
||||
hdr->GetMessageKey(&key);
|
||||
PLDHashEntryHdr *entry = PL_DHashTableOperate(m_headersInUse, (void *) key, PL_DHASH_ADD);
|
||||
PLDHashEntryHdr *entry = PL_DHashTableOperate(m_headersInUse, (void *)(uintptr_t) key, PL_DHASH_ADD);
|
||||
if (!entry)
|
||||
return NS_ERROR_OUT_OF_MEMORY; // XXX out of memory
|
||||
|
||||
|
@ -767,7 +767,7 @@ nsresult nsMsgDatabase::RemoveHdrFromUseCache(nsIMsgDBHdr *hdr, nsMsgKey key)
|
|||
if (key == nsMsgKey_None)
|
||||
hdr->GetMessageKey(&key);
|
||||
|
||||
PL_DHashTableOperate(m_headersInUse, (void *) key, PL_DHASH_REMOVE);
|
||||
PL_DHashTableOperate(m_headersInUse, (void *)(uintptr_t) key, PL_DHASH_REMOVE);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -1090,7 +1090,7 @@ nsresult nsPop3Protocol::LoadUrl(nsIURI* aURL, nsISupports * /* aConsumer */)
|
|||
uint32_t nowInSeconds = TimeInSecondsFromPRTime(PR_Now());
|
||||
uint32_t cutOffDay = nowInSeconds - (60 * 60 * 24 * numDaysToLeaveOnServer);
|
||||
|
||||
PL_HashTableEnumerateEntries(m_pop3ConData->uidlinfo->hash, net_pop3_delete_old_msgs_mapper, (void *) cutOffDay);
|
||||
PL_HashTableEnumerateEntries(m_pop3ConData->uidlinfo->hash, net_pop3_delete_old_msgs_mapper, (void *)(uintptr_t) cutOffDay);
|
||||
}
|
||||
const char* uidl = PL_strcasestr(queryPart.get(), "uidl=");
|
||||
PR_FREEIF(m_pop3ConData->only_uidl);
|
||||
|
|
Загрузка…
Ссылка в новой задаче