From 64ead40c90539475c76f60259c524867cfdefcfa Mon Sep 17 00:00:00 2001 From: "brettw%gmail.com" Date: Thu, 23 Feb 2006 19:25:40 +0000 Subject: [PATCH] Bug 327740 r=vladimir Replaces REINTERPRET_CASTs with STATIC_CASTs in mozStorageAsyncIO.cpp --- storage/src/mozStorageAsyncIO.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/storage/src/mozStorageAsyncIO.cpp b/storage/src/mozStorageAsyncIO.cpp index 10b99f959edb..f60f54d988aa 100644 --- a/storage/src/mozStorageAsyncIO.cpp +++ b/storage/src/mozStorageAsyncIO.cpp @@ -720,7 +720,7 @@ AppendNewAsyncMessage(AsyncOsFile* aFile, PRUint32 aOp, const char *aData) { // allocate one buffer, we will put the buffer immediately after our struct - AsyncMessage* p = NS_REINTERPRET_CAST(AsyncMessage*, + AsyncMessage* p = NS_STATIC_CAST(AsyncMessage*, nsMemory::Alloc(sizeof(AsyncMessage) + (aData ? aDataSize : 0))); if (! p) return SQLITE_NOMEM; @@ -904,7 +904,7 @@ AsyncClose(OsFile** aFile) { if (AsyncWriteError != SQLITE_OK) return AsyncWriteError; - AsyncOsFile* asyncfile = NS_REINTERPRET_CAST(AsyncOsFile*, *aFile); + AsyncOsFile* asyncfile = NS_STATIC_CAST(AsyncOsFile*, *aFile); if (! asyncfile->mOpen) { NS_NOTREACHED("Attempting to write to a file with a close pending!"); return SQLITE_INTERNAL; @@ -926,13 +926,13 @@ AsyncWrite(OsFile* aFile, const void* aBuf, int aCount) { if (AsyncWriteError != SQLITE_OK) return AsyncWriteError; - AsyncOsFile* asyncfile = NS_REINTERPRET_CAST(AsyncOsFile*, aFile); + AsyncOsFile* asyncfile = NS_STATIC_CAST(AsyncOsFile*, aFile); if (! asyncfile->mOpen) { NS_NOTREACHED("Attempting to write to a file with a close pending!"); return SQLITE_INTERNAL; } int rc = AppendNewAsyncMessage(asyncfile, ASYNC_WRITE, asyncfile->mOffset, - aCount, NS_REINTERPRET_CAST(const char*, aBuf)); + aCount, NS_STATIC_CAST(const char*, aBuf)); asyncfile->mOffset += aCount; return rc; } @@ -948,7 +948,7 @@ AsyncTruncate(OsFile* aFile, sqlite_int64 aNumBytes) { if (AsyncWriteError != SQLITE_OK) return AsyncWriteError; - AsyncOsFile* asyncfile = NS_REINTERPRET_CAST(AsyncOsFile*, aFile); + AsyncOsFile* asyncfile = NS_STATIC_CAST(AsyncOsFile*, aFile); if (! asyncfile->mOpen) { NS_NOTREACHED("Attempting to write to a file with a close pending!"); return SQLITE_INTERNAL; @@ -968,7 +968,7 @@ AsyncOpenDirectory(OsFile* aFile, const char* aName) { if (AsyncWriteError != SQLITE_OK) return AsyncWriteError; - AsyncOsFile* asyncfile = NS_REINTERPRET_CAST(AsyncOsFile*, aFile); + AsyncOsFile* asyncfile = NS_STATIC_CAST(AsyncOsFile*, aFile); if (! asyncfile->mOpen) { NS_NOTREACHED("Attempting to write to a file with a close pending!"); return SQLITE_INTERNAL; @@ -988,7 +988,7 @@ AsyncSync(OsFile* aFile, int aFullsync) { if (AsyncWriteError != SQLITE_OK) return AsyncWriteError; - AsyncOsFile* asyncfile = NS_REINTERPRET_CAST(AsyncOsFile*, aFile); + AsyncOsFile* asyncfile = NS_STATIC_CAST(AsyncOsFile*, aFile); if (! asyncfile->mOpen) { NS_NOTREACHED("Attempting to write to a file with a close pending!"); return SQLITE_INTERNAL; @@ -1007,7 +1007,7 @@ AsyncSetFullSync(OsFile* aFile, int aValue) { if (AsyncWriteError != SQLITE_OK) return; - AsyncOsFile* asyncfile = NS_REINTERPRET_CAST(AsyncOsFile*, aFile); + AsyncOsFile* asyncfile = NS_STATIC_CAST(AsyncOsFile*, aFile); if (! asyncfile->mOpen) { NS_NOTREACHED("Attempting to write to a file with a close pending!"); return; @@ -1037,7 +1037,7 @@ AsyncRead(OsFile* aFile, void *aBuffer, int aCount) // any messages while we do this. Open exclusive may also change mBaseRead. nsAutoLock lock(AsyncQueueLock); - AsyncOsFile* asyncfile = NS_REINTERPRET_CAST(AsyncOsFile*, aFile); + AsyncOsFile* asyncfile = NS_STATIC_CAST(AsyncOsFile*, aFile); if (! asyncfile->mOpen) { NS_NOTREACHED("Attempting to write to a file with a close pending!"); return SQLITE_INTERNAL; @@ -1130,7 +1130,7 @@ AsyncSeek(OsFile* aFile, sqlite_int64 aOffset) { if (AsyncWriteError != SQLITE_OK) return AsyncWriteError; - AsyncOsFile* asyncfile = NS_REINTERPRET_CAST(AsyncOsFile*, aFile); + AsyncOsFile* asyncfile = NS_STATIC_CAST(AsyncOsFile*, aFile); if (! asyncfile->mOpen) { NS_NOTREACHED("Attempting to write to a file with a close pending!"); return SQLITE_INTERNAL; @@ -1157,7 +1157,7 @@ AsyncFileSize(OsFile* aFile, sqlite_int64* aSize) if (AsyncWriteError != SQLITE_OK) return AsyncWriteError; - AsyncOsFile* asyncfile = NS_REINTERPRET_CAST(AsyncOsFile*, aFile); + AsyncOsFile* asyncfile = NS_STATIC_CAST(AsyncOsFile*, aFile); if (! asyncfile->mOpen) { NS_NOTREACHED("Attempting to write to a file with a close pending!"); return SQLITE_INTERNAL; @@ -1209,7 +1209,7 @@ AsyncFileHandle(OsFile* aFile) return SQLITE_OK; // If you actually wanted the file handle you would do this: - //AsyncOsFile* asyncfile = NS_REINTERPRET_CAST(AsyncOsFile*, aFile); + //AsyncOsFile* asyncfile = NS_STATIC_CAST(AsyncOsFile*, aFile); //return sqlite3OsFileHandle(asyncfile->mBaseRead); }