Bug 785738 Part 6: use PRTime where appropriate, and add reinterpret_casts to int64_t in corresponding GetInt64 calls. r=ehsan

/home/landry/src/mozilla-central/toolkit/components/places/nsNavHistory.cpp:
In member function 'bool nsNavHistory::FindLastVisit(nsIURI*, int64_t*,
PRTime*, int64_t*)':
/home/landry/src/mozilla-central/toolkit/components/places/nsNavHistory.cpp:619:
error: invalid static_cast from type 'PRTime*' to type 'int64_t*'
/home/landry/src/mozilla-central/toolkit/components/places/nsNavHistory.cpp:
In member function 'bool
nsNavHistory::CheckIsRecentEvent(nsDataHashtable<nsCStringHashKey, long
long int>*, const nsACString_internal&)':
/home/landry/src/mozilla-central/toolkit/components/places/nsNavHistory.cpp:4360:
error: invalid static_cast from type 'PRTime*' to type 'int64_t*'
This commit is contained in:
Landry Breuil 2012-08-30 09:10:49 +02:00
parent d47685dcd8
commit 26986d4dea
6 changed files with 17 additions and 17 deletions

View File

@ -230,7 +230,7 @@ FetchIconInfo(nsRefPtr<Database>& aDB,
rv = stmt->GetIsNull(1, &isNull);
NS_ENSURE_SUCCESS(rv, rv);
if (!isNull) {
rv = stmt->GetInt64(1, &_icon.expiration);
rv = stmt->GetInt64(1, reinterpret_cast<int64_t*>(&_icon.expiration));
NS_ENSURE_SUCCESS(rv, rv);
}

View File

@ -938,7 +938,7 @@ private:
NS_ENSURE_SUCCESS(rv, false);
rv = stmt->GetInt64(1, &_place.sessionId);
NS_ENSURE_SUCCESS(rv, false);
rv = stmt->GetInt64(2, &_place.visitTime);
rv = stmt->GetInt64(2, reinterpret_cast<int64_t*>(&_place.visitTime));
NS_ENSURE_SUCCESS(rv, false);
// If we have been given a visit threshold start time, go ahead and

View File

@ -65,8 +65,8 @@ interface nsIBrowserHistory : nsIGlobalHistory2
*
* @note The removal happens in a batch.
*/
void removePagesByTimeframe(in long long aBeginTime,
in long long aEndTime);
void removePagesByTimeframe(in PRTime aBeginTime,
in PRTime aEndTime);
/**
* Removes all visits in a given timeframe.
@ -80,8 +80,8 @@ interface nsIBrowserHistory : nsIGlobalHistory2
*
* @note The removal happens in a batch.
*/
void removeVisitsByTimeframe(in long long aBeginTime,
in long long aEndTime);
void removeVisitsByTimeframe(in PRTime aBeginTime,
in PRTime aEndTime);
/**
* Removes all existing pages from global history.

View File

@ -1468,9 +1468,9 @@ nsNavBookmarks::FetchItemInfo(int64_t aItemId,
NS_ENSURE_SUCCESS(rv, rv);
rv = stmt->GetInt32(6, &_bookmark.type);
NS_ENSURE_SUCCESS(rv, rv);
rv = stmt->GetInt64(7, &_bookmark.dateAdded);
rv = stmt->GetInt64(7, reinterpret_cast<int64_t*>(&_bookmark.dateAdded));
NS_ENSURE_SUCCESS(rv, rv);
rv = stmt->GetInt64(8, &_bookmark.lastModified);
rv = stmt->GetInt64(8, reinterpret_cast<int64_t*>(&_bookmark.lastModified));
NS_ENSURE_SUCCESS(rv, rv);
rv = stmt->GetUTF8String(9, _bookmark.guid);
NS_ENSURE_SUCCESS(rv, rv);
@ -1869,10 +1869,10 @@ nsNavBookmarks::ProcessFolderNodeRow(
node = new nsNavHistoryFolderResultNode(title, aOptions, id);
rv = aRow->GetInt64(nsNavHistory::kGetInfoIndex_ItemDateAdded,
&node->mDateAdded);
reinterpret_cast<int64_t*>(&node->mDateAdded));
NS_ENSURE_SUCCESS(rv, rv);
rv = aRow->GetInt64(nsNavHistory::kGetInfoIndex_ItemLastModified,
&node->mLastModified);
reinterpret_cast<int64_t*>(&node->mLastModified));
NS_ENSURE_SUCCESS(rv, rv);
}
else {
@ -1884,10 +1884,10 @@ nsNavBookmarks::ProcessFolderNodeRow(
node->mItemId = id;
rv = aRow->GetInt64(nsNavHistory::kGetInfoIndex_ItemDateAdded,
&node->mDateAdded);
reinterpret_cast<int64_t*>(&node->mDateAdded));
NS_ENSURE_SUCCESS(rv, rv);
rv = aRow->GetInt64(nsNavHistory::kGetInfoIndex_ItemLastModified,
&node->mLastModified);
reinterpret_cast<int64_t*>(&node->mLastModified));
NS_ENSURE_SUCCESS(rv, rv);
}
@ -2277,7 +2277,7 @@ nsNavBookmarks::GetBookmarksForURI(nsIURI* aURI,
NS_ENSURE_SUCCESS(rv, rv);
rv = stmt->GetInt64(2, &bookmark.parentId);
NS_ENSURE_SUCCESS(rv, rv);
rv = stmt->GetInt64(3, &bookmark.lastModified);
rv = stmt->GetInt64(3, reinterpret_cast<int64_t*>(&bookmark.lastModified));
NS_ENSURE_SUCCESS(rv, rv);
rv = stmt->GetUTF8String(4, bookmark.parentGuid);
NS_ENSURE_SUCCESS(rv, rv);

View File

@ -616,7 +616,7 @@ nsNavHistory::FindLastVisit(nsIURI* aURI,
NS_ENSURE_SUCCESS(rv, false);
rv = stmt->GetInt64(1, aSessionID);
NS_ENSURE_SUCCESS(rv, false);
rv = stmt->GetInt64(2, aTime);
rv = stmt->GetInt64(2, reinterpret_cast<int64_t*>(aTime));
NS_ENSURE_SUCCESS(rv, false);
return true;
}
@ -4357,7 +4357,7 @@ nsNavHistory::CheckIsRecentEvent(RecentEventHash* hashTable,
const nsACString& url)
{
PRTime eventTime;
if (hashTable->Get(url, &eventTime)) {
if (hashTable->Get(url, reinterpret_cast<int64_t*>(&eventTime))) {
hashTable->Remove(url);
if (eventTime > GetNow() - RECENT_EVENT_THRESHOLD)
return true;

View File

@ -1604,14 +1604,14 @@ AppendInt64KeyValueIfNonzero(nsACString& aString,
nsINavHistoryQuery* aQuery,
Int64QueryGetter getter)
{
int64_t value;
PRTime value;
DebugOnly<nsresult> rv = (aQuery->*getter)(&value);
NS_ASSERTION(NS_SUCCEEDED(rv), "Failure getting value");
if (value) {
AppendAmpersandIfNonempty(aString);
aString += aName;
nsCAutoString appendMe("=");
appendMe.AppendInt(value);
appendMe.AppendInt(static_cast<int64_t>(value));
aString.Append(appendMe);
}
}