Bug 530409 - Replace PR_MIN/PR_MAX with NS_MIN/NS_MAX in /modules/libjar/, r=tglek
authorJae-Seong Lee-Russo <lusian@gmail.com>
Sun, 13 Dec 2009 09:32:10 -0800
changeset 35670 f952995d5044bd144fe27bad7084b41cb4a9b0b1
parent 35669 868fcb4006046158a3ca4c17b46a213bd910ccf0
child 35671 763b42a826498be2c917f787b283e37c8ae13af7
push id10672
push userphilringnalda@gmail.com
push dateSun, 13 Dec 2009 17:32:43 +0000
treeherdermozilla-central@e89ef920772f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstglek
bugs530409
milestone1.9.3a1pre
Bug 530409 - Replace PR_MIN/PR_MAX with NS_MIN/NS_MAX in /modules/libjar/, r=tglek
modules/libjar/nsJARInputStream.cpp
--- a/modules/libjar/nsJARInputStream.cpp
+++ b/modules/libjar/nsJARInputStream.cpp
@@ -229,17 +229,17 @@ nsJARInputStream::Read(char* aBuffer, PR
         // deflating - this is because zlib buffers the input
         if (mZs.avail_in == 0) {
             mFd = nsnull;
         }
         break;
 
       case MODE_COPY:
         if (mFd) {
-          PRUint32 count = PR_MIN(aCount, mOutSize - mZs.total_out);
+          PRUint32 count = NS_MIN(aCount, mOutSize - PRUint32(mZs.total_out));
           if (count) {
               memcpy(aBuffer, mZs.next_in + mZs.total_out, count);
               mZs.total_out += count;
           }
           *aBytesRead = count;
         }
         // be aggressive about releasing the file!
         // note that sometimes, we will release mFd before we've finished copying.
@@ -281,17 +281,17 @@ nsJARInputStream::ContinueInflate(char* 
     // No need to check the args, ::Read did that, but assert them at least
     NS_ASSERTION(aBuffer,"aBuffer parameter must not be null");
     NS_ASSERTION(aBytesRead,"aBytesRead parameter must not be null");
 
     // Keep old total_out count
     const PRUint32 oldTotalOut = mZs.total_out;
     
     // make sure we aren't reading too much
-    mZs.avail_out = PR_MIN(aCount, (mOutSize-oldTotalOut));
+    mZs.avail_out = NS_MIN(aCount, (mOutSize-oldTotalOut));
     mZs.next_out = (unsigned char*)aBuffer;
 
     // now inflate
     int zerr = inflate(&mZs, Z_SYNC_FLUSH);
     if ((zerr != Z_OK) && (zerr != Z_STREAM_END))
         return NS_ERROR_FILE_CORRUPTED;
 
     *aBytesRead = (mZs.total_out - oldTotalOut);
@@ -378,17 +378,17 @@ nsJARInputStream::ReadDirectory(char* aB
 
     *aBytesRead = numRead;
     return NS_OK;
 }
 
 PRUint32
 nsJARInputStream::CopyDataToBuffer(char* &aBuffer, PRUint32 &aCount)
 {
-    const PRUint32 writeLength = PR_MIN(aCount, mBuffer.Length() - mCurPos);
+    const PRUint32 writeLength = NS_MIN(aCount, mBuffer.Length() - mCurPos);
 
     if (writeLength > 0) {
         memcpy(aBuffer, mBuffer.get() + mCurPos, writeLength);
         mCurPos += writeLength;
         aCount  -= writeLength;
         aBuffer += writeLength;
     }