Bug 499997 - fix signed warnings in eudora import. r=Standard8
authortimeless@mozdev.org
Tue, 02 Nov 2010 10:34:06 +0000
changeset 6632 55086537a691ed45ebb37579ce0c61560cfa88a3
parent 6631 280c04fcaab13326e1a5a7b7bca4d6abedd74f77
child 6633 425b0d7f9506cf10dea04113e94b291672df631c
push idunknown
push userunknown
push dateunknown
reviewersStandard8
bugs499997
Bug 499997 - fix signed warnings in eudora import. r=Standard8
mailnews/import/eudora/src/nsEudoraCompose.cpp
mailnews/import/eudora/src/nsEudoraCompose.h
mailnews/import/eudora/src/nsEudoraMailbox.cpp
--- a/mailnews/import/eudora/src/nsEudoraCompose.cpp
+++ b/mailnews/import/eudora/src/nsEudoraCompose.cpp
@@ -1022,18 +1022,18 @@ nsresult nsEudoraCompose::FillMailBuffer
     read.m_bytesInBuf = 0;
   }
   else if (read.m_writeOffset) {
     memcpy( read.m_pBuffer, read.m_pBuffer + read.m_writeOffset, read.m_bytesInBuf - read.m_writeOffset);
     read.m_bytesInBuf -= read.m_writeOffset;
     read.m_writeOffset = 0;
   }
 
-  PRInt32 count = read.m_size - read.m_bytesInBuf;
-  if (((PRUint32)count + pState->offset) > pState->size)
+  PRUint32 count = read.m_size - read.m_bytesInBuf;
+  if ((count + pState->offset) > pState->size)
     count = pState->size - pState->offset;
   if (count) {
     PRUint32 bytesRead = 0;
     char * pBuffer = read.m_pBuffer + read.m_bytesInBuf;
     nsresult rv = pState->pInputStream->Read(pBuffer, count, &bytesRead);
     if (NS_FAILED( rv)) return( rv);
     if (bytesRead != count) return( NS_ERROR_FAILURE);
     read.m_bytesInBuf += bytesRead;
--- a/mailnews/import/eudora/src/nsEudoraCompose.h
+++ b/mailnews/import/eudora/src/nsEudoraCompose.h
@@ -115,20 +115,20 @@ public:
     if (Write( m_writeOffset, pData, len, &written)) { m_writeOffset += written; return( PR_TRUE);}
     else return( PR_FALSE);
   }
 
   PRBool  SpecialMemCpy( PRInt32 offset, const char *pData, PRInt32 len, PRInt32 *pWritten);
 
   PRBool  m_convertCRs;
   char *  m_pBuffer;
-  PRInt32  m_bytesInBuf;  // used when reading into this buffer
+  PRUint32  m_bytesInBuf;  // used when reading into this buffer
   PRInt32  m_size;      // allocated size of buffer
   PRInt32  m_growBy;    // duh
-  PRInt32  m_writeOffset;  // used when writing into and reading from the buffer
+  PRUint32 m_writeOffset;  // used when writing into and reading from the buffer
 };
 
 
 
 class nsEudoraCompose {
 public:
   nsEudoraCompose();
   ~nsEudoraCompose();
--- a/mailnews/import/eudora/src/nsEudoraMailbox.cpp
+++ b/mailnews/import/eudora/src/nsEudoraMailbox.cpp
@@ -189,18 +189,18 @@ PRUint32 EudoraTOCEntry::GetMozillaStatu
     flags |= nsMsgMessageFlags::MDNReportNeeded;
 
   return flags;
 #endif
 }
 
 
 nsEudoraMailbox::nsEudoraMailbox()
+: m_fromLen(0)
 {
-  m_fromLen = 0;
 }
 
 nsEudoraMailbox::~nsEudoraMailbox()
 {
   EmptyAttachments();
 }
 
 nsresult nsEudoraMailbox::CreateTempFile( nsIFile **ppFile)
@@ -1339,18 +1339,18 @@ nsresult nsEudoraMailbox::FillMailBuffer
     read.m_bytesInBuf = 0;
   }
   else if (read.m_writeOffset) {
     memcpy( read.m_pBuffer, read.m_pBuffer + read.m_writeOffset, read.m_bytesInBuf - read.m_writeOffset);
     read.m_bytesInBuf -= read.m_writeOffset;
     read.m_writeOffset = 0;
   }
 
-  PRInt32  count = read.m_size - read.m_bytesInBuf;
-  if (((PRUint32)count + pState->offset) > pState->size)
+  PRUint32  count = read.m_size - read.m_bytesInBuf;
+  if ((count + pState->offset) > pState->size)
     count = pState->size - pState->offset;
   if (count) {
     PRUint32    bytesRead = 0;
     char *    pBuffer = read.m_pBuffer + read.m_bytesInBuf;
     nsresult  rv = pState->pInputStream->Read(pBuffer, count, &bytesRead);
     if (NS_FAILED( rv)) return( rv);
     if (bytesRead != PRUint32(count)) return( NS_ERROR_FAILURE);
     read.m_bytesInBuf += bytesRead;